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

VIP: Add support for loading interfaces via IPFS #2297

Open
Tracked by #2324
fubuloubu opened this issue Feb 2, 2021 · 2 comments
Open
Tracked by #2324

VIP: Add support for loading interfaces via IPFS #2297

fubuloubu opened this issue Feb 2, 2021 · 2 comments
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting

Comments

@fubuloubu
Copy link
Member

fubuloubu commented Feb 2, 2021

Simple Summary

Allow loading interfaces (either JSON ABI or EthPM v3 contract types) from IPFS

Motivation

Vyper has limited support for importing custom interfaces from external files, which is a helpful method of code de-duplication. However, this feature is hard to use, especially with code verification utilities such as Etherscan. Since IPFS is a widely-supported data sharing protocol in the Web3 ecosystem, we can leverage this fact to make development and verification much easier with external interfaces, leveraging hash-based identifiers to lock the imported code version and make compilation more dependable.

Specification

# JSON ABI e.g. `{ "abi": [ ... ] }`
import ipfs.Qm....A21d  as MyInterface  # must rename from CID

# EthPM Package Manifest (v3)
from ipfs.Qm....b34C import ContractType # can rename `ContractType as MyInterface`

Errors

  • CID is not valid
  • file specified by the CID cannot be found, or it fails to load after 30 seconds
  • file loaded by the CID is not in one of the accepted formats (JSON ABI or EthPM v3 Package Manifest)
  • JSON ABI is used, and the import is not renamed from the CID
  • EthPM v3 Manifest is used, and ContractType is not one of the available contract types (containing a valid ABI)

Backwards Compatibility

This feature is backwards compatible

Dependencies

No dependencies

References

https://web3py.readthedocs.io/en/stable/ethpm.html

Copyright

Copyright and related rights waived via CC0

@fubuloubu fubuloubu added the VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting label Feb 2, 2021
@fubuloubu fubuloubu mentioned this issue Feb 22, 2021
4 tasks
@fubuloubu
Copy link
Member Author

Idea: instead of introducing the full IPFS client, have it just reference the cache folder from IPFS

@fubuloubu
Copy link
Member Author

Using https://github.com/ApeWorX/ethpm-types might be way nicer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting
Projects
None yet
Development

No branches or pull requests

1 participant