From 18434b1de1cdbce080a02780956ffee9314ce62e Mon Sep 17 00:00:00 2001 From: Roberto Cantu Date: Mon, 15 Apr 2024 17:20:56 -0500 Subject: [PATCH] Update scripts & tasks for Base Sepolia --- scripts/utils/contractHelpers.js | 2 ++ tasks/prepare-upgrade.js | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/utils/contractHelpers.js b/scripts/utils/contractHelpers.js index 87022aa1..4bd5e43c 100644 --- a/scripts/utils/contractHelpers.js +++ b/scripts/utils/contractHelpers.js @@ -150,6 +150,8 @@ const getBlockExplorerDomain = (hre) => { return 'www.oklink.com/amoy'; case 'sepolia': return 'sepolia.etherscan.io'; + case 'basesepolia': + return 'sepolia.basescan.org' } }; diff --git a/tasks/prepare-upgrade.js b/tasks/prepare-upgrade.js index 35959f45..1300ed55 100644 --- a/tasks/prepare-upgrade.js +++ b/tasks/prepare-upgrade.js @@ -22,12 +22,21 @@ function getNewImplementation(prepareUpgradeResult) { return typeof prepareUpgradeResult === 'string' ? prepareUpgradeResult : getContractAddress(prepareUpgradeResult); } -async function prepareUpgrade(hre, name, upgradesConfig, deploymentInfo, multisigAddress, outputWriter) { +async function prepareUpgrade(hre, name, upgradesConfig, deploymentInfo, multisigAddress, outputWriter, chainId) { console.log(`Deploying new implementation for contract ${name} ...`); const { opts } = prepareParams(upgradesConfig, name, deploymentInfo, multisigAddress); const proxyAddress = parseAddress(deploymentInfo, kebabize(name)); - const cf = await hre.ethers.getContractFactory(name) + // Use correct FORT token name depending on whether + // it is Polygon mainnet or the Base Sepolia testnet + let cf; + if(name === "Forta" && chainId === 84532) { + baseSepoliaName = "FortaBridgedBaseSepolia"; + cf = await hre.ethers.getContractFactory(baseSepoliaName) + } else { + cf = await hre.ethers.getContractFactory(name) + } + console.group("Summary for prepareUpgrade") console.log({ proxyAddress, @@ -116,7 +125,7 @@ async function main(args, hre) { try { for (const name of contractNames) { - await prepareUpgrade(hre, name, upgradesConfig, deploymentInfo, multisigAddress, outputWriter); + await prepareUpgrade(hre, name, upgradesConfig, deploymentInfo, multisigAddress, outputWriter, chainId); } } finally { saveResults(hre, chainId, args);