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

Add "source" to "ContractType" object #85

Open
fubuloubu opened this issue Apr 25, 2018 · 5 comments
Open

Add "source" to "ContractType" object #85

fubuloubu opened this issue Apr 25, 2018 · 5 comments

Comments

@fubuloubu
Copy link
Contributor

fubuloubu commented Apr 25, 2018

I believe "source":"./contracts/AbstractToken.sol" should be a mandatory sub-key of a "ContractType" object underneath the "contract_types" object. This way I can do a 1-to-1 match of the contract to the file that created it (and also find it's source on IPFS through the "sources" key).

I personally like that "contract_types" does NOT use the full file name e.g. "/path/to/Contract.sol:Contract". The contract's name in the package namespace should not be allowed to be duplicated (solidity does this), and this enforces that by default.

@pipermerriam
Copy link
Member

👎

Requiring source adds bloat to packages which are intended for use cases where package verification is not a requirement. Specific use case for this would be a private chain which uses a private package registry with packages that are all explicitly trusted. In this case an organization should not be required to include the package source in their packages.

Another use case for the public chain is the cryptokitties contract which does gene splicing. The source code for that contract is intentionally left unpublished so that the exact algorithm for gene splicing is kept private.

@fubuloubu
Copy link
Contributor Author

That is a great point. 💯 agree

Optional then? I would have a problem in the current examples linking the contract to the source without doing the compilation myself or analyzing each source.

@pipermerriam
Copy link
Member

pipermerriam commented Apr 25, 2018

I'd support adding an optional souce_path to the contract_type. It'd serve as a helpful hint and should be easy to validate when recompiling.

@loredanacirstea
Copy link

+1 on adding source_path to the contract_type.
E.g. I want to only get the swarm/ipfs source file that I need and not the entire package in case I want to see/test a specific contract.

@pipermerriam
Copy link
Member

I'd like to point out that without analyzing the source file, it's non-trivial to know if you've got everything you need since a "Contract" can span multiple files (depending on the language you are working with).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants