The audited smart contract protocol contains two Solidity functions with unbounded loops, where an array is iterated. The potential risk arises from the excessive gas consumption during the loop execution, which may lead to surpassing the gas limit per block and causing function failures. The identified functions are deletePendingStake
and consolidatePendingStakes
.
The audited smart contract protocol contains two functions with potential vulnerabilities due to unbounded loops iterating over arrays. The first function, deletePendingStake
, iterates over the pendingStakes
array without a predefined upper limit, which may lead to excessive gas consumption, especially for larger array sizes. The second function, consolidatePendingStakes
., also utilizes an unbounded loop over the same array, potentially causing high gas usage. Both functions pose a risk of surpassing the gas limit per block, resulting in transaction failures and disruptions to the intended functionality of the smart contract protocol.
The identified unbounded loops may result in excessive gas consumption, potentially surpassing the gas limit per block. This could lead to transaction failures and disrupt the intended functionality of the smart contract protocol.
Manual Review
Limit Loop Iterations: Implement a mechanism to limit the number of iterations in loops, preventing excessive gas consumption. This ensures that the loops will complete within reasonable gas limits.
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.