From 98caa9614b42d675cca64588cb678e9f22e486dd Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 16 Oct 2026 13:22:14 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20deploy:=20list=20markets=20along?= =?UTF-8?q?side=20auditor=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/Markets.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/deploy/Markets.ts b/deploy/Markets.ts index 802017bff..5ea0f1893 100644 --- a/deploy/Markets.ts +++ b/deploy/Markets.ts @@ -17,7 +17,17 @@ const func: DeployFunction = async ({ }, live, }, - ethers: { MaxUint256, ZeroAddress, parseUnits, getContractOrNull, getContract, getSigner, keccak256, toUtf8Bytes }, + ethers: { + MaxUint256, + ZeroAddress, + parseUnits, + getContractOrNull, + getContract, + getContractAt, + getSigner, + keccak256, + toUtf8Bytes, + }, deployments: { deploy, get, getOrNull }, getNamedAccounts, }) => { @@ -186,12 +196,14 @@ const func: DeployFunction = async ({ } const adjustFactor = parseUnits(String(config.adjustFactor)); const nonCollateral = config.nonCollateral ?? false; - const supportsNonCollateral = auditor.interface.hasFunction("setNonCollateral"); + const { abi } = await get("Auditor_Implementation"); + const nextAuditor = (await getContractAt(abi, auditor.target)) as unknown as Auditor; + const supportsNonCollateral = nextAuditor.interface.hasFunction("setNonCollateral"); if (config.nonCollateral !== undefined && !supportsNonCollateral) { throw new Error(`${marketName}: nonCollateral is configured but the auditor deployment predates it`); } if (!(await auditor.allMarkets()).includes(market.target as string)) { - await executeOrPropose(auditor, "enableMarket", [ + await executeOrPropose(nextAuditor, "enableMarket", [ market.target, priceFeed, adjustFactor, @@ -204,7 +216,7 @@ const func: DeployFunction = async ({ if ((await auditor.markets(market.target)).adjustFactor !== adjustFactor) { await executeOrPropose(auditor, "setAdjustFactor", [market.target, adjustFactor]); } - if (supportsNonCollateral && (await auditor.markets(market.target)).nonCollateral !== nonCollateral) { + if (supportsNonCollateral && ((await auditor.markets(market.target)).nonCollateral ?? false) !== nonCollateral) { await executeOrPropose(auditor, "setNonCollateral", [market.target, nonCollateral]); } }