Solidity - ERC777 tokensReceived() [MSG.SENDER cannot be checked]
Channel:
Subscribers:
1,210
Published on ● Video Link: https://www.youtube.com/watch?v=TFV528COja8
ERC20 tokens do not have receive() or fallback() functions for detecting token transfers.
However, ERC777 tokens are able to detect token transfers using tokensReceived().
Note: MSG.SENDER cannot be verified with ERC777 tokens and that the ERC777 standard is gas intensive: https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2620.
Github: https://github.com/MarcusWentz/AutoTeamContestPayout/blob/main/contracts/ERC777AutoTransfer.sol
Make sure you are on a public testnet while doing this otherwise the contract deployments will revert. Another good ERC777 tutorial I found: https://www.youtube.com/watch?v=S9nzL_l6D_E
Other Videos By Singularity 2045
Tags:
Solidity
Programming
Automation
Tokens
ERC20
ERC777
Transfer
Receive
Fallback
Automate