The emergencyWithdraw
function in BaseGauge allows admin to withdraw any token, including the staking token, without updating internal accounting:
This creates a critical state inconsistency:
Admin can withdraw staking tokens
Internal accounting (_totalSupply
, _balances
) remains unchanged
Future user withdrawals will fail due to insufficient contract balance
Reward calculations become incorrect as they rely on totalSupply()
It has High
impact:
Users unable to withdraw staked tokens
Incorrect reward distributions due to wrong totalSupply
Permanent desync between real and recorded balances
Either prevent withdrawal of staking token:
Or update state when withdrawing staking token:
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.