-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC777 fails to deploy #4126
Comments
Hello @chriscrutt Has you figured out yourself, ERC777 requires the ERC1820 registry to be deployed at Unfortunatelly, that is not the case of local testnets such as ganache or remix. If you use hardhat,
This is one of the difficulties associated with ERC-777 that lead us to deprecate it. |
That's a bummer- I really liked the built-in functionality to have my smart contract do something when receiving tokens- or forcing a smart contract to react to receiving my tokens haha. Is that why Truffle is failing as well? And that its error statement is just a little too vague. edit: I looked into #2620 and I suppose I will NOT be missing ERC777 haha. |
what would you recommend instead of ERC777 to get the same effect? |
I would recommand a combination or ERC20 and ERC1363. |
Yeah I just saw that OZ was thinking of adding 1363- I know they have the interface for it. Already started to implement. I have trouble figuring out why 777 is so bad compared to 1363 though |
ERC-777 relies on ERC-1820 a lot, that makes it is a painfull point. I was saying ERC-20+1363 because I assumed you needed "callbacks". If you don't, then 20 alone is good. |
So if I have a staking contract and want something to happen whenever someone transfers the ERC1363 to my smart contract, it'd be super easy with I would just override Or is there a better way to go about it? |
When using ERC20 there is indeed the risk of someone doing a direct transfer when they should not. That is an intrisic issue with ERC20, but still you should not change the transfer behavior (you risk breaking composability with apps like uniswap). There is an ongoing issue with ERC1363 reverting (or not) when doing transferAndCall to an EOA. This issue is the reason why we don't yet have an official ERC1363 implementation in the repo. |
edit: added a lot more information
When I write the simplest of ERC777 contracts, it fails on deployment for:
Code taken from here
For #1, I compiled on Remix and tried to deploy via Remix VM (Merge)
Tried Solidity versions 0.8.13 - 0.8.19
Tried with 0 optimization and at 1,000,000
Error:
My input:
It seems it reverts on line 72 on the ERC777.sol file
For #2, I did all of the same things but I got
For #3, I created a migration file that consisted of
but when I ran
truffle migrate
I gotI am running Truffle v5.8.1 (core: 5.8.1) and Node v18.8.0 and on MacOS Monterey.
Does anyone know what is going on? Or how to fix any of these?
The text was updated successfully, but these errors were encountered: