icon-project / icon-bridge

The centralized bridge of ICON
Apache License 2.0
21 stars 15 forks source link

transfering token from BSC chain to ICON chain fails with error 'ERC20: insufficient allowance' #778

Closed FidelVe closed 1 year ago

FidelVe commented 1 year ago

Sending a transaction of token btp-0x2.icon-ICX from BSC testnet to ICON testnet is failing with Error message 'ERC20: insufficient allowance'.

here is the transaction: https://testnet.bscscan.com/tx/0xf6edf256c761f23116d681a29fe093efe75f1e2c1a88eb42b90947eb707a833b

Im seeing a similar token transfer that was successful: https://testnet.bscscan.com/tx/0xe8197d7cc4e1ee4de91208831ee156ecb0b1fb113115a308198fd9c891f0b350

I tested with a higher gas limit (the success tx gas limit was ~7M, I set a gas limit of 10M) and the value was in wei units, i also made sure that I have enough BNB to pay for the gas (0.93 BNB) and enough token (94 btp-0x2.icon-ICX).

screenshot of failed tx Screenshot from 2022-11-08 16-51-32

screenshot of example success tx Screenshot from 2022-11-08 16-51-46

FidelVe commented 1 year ago

found the problem.

first is necessary to make a transaction to the token contract on the approve method, this will approve the BTSCore contract to transfer the token on behalf of the originator wallet.