Under normal behavior, stakers can call withdraw() to pull their funds out of the pool as long as the agreement has not entered an active-risk state (i.e., riskWindowStart == 0).
In ConfidencePool.withdraw(), the code explicitly reverts if riskWindowStart != 0. However, a few lines later, it calls _clampUserSums(msg.sender). Inside _clampUserSums(), the very first check is if (start == 0) return;. Since withdraw() guarantees riskWindowStart is 0, the _clampUserSums() function will always immediately return without modifying any state, needlessly consuming gas for the internal call.
Likelihood: High
Every single call to withdraw() executes this redundant internal function call.
Impact: Low
Stakers waste a small amount of gas per withdraw() execution on a useless internal call and a branch evaluation.
Remove the _clampUserSums(msg.sender) call from the withdraw() function to save gas.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.