ve-lock-governance

Solid

Detect vote-escrow (ve) governance manipulation — Curve veCRV, Velodrome/Aerodrome veNFT, Balancer veBAL, and gauge/bribe markets. Activate whenever code reads voting power from a lock balance, computes gauge weights, distributes bribes/incentives, snapshots votes, or lets locks be created/extended/merged/split/transferred — especially when vote weight is read live rather than at proposal-creation block.

AI & Automation 38 stars 5 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
53
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Vote-escrow lock governance detection ## When this applies Trigger on any of: - Locking tokens for time-decayed voting power (`create_lock`, `increase_amount`, `increase_unlock_time`) - Reading `balanceOf`/`balanceOfNFT`/`votingPower` from a ve contract during a vote or weight calc - Gauge-weight voting, gauge controller `vote_for_gauge_weights`, emission direction - Bribe / incentive markets (Votium, Hidden Hand, Velodrome `BribeVotingReward`) - veNFT transfer, `merge`, `split`, `withdraw`, `delegate` - Proposal systems that read voting power without a snapshot block ## Detection patterns ### Live vote weight, no snapshot (HIGH / CRITICAL) ```solidity function castVote(uint256 proposalId, bool support) external { uint256 weight = ve.balanceOf(msg.sender); // ← read NOW, not at proposal start proposals[proposalId].votes[support] += weight; } ``` **Signal:** voting power read at vote time enables flash-lock: borrow, lock, vote, then exit if `withdraw` allowed same block, or vote with freshly minted power. Snapshot at proposal-creation block (`getPastVotes`). ### Gauge-weight manipulation (HIGH) Last-block vote stuffing before the weekly checkpoint redirects emissions. If gauge weights are read at the instant of `checkpoint_gauge` with no time-weighting, a single-block max vote captures a full epoch of emissions (Curve gauge-war griefing class). **Signal:** emission direction determined by instantaneous weight, not a bias-weighted moving average. ### veNFT me...

Details

Author
iktok90-design
Repository
iktok90-design/ai-smart-contract-auditor
Created
1 weeks ago
Last Updated
2 days ago
Language
JavaScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category