Skip to content

Commit

Permalink
Update scripts & tasks for Base Sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
RCantu92 committed Apr 15, 2024
1 parent 29536cb commit 18434b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/utils/contractHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ const getBlockExplorerDomain = (hre) => {
return 'www.oklink.com/amoy';
case 'sepolia':
return 'sepolia.etherscan.io';
case 'basesepolia':
return 'sepolia.basescan.org'
}
};

Expand Down
15 changes: 12 additions & 3 deletions tasks/prepare-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 18434b1

Please sign in to comment.