[BOUNTY]: Implement revokable governance referendum proposal votes for users wishing to unlock their CELO expeditiously
See original GitHub issue[BOUNTY]: Implement revokable governance referendum proposal votes for users wishing to unlock their CELO expeditiously
Challenge Description
This bounty is an additional feature for the Governance contract which manages changes to the protocol.
Governance participants must lock their CELO via LockedCelo in order to vote (to ensure skin in the game). If a user’s locked CELO is being used to vote, it cannot be unlocked.
Governance.isVoting
uses an account’s single upvote to check if the voter is voting on a proposal in the queue, and the most recent referendum proposal to check if the voter is voting on the dequeue (is this proposal in referendum). Revoking an upvote is already supported. However, simply revoking a referendum vote would break our isVoting
check when the most recent referendum proposal is not the only referendum proposal being voted upon in the dequeue.
We can safely unvote all of the dequeue referendum proposals at once by enumerating all of the dequeued proposal indices, decrementing the stored voter record, and subsequently zeroing the most recent referendum proposal. Care should be taken to use the stored vote record weight rather than the canonical voter weight, and the proposal’s network weight should be updated.
Submission Requirements
A PR should be submitted to the Governance contract with a new function endpoint revokeVotes()
, as well as additional unit tests for this function and isVoting
. Please link this PR in your GitCoin submission. Pay out will be granted on successful merge into the celo-monorepo.
The bounty payout will be for $250 equivalent of CELO.
Prerequisites
Knowledge of Solidity, Truffle, and Typescript will be required to complete this bounty. Once the celo-monorepo is setup, development should be done in the protocol
package. yarn build
and yarn test
should suffice.
Time Expectation
Expect this bounty to take a developer familiar with Truffle, Solidity and Typescript about 5 hours.
Resources
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@yorhodes I have created PR in Draft state. Please review the PR and let me know if I have covered all the scenarios. Also, I am not sure if I am reverting the networkWeight correctly. Thank you.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
The funding of 50.0 CELO (277.0 USD @ $5.54/CELO) attached to this issue has been approved & issued to @deepakhb2.