The VotingPowerLib contract contains a critical vulnerability in the getCurrentPower() function where unsafe typecasting from int128 to uint256 via uint128 could result in incorrect voting power calculations. The function casts negative voting power values to unsigned integers without proper validation, potentially resulting in large positive voting power values.
Negative voting power could be interpreted as extremely large positive values
Potential manipulation of governance voting weights
Incorrect voting power calculations leading to governance attacks
Possible circumvention of voting power decay mechanisms
Could affect protocol-wide voting outcomes and decision-making
Use OpenZeppelin's SafeCast:
Manual Review
Foundry Testing Framework
OpenZeppelin SafeCast Library
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.