In SDLPoolSecondary.sol contract there is a internal storage variable named updateNeeded
, the way it was used is equal to not used.
The updateNeeded
internal variable is sets to 1 from 0 when new lock is queued i.e when _queueNewLock()
is called. Again in _queueLockUpdate()
it is checked that if it's value is 0, if yes then assign it to 1. But it has already assigned to 1 during creating new lock. But this operation should have done when a user wants to update a lock position. Additionally while calling handleOutgoingUpdate()
this variable's value was not checked whether it is set to 1 or not, although it is set to 0 while calling the handleOutgoingUpdate()
.
For audit purpose I made the updateNeeded
variable public from internal.
Run this test:
The output is:
Cost unnessary gas & if it used for any operation is future then it will create huge issue.
Manual analysis
To utilize the variable correctly only set it to 1 while queuing an update for a lock in _queuedLockUpdate().
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.