Utilise OpenZeppelin's Governance contract wizard to deploy a decentralised governance system which allows a user to create a proposal (which contains some proposed code to execute), then allow all users (who hold the 'MyToken' ERC20 token which is deployed at the same time) to cast votes on whether the proposal should be accepted or rejected. If the proposal is accepted, the code can be executed.
Deploy the governor contract and token on the Sepolia test network.
- Add a Sepolia URL and private key to the hardhat config so that you can interact with the test network through Hardhat.
- Reconfigure the contracts and deployment scripts:
- Use a different voting period in MyGovernor.
- delegate the votes to the owner
- create a proposal
- vote on the proposal
- execute the proposal
- Deploy the contracts to Sepolia
npx hardhat run scripts/deploy.js --network sepolia
.
- Deploy: MyGovernor
- Deploy: MyToken
- Delegate (votes)
- Create Proposal
- Wait 75 blocks for voting to open (Block 4061418 + 75)
- Cast Vote
- Wait 300 blocks for voting to close (Block 4061496 + 300)
- Execute Proposal
Dependency npm:@openzeppelin/contracts:4.8.0 is vulnerable, safe version 4.8.3
CVE-2023-26488
6.5 Incorrect Calculation vulnerability with medium severity found CVE-2023-30542
8.8 Improper Input Validation vulnerability pending CVSS allocation CVE-2023-30541
5.3 Interpretation Conflict vulnerability pending CVSS allocation