In TSwapPool::getInputAmountBasedOnOutput, although there are checks to ensure outputAmount and outputReserves are not zero. But there is no check to ensure outputAmount != outputReserves, the lack of this check could lead to zero division error and cause the function to revert and fail
The denominator of the return formula in function TSwapPool::getInputAmountBasedOnOutput specifies as ((outputReserves - outputAmount) * 997). If outputAmount == outputReserves, this will lead to zero division error causing the function to revert and fail
The function will revert and fail for zero division error when outputAmount is input as the same as outputReserves by user
Manual review
Add additional check for TSwapPool::getInputAmountBasedOnOutput as follows:
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.