-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Expand file tree
/
Copy pathdeployDARC.ts
More file actions
33 lines (26 loc) · 960 Bytes
/
deployDARC.ts
File metadata and controls
33 lines (26 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//import { ethers, upgrades } from "hardhat";
import { ethers } from "hardhat";
import { typeProgram, typePluginArray, typeVotingRuleArray } from "./ProgramTypes";
import { BigNumber } from "ethers";
/**
* The function to deploy DARC contract, initialize it, and return the address.
* @returns The address of the deployed DARC contract.
*/
export async function deployDARC(): Promise<string> {
const DARC = await ethers.getContractFactory("DARC");
const darc = await DARC.deploy();
const signers = await ethers.getSigners();
// for(let i = 0; i < signers.length; i++){
// console.log("signer: " + signers[i].address);
// }
// console.log("DARC address: ", darc.address);
await darc.deployed();
await darc.initialize();
return darc.address;
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
deployDARC().catch((error) => {
console.error(error);
process.exitCode = 1;
});