π«Missing Checks
Missing fromToken != toToken check
Vulnerability Details
solidityCopy codefunction _swapExactT4T() {
Fund(fund()).withdraw(tokens[0], pairs[0], amounts[0]); // Withdrawal occurs here
_swap(amounts, pairs, tokens, fund());
}solidityCopy codefunction _swap() {
uint256 startingBalance = IERC20(outToken).balanceOf(_to);
uint256 endingBalance = IERC20(outToken).balanceOf(_to);
require(
endingBalance >= startingBalance + amounts[amounts.length - 1],
"Defective AMM route; balances don't match" // Check passes as startingBalance == endingBalance + 0
);
}Last updated