It seems that the as been a recent regain of interest issue for #677 (that is NOT an ERC has it doesn’t have the proper documentation) both on the EIP repo and on youtube, with ChicoCrypto making a video about it.
While I love the underlying idea, I have to emphasize that there are many ways to achieve the same results. I know at least 2:
- Chainlink’s (and Dai’s ?) transferAndCall:
transferAndCall(address receiver, uint amount, bytes data) transfers some tokens and calls the function
onTokenTransfer(address from, uint256 amount, bytes data) on the receiving side to notified the tranfered happened.
- iExec’s approveAndCall
approveAndCall(address _spender, uint256 _value, bytes _extraData) only approves the transfer, and call the function
receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) on the receiving side to notifity it can transferFrom
I personnaly prefer the second pattern, because despite it using a little bit more gas, it doesn’t break the approve-transferFrom workflow dapps are used to. Also receiver are less likelly to have bugs due to poor implementation of the onTokenTransfer function.
I’m sure people will have other views: lets discuss that, and eventually make up a standard for futur tokens (even though ERC20 are not that hyped anymore)