During the StabilityBranch::initiateSwap
if the amountIn
is lesser than the baseFee
user wont be able to get a refund in the refunSwap
function because the transaction will revert when calculating the refundAmountUsd
Thou, the baseFeeUsd is a uint256 and the amountIn
is a uint128, so the baseFeeUsd
will underflow if the amountIn
is lesser than it.
https://github.com/Cyfrin/2025-01-zaros-part-2/blob/35deb3e92b2a32cd304bf61d27e6071ef36e446d/src/market-making/branches/StabilityBranch.sol#L474
Inside the initiateSwap
function there should be a check that the amountIn
is greater than the baseFee
and if it is not should revert the transaction.
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.