-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use git-submodules to include UtilityToken and Organized contracts #712
Comments
@deepesh-kn: in addition to git-submodules, another option might be truffle's existing support for NPM packages (I have not yet tried it, so this is a suggestion and not a recommendation 😅). Have you considered that option? ✏️ N.B.: I will also post this question on the epic. |
Now discussed here: OpenST/developer-guidelines#20 (comment) |
EIP20token should not be in utility token. if we want to deduplicate it then we can use openZeppeling eg. but for now EIP20token is not part of this scope. It should only ever be part of test contracts |
Blocked by the discussion git submodules vs npm. |
conclusion from discussion; internal dependencies like organization-contracts and utilitytoken-contracts should be included through git-submodule; external dependencies like SafeMath (possibly an EIP20Token for testing purposes) should be included through NPM packages |
See also OpenST/openst-contracts#197 |
There are conflicts due to multiple declarations of the same contracts. For example, organization contracts are part of utility tokens; safe math from utility tokens is already declared in npm dependency ... Using NPM would have automatically deduplicated the dependencies. |
I think step one to resolving this is adding safemath as an npm dependency to utilitytoken contracts. |
Step two will be using the organization contracts from within utility token contracts. "inception" |
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. |
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
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
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
Use git-submodules to include the following contracts
Following is the proposal:
OpenST/utilitytoken-contracts
.git-submodules
to include Organized contract in the project fromOpenST/organization-contracts
.The text was updated successfully, but these errors were encountered: