subway icon indicating copy to clipboard operation
subway copied to clipboard

frontrun tx always reverts with ERC20: transfer amount exceeds balance

Open sewinter opened this issue 2 years ago • 1 comments

It seems that the contract always tries to send some amount of the non-weth token to the pair despite the contract having a balance of 0. What am I doing wrong?

sewinter avatar Aug 24 '22 01:08 sewinter

Do you still have this issue? Can share more details?

brendanwenzel avatar Oct 31 '22 16:10 brendanwenzel

Acc to this contract, the contract first takes the token, and then changes it to weth in frontrun, and in backrun it converts weth to token. So better way is to replace the token -> weth in frontSliceTxPayload and weth->token in backsliceTxPayload . Or you can do is to fund your sandwich contract with the token you want to swap with

kr-manav avatar Jul 11 '23 20:07 kr-manav