telosnetwork / telos-bridge

The Telos LayerZero bridge enables seamless asset transfers between Telos and other blockchains
https://bridge.telos.net
5 stars 3 forks source link

#101 | Fix bridge token allowance process #103

Closed Viterbo closed 2 months ago

Viterbo commented 2 months ago

Fixes #101

Description

This PR includes a fix for the problem of not getting the gas estimation right for the approvals before the actual transaction.

These changes did not require the library to be modified.

Test scenarios

You gotta have at least 5 USTD in the Ethereum chain and some ETH to pay the fees.

Cases are: 1 - you have More approval than you are willing to transfer. Best case: you don't need to approve anything. 2 - you cave 0 approval. Normal case: This will cause you to only approve the Transaction without resetting anything. 3 - you have some but not enough approval. Rarest case: This will trigger the reset and then the exact approval you need.

Screenshots

telos-bridge--resetting-approvals.webm