Skip to content

Commit

Permalink
chore: EmissionsController for Ropsten
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Dec 7, 2021
1 parent ec54e5a commit 6905f60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 1 addition & 6 deletions tasks/utils/emissions-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ import { verifyEtherscan } from "./etherscan"
import { getChain, resolveAddress } from "./networkAddressFactory"
import { Chain, MTA } from "./tokens"

export const sleep = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms))

export const deployEmissionsController = async (signer: Signer, hre: HardhatRuntimeEnvironment): Promise<EmissionsController> => {
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)

Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions tasks/utils/etherscan.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { HardhatRuntimeEnvironment } from "hardhat/types"

export const sleep = (ms: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms))

interface VerifyEtherscan {
address: string
contract?: string
Expand All @@ -11,6 +13,9 @@ interface VerifyEtherscan {
}

export const verifyEtherscan = async (hre: HardhatRuntimeEnvironment, contract: VerifyEtherscan): Promise<void> => {
// 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)
Expand Down
2 changes: 1 addition & 1 deletion tasks/utils/networkAddressFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6905f60

Please sign in to comment.