sherlock-audit / 2023-04-splits-judging

4 stars 1 forks source link

0x00ffDa - RETRACTED - flash() should not be payable #99

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

0x00ffDa

medium

RETRACTED - flash() should not be payable

Summary

SwapperImpl.flash() is payable but any ETH sent in is not accounted for in the function logic.

Vulnerability Detail

Although payable, the flash() function does not account for received ETH in the calculations of the flash trade. All ETH payment for flash() transaction must go through payback() to be credited.

Impact

Results in loss of trader ETH. If tokenToBeneficiary is ETH, it gets swept as excess to the beneficiary. Otherwise, it stays in the Swapper.

Code Snippet

Tool used

Manual Review

Recommendation

flash() should not be payable.