Skip to content
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

Provide implementation of ERC777 #1159

Closed
frangio opened this issue Aug 7, 2018 · 10 comments · Fixed by #1684
Closed

Provide implementation of ERC777 #1159

frangio opened this issue Aug 7, 2018 · 10 comments · Fixed by #1684
Assignees
Labels
contracts Smart contract code. feature New contracts, functions, or helpers.
Milestone

Comments

@frangio
Copy link
Contributor

frangio commented Aug 7, 2018

ERC777 is a proposal for a token standard with advanced features that seems to be well received and may gain some adoption.

We would like to provide an implementation of it. There is a reference implementation that is licensed under MPL so we would likely have to write our own.

@frangio frangio added feature New contracts, functions, or helpers. status:in-progress contracts Smart contract code. labels Aug 7, 2018
@albertchon
Copy link

I am working on this and will submit a pull request once @jacquesd grants permission to release a modified version of his implementation under the MIT license

utgarda added a commit to utgarda/openzeppelin-solidity that referenced this issue Oct 7, 2018
utgarda added a commit to utgarda/openzeppelin-solidity that referenced this issue Oct 7, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Oct 24, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Oct 24, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Oct 27, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Nov 3, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Nov 3, 2018
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Nov 3, 2018
This implementation conforms to the current EIP
@catageek
Copy link
Contributor

catageek commented Nov 3, 2018

I just pushed in my branch an implementation of ERC777 with all unit tests. This is not perfect and the unit tests need some refactorization to be in line with the code style of other tests. This is my first approach of javascript, so be nice with me.
Also the licence of the interface is MPL because it's an exact copy of the one written by @jacquesd, so until the licence of the interface change, making a PR is not possible.

Note that the constructor may call an external contract, which may be an issue because the calling contract is not finalized. Maybe a function initialize() should be added to do this external call.

Also I used web3js 1.0 in the tests to get rid of the collision of send() with truffle's own send(), so I can use the interface introspection functionality of web3js 1.0.

@cipherzzz
Copy link

@catageek - I tried to implement your branch but was not able to deploy the contract using truffle or my unit tests. I keep getting a revert. Could you pull this truffle project and try it out?

git clone https://github.com/cipherzzz/erc777 && cd erc777
truffle compile
truffle migrate
truffle test

@catageek
Copy link
Contributor

catageek commented Dec 6, 2018

@cipherzzz This contract needs that an ERC820 contract is previously deployed in the test chain. Try to execute truffle test before truffle migrate because there is a test script that deploys an ERC820 registry contract.
Disclaimer: I did not update the ERC820 bytecode to the final version of the EIP

@utgarda
Copy link

utgarda commented Dec 24, 2018

Guys, @catageek, I actually started implementing ERC777 from scratch, following the specs, in order to let it be published under MIT licence, instead of trying to re-licence the reference implementation. I believe, if @jacquesd wanted his code MIT-licenced, he'd do it from the start. For the sake of integrity I didn't even read the reference code thoroughly (maybe that's a mistake), and definitely never copied any of it. Anyway, that code requires a whole bunch of new unit tests to be compliant with OpenZeppelin's repo style.

How do you feel about cooperating on re-implementing the specs following the local guidelines?

@catageek
Copy link
Contributor

Hi @utgarda, my implementation is already from scratch without looking at the reference code, so, according to me, the issue with the license is not in the implementation, but with the interface. This file was copied from the reference implementation because it is the reference interface that we can not modify. It is in the EIP under Creative Commons license, and in the ref implementation under Mozilla Public license.
I am not an expert in licensing so I can't say if it's a real issue.

@frangio frangio added this to the v2.3 milestone Jan 18, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Jan 31, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Jan 31, 2019
@nventuro nventuro self-assigned this Mar 11, 2019
@nventuro
Copy link
Contributor

I'll be working on this to get it to a state in which it can be merged into the repository (as a draft, since the EIP isn't even finalized yet). @utgarda @catageek you both mentioned you've done some work on this, would you mind sharing your progress? Thanks!

@catageek
Copy link
Contributor

@nventuro my implementation is complete with all unit tests. I need to udpate ERC820 registry to use ERC1820. I also need to run linter to conform to OpenZeppelin PR rules, so that's why it's not a PR yet.
Would you mind if we don't multiply proposals ? I can finish this in a couple of days.

@nventuro
Copy link
Contributor

@catageek do open a PR! I already have one for ERC1820 (#1677) which should be merged soon, see if you can integrate that one in.

catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 15, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 15, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 17, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 17, 2019
@catageek
Copy link
Contributor

@nventuro Done! But it's coming with its own ERC1820 deploy script... Feel free to add your modification/suggestion. Any help to break the big test script into small files is appreciated also.

catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 21, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 21, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 21, 2019
catageek pushed a commit to catageek/openzeppelin-solidity that referenced this issue Mar 21, 2019
nventuro pushed a commit that referenced this issue Apr 16, 2019
* IERC777 from specs, constants returned, up to defaultOperators. (#1159)

* IERC777 oprarator approvals (#1159)

* ERC777 oprarator approvals fixes and tests

* IERC777 send and receive with ERC820 (#1159)

* ERC777 Add burn functions and fix send functions (#1159)

* ERC777 Make expectEvent compatible with web3.js 1.0 (#1159)

* ERC777 Add ERC820 deploy script (#1159)

* ERC777 Complete implementation of ERC777 (#1159)

This implementation conforms to the current EIP

* ERC777 Update ERC820 Registry contract to final version (#1159)

* ERC777 Move contracts to 'drafts' folder (#1159)

* ERC777: Update to ERC1820 registry and linter error fix (#1159)

* ERC777: implement recent changes of EIP777 (#1159)

* ERC777 Fix formatting (#1159)

* ERC777 Update to solc 0.5.2 (#1159)

* ERC777 Fix travis CI errors (#1159)

* ERC777 Fix linter errors again... (#1159)

* ERC777 Fix unit test (#1159)

* ERC777 Fix unit test again (#1159)

* Remove extra newlines.

* Rename ERC777Base to ERC777.

* Remove 'Token' from contract names.

* Replace ops for operators.

* Move operator check out of _send.

* Remove ERC777Burnable.

* Remove ERC1820Client, now using the interface directly.

* Minor internal refactors in contracts.

* Delete extra test helpers.

* Simplified tests.

* Add basic 777 tests.

* Add granularity send test.

* Add first operator send tests.

* Add burn tests.

* Refactor send and burn tests.

* Improve send burn refactor.

* Greatly improve test module.

* Burn instead of send removed tokens.

* Add operator tests.

* Improve send tests under changing operators.

* Refactor and merge send and burn tests.

* Add missing and not-implemented tests.

* Make _burn private.

* Fix typo.

* Greatly improve tokensToSend tests.

* Refactor hook tests.

* Fix hook tests.

* Update openzeppelin-test-helpers and ERC1820 address.

* Fix natspec indentation.

* Make interface functions external.

* Remove redundant private revoke and authorize functions.

* Improved readability of if statement.

* Remove unnecessary asserts.

* Add non-one granularity test.

* Fix hook call order in _mint.

* Fix _mint not reverting on failure to implement tokensReceived.

* Remove special case in operatorFn when from is 0.

* Refactor ERC777SenderMock.

* Add tokensReceived tests.

* switch to updated ganache-cli-coverage fork

* Fix linter errors.

* Add mint tests.

* Fix linter errors.

* Fix tests.

* Update test/drafts/ERC777/ERC777.test.js

Co-Authored-By: nventuro <nicolas.venturo@gmail.com>

* Add changelog entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Smart contract code. feature New contracts, functions, or helpers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants