The GaugeController
contract implements a voting mechanism that lacks proper time-weighted voting and weight decay functionality. This is a significant deviation from the established Curve Finance model and what is documented. This leads to manipulation of gauge weights and improper reward distribution.
The current implementation uses a simple arithmetic calculation for updating gauge weights:
1.No Linear Decay:
Votes maintain their full weight until explicitly changed
No automatic reduction in voting power over time
Weights don't reflect the diminishing influence of older votes
2. Lack of Time-Weighting:
Votes are counted at face value without considering time
No bias/slope mechanism for gradual power reduction
No consideration of veToken lock duration
3.Immediate Weight Updates:
Changes take effect immediately without proper scheduling
No checkpoint system for tracking historical weights
No mechanism for calculating weights at specific timestamps
In order to run the test you need to:
Run foundryup
to get the latest version of Foundry
Install hardhat-foundry: npm install --save-dev @nomicfoundation/hardhat-foundry
Import it in your Hardhat config: require("@nomicfoundation/hardhat-foundry");
Make sure you've set the BASE_RPC_URL
in the .env
file or comment out the forking
option in the hardhat config.
Run npx hardhat init-foundry
There is one file in the test folder that will throw an error during compilation so rename the file in test/unit/libraries/ReserveLibraryMock.sol
to => ReserveLibraryMock.sol_broken
so it doesn't get compiled anymore (we don't need it anyways).
Create a new folder test/foundry
Paste the below code into a new test file i.e.: FoundryTest.t.sol
Run the test: forge test --mc FoundryTest -vvvv
Users can maintain influence without active participation
No incentive to maintain long-term veToken locks
Potential for last-minute vote changes before reward distribution
Rewards may be distributed based on stale or manipulated weights
No correlation between lock duration and voting influence
Potential for gaming reward distributions
Misalignment with veToken time-locking mechanism
Foundry
Manual Review
Uses slope and bias to create time-decaying votes (slope/bias is already implemented in veRAACToken but make sure this works as expected)
Votes should naturally decrease over time based on lock duration
Schedule weight changes for future week
Implement a checkpoint system to maintain historical points for accurate weight calculation
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.