The method TSwapPool::_swap
makes an addional transfer if certain condition is met which can be exploited.
On each 10th transfer (defined in TSwapPool::SWAP_COUNT_MAX
) it sends 1 ether of the output token to the sender.
Sending addional weth / pool token by swapping can lead to hackers exploiting this and draining contracts of it's funds.
Manual Review
Add the following test case to TSwapPool.t.sol
:
Run the following command forge test --mt testSwapingDepositMakesUnexpectedTransfer -vvvvv
Analyze the output and notice the unexpected transfer of 1 eth:
Remove the logic which makes such transfer:
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.