Skip to content

Implement snapshot-based voting weight to prevent flash voting …#9

Merged
hman38705 merged 1 commit intosolutions-plug:developfrom
Mac-5:features/issue-3-Snapshot-Based-Verifiable-Voting-Weight
Feb 20, 2026
Merged

Implement snapshot-based voting weight to prevent flash voting …#9
hman38705 merged 1 commit intosolutions-plug:developfrom
Mac-5:features/issue-3-Snapshot-Based-Verifiable-Voting-Weight

Conversation

@Mac-5
Copy link
Copy Markdown
Contributor

@Mac-5 Mac-5 commented Feb 19, 2026

…attacks

  • Add dispute_snapshot_ledger field to Market struct to capture ledger sequence when dispute is filed
  • Implement try_get_balance_at() to query governance token balance at snapshot ledger
  • Add fallback mechanism that locks tokens for 3-day resolution period if token doesn't support snapshots
  • Add InsufficientVotingWeight and GovernanceTokenNotSet error codes
  • Add LockedTokens struct and unlock_tokens() function for fallback mechanism
  • Add set_governance_token() admin function to configure governance token
  • Comprehensive test suite covering:
    • Balance changes after snapshot (flash loan prevention)
    • Zero balance at snapshot rejection
    • Token locking fallback mechanism
    • Insufficient balance validation
    • Ledger sequence capture verification
      Closes Snapshot-Based Verifiable Voting Weight #3

Loading
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.

2 participants