The delegateBoost function does not update the pool's totalBoost and workingSupply when a delegation is created. However, the removeBoostDelegation function subtracts the delegation amount from these values when the delegation is removed. This inconsistency can lead to incorrect state tracking and disrupt the boost mechanics of the system.
When a user delegates boost using the delegateBoost function, the delegation amount is stored in the userBoosts mapping but is not added to the pool's totalBoost and workingSupply.
When the delegation is removed using the removeBoostDelegation function, the delegation amount is subtracted from the pool's totalBoost and workingSupply.
This inconsistency means that the pool's boost totals will be understated while the delegation is active and corrected only when the delegation is removed.
Incorrect State Tracking: The pool's totalBoost and workingSupply will not reflect the actual boost allocations, leading to incorrect calculations and behavior.
System Instability: Incorrect boost totals could disrupt the governance process and lead to instability in the system.
User Frustration: Users may experience unexpected behavior due to incorrect boost calculations.
A user delegates 100 boost to a pool using the delegateBoost function.
The delegation is stored in the userBoosts mapping, but the pool's totalBoost and workingSupply are not updated.
The pool's totalBoost and workingSupply remain unchanged, even though the delegation is active.
When the delegation is removed using the removeBoostDelegation function, the delegation amount is subtracted from the pool's totalBoost and workingSupply.
The pool's totalBoost and workingSupply are now incorrectly reduced, even though they were never increased in the first place.
Manual Review
To fix this issue, the delegateBoost function should add the delegation amount to the pool's totalBoost and workingSupply when the delegation is created. Here is the updated delegateBoost function:
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.