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

New Command: Fetch interface declaration from etherscan.io #19

Merged
merged 6 commits into from
Aug 5, 2022

Conversation

tintinweb
Copy link
Owner

@tintinweb tintinweb commented Aug 5, 2022

Implement a new command .fetch interface that auto-generates and loads interface declarations from etherscan.io.

  • command: .fetch interface <address> <interfaceName> [optional: chain=mainnet]
  • Tries to fetch the contract ABI from etherscan.io; may fail if not available or etherscan rate limits us
  • generates solidity interface declaration from ABI via abi-to-sol
  • prints and makes the downloaded interface available in the REPL

e.g. when using ganache in fork mode this allows you to easily interact with the contract.

shell-fetch-interface

Example:

.fetch interface 0x40cfEe8D71D67108Db46F772B7e2CD55813Bf2FB Test
Test t = Test(0x40cfEe8D71D67108Db46F772B7e2CD55813Bf2FB)
t.symbol()

@tintinweb tintinweb merged commit 5d8c4f4 into master Aug 5, 2022
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

Successfully merging this pull request may close these issues.

None yet

1 participant