Users can still cast their votes on a canceled proposal, since there is lack of a check for a canceled proposal.
The castVote()
function does not check if a proposal has been canceled, allowing users to cast votes.
If canceled early, users could still cast their votes until block.timestamp > proposal.endTime
Voting on a canceled proposal should not be possible, as the proposal is no longer valid. It simply defeats the purpose of canceling a proposal.
Place the provided code in test/unit/core/governance/Governance.test.js
Execute the test with this command: npx hardhat test --grep "should not allow to cancel and then castVote, but it happens"
Manual
Add a check to see if a proposal is canceled.
Create a new custom error if you want.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.