-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.js
More file actions
22 lines (20 loc) · 1000 Bytes
/
Copy pathdeploy.js
File metadata and controls
22 lines (20 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat
// will compile your contracts, add the Hardhat Runtime Environment's members to the
// global scope, and execute the script.
const hre = require("hardhat");
async function main() {
const votingContract = await hre.ethers.getContractFactory("Voting");
const deployedVotingContract = await votingContract.deploy();
console.log(`Voting contract deployed to: ${deployedVotingContract.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;
});
// Voting contract deployed to: 0xcaeD9b24111d8f33E4947AAD54Baef34DDBEfC41
// https://mumbai.polygonscan.com/address/0xcaeD9b24111d8f33E4947AAD54Baef34DDBEfC41#code