The initiateSwap
function in the StabilityBranch
contract fails to increment the totalPendingSwaps
counter after processing valid swap requests. This results in incorrect tracking of pending swaps.
/StabilityBranch.sol/initiateSwap
The initiateSwap
function does not update the totalPendingSwaps
counter after processing valid swap requests. This leads to incorrect tracking of pending swaps, causing the system to lose track of active swap requests. The impact is significant as it disrupts the swap request lifecycle, potentially leading to unfulfilled swaps or incorrect accounting of pending requestsHere is how it Happens.
A user calls initiateSwap
with valid parameters: vaultIds = [1]
, amountsIn = [100]
, minAmountsOut = [90]
.
The function processes the request but fails to increment the totalPendingSwaps
counter.
The system incorrectly assumes no swap request was created, violating the rule that each valid vault must create one swap request.
Pre-Call State:
totalPendingSwaps = 0
vaultIds = [1]
, amountsIn = [100]
, minAmountsOut = [90]
Post-Call State:
totalPendingSwaps = 0
(expected 1
)
Users may not receive their expected assets due to unfulfilled swap requests, leading to direct financial losses.
The system incorrectly reports the number of pending swaps, causing mismanagement of swap operations and potential exploitation
vs
Update the initiateSwap
function to increment the totalPendingSwaps
counter by the number of vault IDs provided
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.