The increasePosition
function in the LiqudationPool
smart contract has a potential Denial of Service (DoS) vulnerability
In the increasePosition
function, there is a call to consolidatePendingStakes
, which iterates over the pendingStakes
array. The loop inside consolidatePendingStakes
may cause gas inefficiencies, especially if the array is large. As a result, the gas costs may increase significantly, making the increasePosition
function prone to failure
increasePosition()
function calls out to consolidatePendingStakes()
Now if you see this function then this function is ilterating over pendingStakes
array and doing some computation, and once this function is complete the increasePosition
function will call out to addUniqueHolder
function which again literates over holders
array and after checking an if
statement the function is adding the address into holders
array
As we can see that there are two For
loops in the code and both are iterating over an array so if 1 of the array is large enough the function will revert subsequently reverting the whole increasePosition
function.
The gas inefficiency in the increasePosition
function can lead to a DoS vulnerability, causing transaction failures and hindering the proper execution of the smart contract. The issue is particularly critical as it involves core functions related to stake consolidation and fee distribution.
Manual Review
Break down this function into multiple functions
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.