Skip to content

fix(sdk): vote token decimals and governance spell deployments in the decoder - #53

Merged
JuampiRombola merged 2 commits into
mainfrom
fix/vote-token-decimals
Nov 6, 2026
Merged

JuampiRombola merged 2 commits into
mainfrom
fix/vote-token-decimals

Conversation

@JuampiRombola

@JuampiRombola JuampiRombola commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Two governance fixes in one patch release.

Vote token decimals

Governance amounts used a fixed 18 decimals. A vote-lock vault on a token with other decimals (for example vlUSDC, 6 decimals) showed wrong values: quorum 0 of 0.00000000000003 instead of 0.03, voting power 0.00 instead of 0.3, and delegates with 0.00 votes. Comparisons on raw values were correct; only the formatted values were wrong.

  • Proposal mappers set voteTokenDecimals from the subgraph vote token. getProposalState uses it for the threshold amounts.
  • Voter, proposer, proposal-voter and optimistic readers read decimals() of the vote token in the multicall they already make. getProposerState with a timepoint and getProposalVotes add one read when the caller does not pass voteTokenDecimals.
  • GetIndexDtfDelegates reads the token decimals.
  • All new fields and parameters are optional. Without them, the default stays 18.

Governance spell deployments

The decoder knew only the first GovernanceSpell_09_18_2026 deployments. Proposals to the later spells showed "Unknown Contract" when the explorer ABI was not available (reported on reserve-protocol/register#1156).

Verification

  • Unit tests with a 6-decimal token for the threshold state, voter state, proposer state, proposal votes, delegates and the optimistic context.
  • Unit tests that decode a call to each new spell deployment.
  • test (518 passed), typecheck, lint, format:check, graphql:codegen:check and build pass.
  • Live check on Base (vlUSDC vault 0xbaad…682a): voter state reads 0.3, and a proposal reads quorum 0.03 with 0.3 votes.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa00426d-0567-4032-a51d-ecbf7bc5a694
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…uding the 2% and 1% redeployments and OPEN's spell
@JuampiRombola JuampiRombola changed the title fix(sdk): format governance amounts with the vote token decimals fix(sdk): vote token decimals and governance spell deployments in the decoder Nov 6, 2026
@JuampiRombola
JuampiRombola merged commit cf9c54c into main Nov 6, 2026
3 checks passed
@JuampiRombola
JuampiRombola deleted the fix/vote-token-decimals branch November 6, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant