I am trying to deploy ERC777 on a private chain and i’m trying to use the tokensReceived feature. I notice that in order to do this with _send I need to register with the ERC1820 contract, which doesn’t exist on my private chain yet. Is there any example I can use to deploy the ERC1820 contract to the exact address that is required?
I notice in the docs this is coming soon but I would like to use this now.
Thank you. I am interested in the tokensReceived feature as well. If I understand correctly I need to register my contracts that implement tokensReceived in the ERC1820 registry on my test chain. Is there any example for this?
I have updated my Simple ERC777 token example to include a recipient contract.
The recipient contract needs to implement the tokensReceived function from IERC777Recipient.sol.
The recipient contract also needs to register with the ERC1820 registry that it is an interface implementer of ERC777TokensRecipient _erc1820.setInterfaceImplementer(address(this), TOKENS_RECIPIENT_INTERFACE_HASH, address(this));