Description:
The unstakeAll
function iterates over all active deposits to unstake them, which could lead to gas limit issues if the user has a large number of active deposits. This could cause the transaction to fail due to running out of gas.
Location:
src/FjordStaking.sol
unstakeAll
function (Line 570)
Issue:
If a user has a large number of active deposits, the unstakeAll
function could potentially run out of gas during execution, causing the transaction to revert. This could prevent users from unstaking their tokens, leading to frustration and potential financial losses.
Impact:
The inability to unstake tokens due to gas limit issues could lead to a denial of service for users, especially those with a large number of active deposits.
Tools used: Manual Review.
Recommendations:
Consider implementing a batching mechanism to allow users to unstake their deposits in smaller, more manageable chunks, reducing the risk of gas limit issues.
Potential changes:
Implement batching for the unstakeAll
function to prevent gas limit issues.
Changes needed for which line of code:
Implement Batching -
(Example)
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.