dgf-prototype/ethereum/scripts/verify.js

44 lines
1.2 KiB
JavaScript

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,
});
console.log('Verified DAO contract');
await run('verify:verify', {
address: contractAddresses[network].Work1,
constructorArguments: [
contractAddresses[network].DAO,
work1Price,
],
});
console.log('Verified Work1 contract');
await run('verify:verify', {
address: contractAddresses[network].Onboarding,
constructorArguments: [
contractAddresses[network].DAO,
onboardingPrice,
],
});
console.log('Verified Onboarding contract');
}
}
// 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;
});