OpenST / mosaic-contracts

Mosaic-0: Gateways and anchors on top of Ethereum to scale DApps
https://discuss.openst.org/c/mosaic
MIT License
114 stars 31 forks source link

Use npm and git submodules #728

Closed schemar closed 5 years ago

schemar commented 5 years ago

Code deduplication by getting dependencies from npm and git submodules.

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: https://github.com/OpenST/developer-guidelines/issues/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: https://github.com/OpenST/developer-guidelines/issues/28

Fixes #712

schemar commented 5 years ago

I used 2.1.1, because that is what was used in the other repositories. For now, I would rather use the same version across all repositories. Unfortunately, 2.1.1 does not provide any error messages.

2.2 also has no messages and 2.3 is still a pre-release...

schemar commented 5 years ago

@deepesh-kn what do you think?

deepesh-kn commented 5 years ago

@deepesh-kn what do you think?

The same version across all repositories sounds good to me 👍