Compare commits

...

2 Commits

Author SHA1 Message Date
ea9b28457c Add waiting for contracts deployment before verification 2023-06-13 12:32:09 -07:00
f2a0e18cc0 Fix merge conflicts 2023-06-13 11:37:43 -07:00
2 changed files with 38 additions and 21 deletions

@ -23,18 +23,15 @@
"web3-utils": "^1.10.0" "web3-utils": "^1.10.0"
}, },
"devDependencies": { "devDependencies": {
<<<<<<< HEAD
"@nomiclabs/hardhat-ethers": "^2.2.3", "@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6", "@nomiclabs/hardhat-waffle": "^2.0.6",
"chai": "^4.3.7", "chai": "^4.3.7",
"ethereum-waffle": "^4.0.10", "ethereum-waffle": "^4.0.10",
"ethers": "^6.5.1", "ethers": "^6.5.1",
=======
"@nomicfoundation/hardhat-foundry": "^1.0.1", "@nomicfoundation/hardhat-foundry": "^1.0.1",
"@nomicfoundation/hardhat-verify": "^1.0.1", "@nomicfoundation/hardhat-verify": "^1.0.1",
"@nomiclabs/hardhat-ethers": "^2.2.3", "@nomiclabs/hardhat-ethers": "^2.2.3",
"ethers": "^5", "ethers": "^5",
>>>>>>> 80078475d5d09a2b730f8334120a524d069ec5b1
"hardhat": "^2.15.0", "hardhat": "^2.15.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.1.3" "typescript": "^5.1.3"

@ -1,28 +1,48 @@
const hre = require('hardhat') const hre = require("hardhat");
const config = require("../config") const config = require("../config");
const { ethers } = hre const { ethers } = hre;
const sleep = (s) => new Promise((r) => setTimeout(r, s * 1000));
async function main() { async function main() {
const factory_staking = await ethers.getContractFactory("TornadoStakingRewards") const factory_staking = await ethers.getContractFactory(
const factory_proposal = await ethers.getContractFactory("Proposal") "TornadoStakingRewards"
);
const factory_proposal = await ethers.getContractFactory(
"RestoreRewardsProposal"
);
const staking = await factory_staking.deploy(config.governanceProxy, config.torn, config.registryProxy) const staking = await factory_staking.deploy(
config.governanceProxy,
config.torn,
config.registryProxy
);
await sleep(20);
console.log("\nStaking contract impl successfully deployed @ " + staking.address + '\n') console.log(
"\nStaking contract impl successfully deployed @ " + staking.target + "\n"
);
await hre.run('verify:verify', { await hre.run("verify:verify", {
address: staking.address, address: staking.target,
constructorArguments: [config.governanceProxy, config.torn, config.registryProxy], constructorArguments: [
}) config.governanceProxy,
config.torn,
config.registryProxy,
],
});
const proposal = await factory_proposal.deploy(staking.address) const proposal = await factory_proposal.deploy(staking.target);
await sleep(20);
console.log("\nProposal 25 successfully deployed @ " + proposal.address + '\n') console.log(
"\nProposal 25 successfully deployed @ " + proposal.target + "\n"
);
await hre.run('verify:verify', { await hre.run("verify:verify", {
address: proposal.address, address: proposal.target,
constructorArguments: [staking.address], constructorArguments: [staking.target],
}) });
} }
main().then((res) => console.log(res ?? "\nScript finished.\n")) main().then((res) => console.log(res ?? "\nScript finished.\n"));