You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For ZetaChain to EVM transfers this is not that important, because the contract charges only the required amount and refunds unused tokens back before executing transferCrossChain.
But for EVM to EVM transfers this is important, because a sender may supply more tokens than required. In a successful transfer the tokens are refunded on the destination chain, but in case of revert the excess tokens (RevertContext.amount) are lost.
The text was updated successfully, but these errors were encountered:
The question is, should the tokens be swapped to ZETA or refunded as ZRC-20? In case of a revert, the sender might want to transfer the token to a different chain, and for that they'd need ZETA.
When a transfer (EVM to EVM or ZetaChain to EVM) fails, the unused tokens must be returned to the sender on ZetaChain inside
onRevert
:standard-contracts/contracts/nft/contracts/zetachain/UniversalNFT.sol
Lines 228 to 237 in 1a36032
For ZetaChain to EVM transfers this is not that important, because the contract charges only the required amount and refunds unused tokens back before executing
transferCrossChain
.But for EVM to EVM transfers this is important, because a sender may supply more tokens than required. In a successful transfer the tokens are refunded on the destination chain, but in case of revert the excess tokens (
RevertContext.amount
) are lost.The text was updated successfully, but these errors were encountered: