-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.ts
27 lines (22 loc) · 828 Bytes
/
deploy.ts
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
import { ethers } from "hardhat";
async function main() {
const config = {
votingPeriod: 2 * 24 * 60 * 60,
gracePeriod: 24 * 60 * 60,
proposalExpiryPeriod: 5 * 24 * 60 * 60,
founderName: "Viktor Isaev"
};
const MutualFund = await ethers.getContractFactory("MutualFund");
const deployTransaction = MutualFund.getDeployTransaction(config, { gasLimit: 30000000 });
const gasCost = await ethers.provider.estimateGas(deployTransaction);
console.log("Estimated gas cost:", ethers.utils.formatEther(gasCost));
console.log("Deploying fund contract...");
const fund = await MutualFund.deploy(config, { gasLimit: 30000000 });
console.log("Contract deployed to address:", fund.address);
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});