First Flight #18: T-Swap

First Flight #18
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

`swapExactInput` doesn't return expected `output` value

Summary

swapExactInput is expected to return correct calculated output value, instead it just returns the 0 value without it being assigned anywhere in the function call hence causing callers to believe output is 0.

Recommendations

Make below code changes in TSwap.sol

function swapExactInput(
...
)
...
returns (
- uint256 output
+ uint256 outputAmount
)
{
...
uint256 outputAmount = getOutputAmountBasedOnInput(inputAmount, inputReserves, outputReserves);
...
}
Updates

Appeal created

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Default value returned by TSwapPool::swapExactInput results in incorrect return value given

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.