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

Deduplicate ERC20 Token #28

Open
schemar opened this issue May 7, 2019 · 2 comments
Open

Deduplicate ERC20 Token #28

schemar opened this issue May 7, 2019 · 2 comments

Comments

@schemar
Copy link
Contributor

schemar commented May 7, 2019

Follow-up to OpenST/mosaic-contracts#728

For testing, all repositories should use ERC20 Token from openzeppelin's npm package instead of re-creating it themselves.

Some repositories require an ERC20 interface in order to call contracts from within tests and other things. For those cases, use a dependency on openzeppelin.

https://github.com/OpenZeppelin/openzeppelin-solidity/tree/master/contracts/token

@benjaminbollen
Copy link
Contributor

is there an OpenZeppeling or by others implementation that we can use to deduplicate ?

schemar added a commit to schemar/mosaic-contracts that referenced this issue May 7, 2019
Code deduplication by getting dependencies from npm and git submodules.

* `UtilityToken` contracts are now imported as a git submodule.
* `Organization` contracst are now imported as a git submodule inside
  the `UtilityToken` submodule.
* `SafeMath` is now imported as open zeppelin npm package.

Note that inside the utility token repository, `token` has not been
renamed to `value token`, and therefore some tests needed to be updated.
Also, some tests required updating as `SafeMath` does not give an error
message anymore.

`Organiation` contracts cannot be imported as a separate git submodule
dependency, as then the solidity compiler will complain that there are
multiple definitions of the same symbol (e.g. `contract Organization`).

For now it is fine to import organization from inside utility tokens,
but that will lead to an error latest when there is a diamond
dependency:

```
      Organization
       /        \
UtilitToken   SomethingElse
       \        /
      NewRepository
```

In this case, it couldn't be avoided that `Organization` was defined
multiple times.

To fix this, I created follow-up ticket:
OpenST/developer-guidelines#27

Deduplicating EIP20Token is out-of-scope, as it requires changing
UtilityToken contracts (which has an EIP20Token) and all consumers of
UtilityToken, which currently may or may not rely on the EIP20Token from
there.
Simply adding the npm package does not work, as there will be an error
about multiple definitions of the same Symbol (`contract EIP20Token`).

To fix this, I created a follow-up ticket:
OpenST/developer-guidelines#28

Fixes OpenST#712
schemar added a commit to schemar/mosaic-contracts that referenced this issue May 7, 2019
Code deduplication by getting dependencies from npm and git submodules.

* `UtilityToken` contracts are now imported as a git submodule.
* `Organization` contracst are now imported as a git submodule inside
  the `UtilityToken` submodule.
* `SafeMath` is now imported as open zeppelin npm package.

Note that inside the utility token repository, `token` has not been
renamed to `value token`, and therefore some tests needed to be updated.
Also, some tests required updating as `SafeMath` does not give an error
message anymore.

`Organiation` contracts cannot be imported as a separate git submodule
dependency, as then the solidity compiler will complain that there are
multiple definitions of the same symbol (e.g. `contract Organization`).

For now it is fine to import organization from inside utility tokens,
but that will lead to an error latest when there is a diamond
dependency:

```
       Organization
        /        \
UtilityToken   SomethingElse
        \        /
       NewRepository
```

In this case, it couldn't be avoided that `Organization` was defined
multiple times.

To fix this, I created follow-up ticket:
OpenST/developer-guidelines#27

Deduplicating EIP20Token is out-of-scope, as it requires changing
UtilityToken contracts (which has an EIP20Token) and all consumers of
UtilityToken, which currently may or may not rely on the EIP20Token from
there.
Simply adding the npm package does not work, as there will be an error
about multiple definitions of the same Symbol (`contract EIP20Token`).

To fix this, I created a follow-up ticket:
OpenST/developer-guidelines#28

Fixes OpenST#712
schemar added a commit to schemar/mosaic-contracts that referenced this issue May 7, 2019
Code deduplication by getting dependencies from npm and git submodules.

* `UtilityToken` contracts are now imported as a git submodule.
* `Organization` contracst are now imported as a git submodule inside
  the `UtilityToken` submodule.
* `SafeMath` is now imported as open zeppelin npm package.

Note that inside the utility token repository, `token` has not been
renamed to `value token`, and therefore some tests needed to be updated.
Also, some tests required updating as `SafeMath` does not give an error
message anymore.

`Organiation` contracts cannot be imported as a separate git submodule
dependency, as then the solidity compiler will complain that there are
multiple definitions of the same symbol (e.g. `contract Organization`).

For now it is fine to import organization from inside utility tokens,
but that will lead to an error latest when there is a diamond
dependency:

```
       Organization
        /        \
UtilityToken   SomethingElse
        \        /
       NewRepository
```

In this case, it couldn't be avoided that `Organization` was defined
multiple times.

To fix this, I created follow-up ticket:
OpenST/developer-guidelines#27

Deduplicating EIP20Token is out-of-scope, as it requires changing
UtilityToken contracts (which has an EIP20Token) and all consumers of
UtilityToken, which currently may or may not rely on the EIP20Token from
there.
Simply adding the npm package does not work, as there will be an error
about multiple definitions of the same Symbol (`contract EIP20Token`).

To fix this, I created a follow-up ticket:
OpenST/developer-guidelines#28

Fixes OpenST#712
@schemar
Copy link
Contributor Author

schemar commented May 7, 2019

@schemar schemar changed the title Deduplicate EIP20Token Deduplicate ERC20 Token May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants