ethereumblockchainsoliditysmartcontractserc20

How to appoint the address in the approval process for future transferFrom in ERC20 smart contract


When I use approve and transferFrom, I notice the owner can give authority to spender. However, the owner CAN'T appoint an address for this approval that the token will be transfer to.

That means if the spender got the approval, it can transfer owner's token to any address it wants to, as far as I know.

Since approve and transferFrom are two separate processes, how to control the spender's behavior? Is there any idea or code to restrict the token receiver of an approval?


Solution

  • To have a custom approval, you can use a custom smart contract