The initiateSwap
function in the StabilityBranch
contract does not increment the totalSwapRequests
counter after successfully processing a swap request. This omission leads will to incorrect tracking of swap requests, which can cause accounting discrepancies and misalignment between the system's state and the actual number of swap requests.
/StabilityBranch.sol/initiateSwap
The bug manifests in the StabilityBranch
contract, specifically in the initiateSwap
function. The function processes swap requests but fails to update the totalSwapRequests
counter, which is critical for maintaining an accurate record of swap activity.
Look at this scenario when:
A user calls initiateSwap
with valid parameters:
vaultIds = [1]
amountsIn = [100]
minAmountsOut = [50]
The function performs length checks and validates the inputs.
The swap request is processed successfully, but totalSwapRequests
is not incremented.
Swap requests are not properly tracked, leading to potential undercounting.
This could affect fee distribution, settlement, and other processes that rely on accurate swap request tracking.
System keepers and users may lose trust in the protocol's ability to manage swap requests correctly.
vs
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.