Transferring the remainder to a user
After buying an NFT or paying a set amount, there may be tokens left over, since the amountOut from the swap can't be determined in advance.
It's possible to transfer the remainder of the tokens after the swap and the purchase to the user's address.
You'll need to use a different call type based on the type of token you are transferring
Transferring remainder if the token is an ERC20:
Transferring remainder if the token is native:
If you want to transfer the remaining native balance to a user, you should use FULL_NATIVE_BALANCE
Last updated