From 6905f60a0e3150b58f261a06adb4d560d533ae65 Mon Sep 17 00:00:00 2001 From: Nicholas Addison Date: Tue, 7 Dec 2021 22:39:47 +1100 Subject: [PATCH] chore: EmissionsController for Ropsten --- tasks/utils/emissions-utils.ts | 7 +------ tasks/utils/etherscan.ts | 5 +++++ tasks/utils/networkAddressFactory.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/utils/emissions-utils.ts b/tasks/utils/emissions-utils.ts index b3a7366a..7d902df9 100644 --- a/tasks/utils/emissions-utils.ts +++ b/tasks/utils/emissions-utils.ts @@ -24,14 +24,12 @@ import { verifyEtherscan } from "./etherscan" import { getChain, resolveAddress } from "./networkAddressFactory" import { Chain, MTA } from "./tokens" -export const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)) - export const deployEmissionsController = async (signer: Signer, hre: HardhatRuntimeEnvironment): Promise => { const chain = getChain(hre) const nexusAddress = resolveAddress("Nexus", chain) const proxyAdminAddress = resolveAddress("DelayedProxyAdmin", chain) - const mtaAddress = MTA.address + const mtaAddress = resolveAddress("MTA", chain) const mtaStakingAddress = resolveAddress("StakedTokenMTA", chain) const mbptStakingAddress = resolveAddress("StakedTokenBPT", chain) @@ -269,9 +267,6 @@ export const deployBridgeForwarder = async ( console.log(`Governor calls EmissionsController.addDial ${emissionsControllerAddress} with params:`) console.log(`recipient ${bridgeForwarder.address}, cap 0, notify true`) - // wait 10 seconds - await sleep(10000) - await verifyEtherscan(hre, { address: bridgeForwarderImpl.address, constructorArguments, diff --git a/tasks/utils/etherscan.ts b/tasks/utils/etherscan.ts index ea7eed20..8155a2d2 100644 --- a/tasks/utils/etherscan.ts +++ b/tasks/utils/etherscan.ts @@ -1,5 +1,7 @@ import { HardhatRuntimeEnvironment } from "hardhat/types" +export const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)) + interface VerifyEtherscan { address: string contract?: string @@ -11,6 +13,9 @@ interface VerifyEtherscan { } export const verifyEtherscan = async (hre: HardhatRuntimeEnvironment, contract: VerifyEtherscan): Promise => { + // wait for the Etherscan backend to pick up the deployed contract + await sleep(10000) + if (hre.network.name !== "hardhat") { console.log(`About to verify ${contract.address} on Etherscan`) await hre.run("verify:verify", contract) diff --git a/tasks/utils/networkAddressFactory.ts b/tasks/utils/networkAddressFactory.ts index 8c34d3a2..709fd4dc 100644 --- a/tasks/utils/networkAddressFactory.ts +++ b/tasks/utils/networkAddressFactory.ts @@ -282,7 +282,7 @@ export const getChainAddress = (contractName: ContractNames, chain: Chain): stri // Will become redundant after the Emissions Controller is deployed return "0x973E0B9E1b0bf43B1B8dDf9D6A2f817138cf3C10" case "EmissionsController": - return "0x548776F8DA7620B8B7701BfA2157Ad855094f536" + return "0x2d1864922c7C9B9f9a3609ceA70101b638Aac63C" case "PolygonRootChainManager": // Is MockRootChainManager return "0x0C4964457610970a2884B8A74a397Eb9ba37D9d4"