In veRAACToken.sol voting power is unsafely cast from int128 to uint256:
This involves two casts:
This involves two casts:
bias (int128) → uint128
uint128 → uint256
The first cast from int128 to uint128 is unsafe because:
If bias is negative, it will result in unexpected behavior
Even if bias is positive, if its value is larger than type(uint128).max, it will be truncated
In VotingPowerLib.sol, there are several similar unsafe casts:
and
Unsafe type casting in voting power calculations could lead to:
Incorrect voting power assignments
Potential system manipulation through overflow/underflow
Loss of governance functionality if power calculations fail
Possible economic impact if voting power affects reward calculations
Implement safe casting utility functions
or user OpenZeppelin’s 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.