Could you please enlighten me on how approve and allowance functions work using a usecase? I dont understand the underlying operations of these functions. Especially, when a token owner delegates the right to spend his token by other user: how the ownership sign-off works, is this be done automatically?
The original use case from back 2016 is that back in a day, smart contracts had no way to interact to incoming token transfer. (This has been now fixed with ERC-777 token standard and
For you to interact with a smart contract with an ERC-20 token
You need to
approve()amount of tokens on a smart contract address
You call a smart function that then in a turn calls
token.transferFrom()function to take over the tokens from you and do something with them
allowance() is simply a function to check what's the current