The stake() and withdraw() functions in BaseGauge lack the whenNotPaused modifier, allowing users to continue staking and accruing rewards even when the contract is emergency paused.
The BaseGauge contract implements Pausable functionality to allow emergency halting of operations. However, the critical staking functions stake() and withdraw() are missing the whenNotPaused modifier:
This oversight means that even when the contract is paused via setEmergencyPaused(true), users can continue to:
Stake new tokens
Withdraw staked tokens
Accrue rewards through the updateReward modifier
This defeats the purpose of the emergency pause mechanism which is intended to halt all contract operations during critical situations.
Admin calls setEmergencyPaused(true) due to discovered vulnerability
Despite pause, users can still call stake() to deposit tokens
The updateReward modifier continues updating reward state
Users accrue rewards during the emergency pause period
Once unpaused, users can claim accumulated rewards via getReward()
Emergency pause mechanism is partially ineffective
Users can continue to interact with core staking functionality during critical situations
Rewards continue to accrue when they should be frozen
Potential financial loss if rewards need to be halted immediately
Add whenNotPaused modifier
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.