-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Snowfork/review
Minor fixes/README/script improvements during review
- Loading branch information
Showing
5 changed files
with
58 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const network = process.env.HARDHAT_NETWORK | ||
const hre = require("hardhat"); | ||
const ethers = hre.ethers; | ||
const GovernorAlpha = require(`../deployments/${network}/GovernorAlpha.json`) | ||
const proposalID = process.argv[2] | ||
|
||
async function main() { | ||
const provider = ethers.providers.getDefaultProvider(network); | ||
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider); | ||
const contract = new ethers.Contract(GovernorAlpha.address, GovernorAlpha.abi, wallet); | ||
|
||
const tx = await contract.cancel(proposalID) | ||
console.log("Transaction hash: ", tx.hash) | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const network = process.env.HARDHAT_NETWORK | ||
const hre = require("hardhat"); | ||
const ethers = hre.ethers; | ||
const GovernorAlpha = require(`../deployments/${network}/GovernorAlpha.json`) | ||
const { encodeParameters } = require('../test/Utils/Ethereum'); | ||
const proposal = require(process.argv[2]) | ||
|
||
async function main() { | ||
callDatas = [encodeParameters(proposal.parameters.types, proposal.parameters.values)] | ||
const provider = ethers.providers.getDefaultProvider(network); | ||
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider); | ||
const contract = new ethers.Contract(GovernorAlpha.address, GovernorAlpha.abi, wallet); | ||
|
||
const tx = await contract.propose(proposal.targets, proposal.values, proposal.signatures, callDatas, proposal.description, { gasPrice: 20000000000, gasLimit: 7600000 }) | ||
console.log("Transaction hash: ", tx.hash) | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |