Gate rounds voting by delegated Gnars votes#115
Open
xSatori wants to merge 1 commit into
Open
Conversation
|
@xSatori is attempting to deploy a commit to the r4to's projects Team on Vercel. A member of the Team first needs to authorize it. |
2 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this addresses
This PR upgrades rounds voting so future round votes are gated by delegated Gnars DAO governance voting power. A connected wallet now needs at least 1 delegated Gnars DAO vote from the Gnars token contract before it can vote in any rounds strategy.
Code to review
src/services/round-voting-power.tsDAO_ADDRESSES.tokenwithserverPublicClient.readContract.getVotes(address)rather thanbalanceOf.0on RPC/read failure so voting is blocked instead of granted.src/services/rounds.tsgetRoundVotingPowerto gate every strategy behind delegated Gnars votes.one_per_walletreturns1only when delegated voting power is positive.fixed_per_walletreturnsround.votesPerWalletonly when delegated voting power is positive.one_per_nftnow returns delegated governance voting power.src/app/api/rounds/[slug]/voting-power/route.tsGET /api/rounds/[slug]/voting-power?wallet=....walletAddress,votingPower,usedVotes, andremainingVotes.src/components/rounds/RoundDetailView.tsxremainingVotesfor allocation limits and submit enablement.0voting power.Regression coverage
src/services/round-voting-power.test.tssrc/app/api/rounds/[slug]/voting-power/route.test.tssrc/components/rounds/RoundDetailView.test.tsxTest plan
pnpm test11test files passed86tests passed1todopnpm lint0errors<img>usage outside the rounds filesReview notes
This branch was rebuilt from current
upstream/mainso the PR only contains the delegated-vote gating change. The main behavior to review is the mapping between delegated governance votes and each rounds voting strategy, especiallyone_per_nft, which now uses delegated Gnars DAO voting power directly instead of the previous safe one-wallet fallback.