dgf-prototype/ethereum/scripts/deploy.js

22 lines
598 B
JavaScript

const { ethers } = require('hardhat');
async function main() {
const dao = await ethers.deployContract('DAO');
await dao.waitForDeployment();
console.log(`DAO deployed to ${dao.target}`);
const WORK1_PRICE = ethers.parseEther('0.001');
const work1 = await ethers.deployContract('Work1', [dao.target, WORK1_PRICE]);
await work1.waitForDeployment();
console.log(`Work1 deployed to ${work1.target}`);
}
// 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;
});