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

Adds ERC1132 interface and sample implementation #1298

Closed
wants to merge 8 commits into from

Conversation

maxsam4
Copy link

@maxsam4 maxsam4 commented Sep 7, 2018

🚀 Description

Adds sample implementation of ERC1132

Read more about EIP1132 on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1132.md

  • 📘 I've reviewed the OpenZeppelin Contributor Guidelines
  • ✅ I've added tests where applicable to test my new functionality.
  • 📖 I've made sure that my contracts are well-documented.
  • 🎨 I've run the JS/Solidity linters and fixed any issues (npm run lint:all:fix).

@nventuro nventuro added feature New contracts, functions, or helpers. contracts Smart contract code. labels Sep 7, 2018
@nventuro
Copy link
Contributor

nventuro commented Sep 7, 2018

Hey @maxsam4, thanks for contributing to OpenZeppelin!

This looks heavily inspired by https://github.com/nitika-goel/lockable-token (in which you're a main contributor), which sadly has no license. @ElOpio is our licensing expert, but from my understanding it would not be ok for us to simply have a copy the code in a case such as this.

Anyhow, have you checked our TokenTimelock contract? We're also doing some experimentation with escrows in the escrow-exploration branch. If those do not fit your needs, could you expand a bit as to why?

Thanks again!

@maxsam4
Copy link
Author

maxsam4 commented Sep 7, 2018

Hi @nventuro, Thanks for your feedback!

This is in fact inspired by @nitika-goel's Implementation. I never noticed that the original implementation is missing the license. I'll get in touch with @nitika-goel to sort it out.

The TokenTimeLock is a very basic implementation of time locking which makes it hard to be used in the applications that depend on the locked tokens (for example, reward distribution based on locked/staked amount).

There are various reasons why we didn't opt to use an escrow for locking and they are explained on ethereum/EIPs#1132 Please, have a look.

If I remember correctly, the TokenEscrow contract didn't exist in openzepplin's suite of contracts when the EIP for lockable token was created. In any case, It still does not achieve the goals of an inherently lockable token that are mentioned in the EIP.

I understand that increasing adoption for a new token standard will be tough so I have also implemented an independent Escrow like functionality which does not depend on an Owner and overcomes a few other drawbacks of escrows. It's still a WIP but you can get the idea from https://github.com/somish/govblocks-protocol/blob/master/contracts/TokenProxy.sol

@nitika-goel
Copy link

nitika-goel commented Sep 8, 2018

I've added a license to the original repo.
Thanks @nventuro and @maxsam4 for your feedback. The prime purpose of the ERC is to keep a record of the tokens locked under the same contract. This gives us the following advantages:

  1. No additional trust on escrow contract / stake manager
  2. No approval process for token transfer
  3. Better user experience as the user needs to claim the amount back from a single contract
  4. Ability for the user to track their true token balance / token activity
  5. Ability for the user to utilize their locked tokens within the token ecosystem. For example, locked tokens can be used for governance.

We are using this in 2 projects - GovBlocks and Nexus Mutual.

@mswezey23
Copy link
Contributor

From ValidityLabs - we are seeing clients request such features that this, ERC1132, would be of great value

@nventuro
Copy link
Contributor

Closing due to staleness - the EIP also doesn't seem to have moved forward much.

@nventuro nventuro closed this Feb 28, 2019
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 this pull request may close these issues.

4 participants