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 support for ethPM #175

Closed
7 of 12 tasks
iamdefinitelyahuman opened this issue Sep 3, 2019 · 3 comments · Fixed by #257
Closed
7 of 12 tasks

Add support for ethPM #175

iamdefinitelyahuman opened this issue Sep 3, 2019 · 3 comments · Fixed by #257
Assignees
Labels
enhancement New feature or request

Comments

@iamdefinitelyahuman
Copy link
Member

iamdefinitelyahuman commented Sep 3, 2019

...because it's awesome.

Proposed Functionality

Deployment Interaction:

  • query a registry for an ABI and contract address, and returns a Contract object
  • query a registry and generate a Project from the entire manifest, including Contract objects for deployed contracts

Registry Interaction:

  • list all known registries
  • list all packages in a registry
  • search a registry for a package / version
  • list locally available packages

Project integration:

  • add packages to a project via brownie ethpm install [uri]
    • store package source code inside a project's contracts/ directory
    • track installed packages in build/packages.json, warn the user loudly when source in an installed package has been modified
  • generate and publish a package from a project
  • allow references to installed package by name/alias

Bonus points:

  • re-introduce deployment persistence (Persist #246)
  • create a Brownie registry: pm.eth-brownie.eth
  • create a test registry on Roptsen

Useful Links

@iamdefinitelyahuman iamdefinitelyahuman added the enhancement New feature or request label Sep 3, 2019
@iamdefinitelyahuman iamdefinitelyahuman pinned this issue Sep 4, 2019
@iamdefinitelyahuman iamdefinitelyahuman added this to the 1.0.0 milestone Sep 4, 2019
@iamdefinitelyahuman
Copy link
Member Author

@iamdefinitelyahuman iamdefinitelyahuman self-assigned this Sep 24, 2019
@iamdefinitelyahuman
Copy link
Member Author

iamdefinitelyahuman commented Oct 1, 2019

per devcon conversation, the current proposed uri format:

erc1319://[CONTRACT_ADDRESS]:[CHAIN_ID]/[PACKAGE_NAME]@[VERSION]/[PATH]

@iamdefinitelyahuman iamdefinitelyahuman removed this from the 1.0.0 milestone Oct 2, 2019
@iamdefinitelyahuman
Copy link
Member Author

iamdefinitelyahuman commented Nov 8, 2019

  • allow import commands in source code that reference packages: (uri docs) import "erc1319://[CONTRACT_ADDRESS]:[CHAIN_ID]/[PACKAGE_NAME]@[VERSION]/[PATH]"
    • for inheritance / libraries (sources/[PATH])
    • for contract -> contract interaction (contract_types/[CONTRACT_NAME]/abi, requires abi2solc)

The more I think about this, it's not the best approach:

  • It requires path remapping when compiling, which limits the use of the contract outside Brownie
  • It will be very confusing to some users
  • When generating a package from a project, import statements will have to be modified or remappings included in compiler settings for each contract - again, creating barriers with other tooling

My new, simpler idea:

  • Add packages to a project via brownie ethpm install [uri]
  • Store package source code inside a project's contracts/ directory
  • Track installed packages in build/packages.json and warn the user loudly when source in an installed package has been modified

I think this will be more understandable to users, and it will be much simpler to generate packages from projects that use dependencies.

UPDATE: old approach removed in 36f0ec5

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

Successfully merging a pull request may close this issue.

1 participant