dgf-prototype/ethereum/scripts/verify.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

const { ethers, run } = require('hardhat');
const contractAddresses = require('../contract-addresses.json');
require('dotenv').config();
const network = process.env.HARDHAT_NETWORK;
const work1Price = ethers.parseEther(process.env.WORK1_PRICE || 0.001);
const onboardingPrice = ethers.parseEther(process.env.ONBOARDING_PRICE || '0.001');
async function main() {
// Unless deploying locally, run the verify task
if (network !== 'localhost') {
await run('verify:verify', {
address: contractAddresses[network].DAO,
});
await run('verify:verify', {
2024-04-02 14:04:55 -05:00
address: contractAddresses[network].Proposals,
constructorArguments: [
contractAddresses[network].DAO,
],
});
await run('verify:verify', {
2024-04-02 14:04:55 -05:00
address: contractAddresses[network].Work1,
constructorArguments: [
contractAddresses[network].DAO,
2024-04-02 14:04:55 -05:00
contractAddresses[network].Proposals,
work1Price,
],
});
2024-03-29 10:59:29 -05:00
await run('verify:verify', {
2024-04-02 14:04:55 -05:00
address: contractAddresses[network].Onboarding,
2024-03-29 10:59:29 -05:00
constructorArguments: [
contractAddresses[network].DAO,
2024-04-02 14:04:55 -05:00
contractAddresses[network].Proposals,
onboardingPrice,
2024-03-29 10:59:29 -05:00
],
});
}
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});