Skip to main content

A Python package to fetch smart contract ABIs from all EVM compatible blockchains

Project description

This is a python module aiming to allow the user to quickly fetch any ABI from a verified smartcontract on any EVM compatible blockchain.

This is a beta version, improvements might be added over time. if you notice anything not working appropriately or have any suggestions, feel free to report them.

commands:
abi-fetcher help or h => display this message
abi-fetcher list => display all available networks
abi-fetcher fetch --contract xxx --network xxx --api-key xxx --output xxx

--contract = the contract address on the blockchain
--network = network name as displayed in the list (use quotation marks)
--api-key = your personnal etherscan api key. If you don't have one, just go there : https://etherscan.io/ and sign up to get one.
--output(optional) = output directory for the generated ABI. Default directory is /ABI from the root

example : abi-fetcher fetch --contract 0xXXXXXX --network "base mainnet" --api-key XXXXXXXXXXXX

If you are unsure about the network name you can browse the abi_fetcher/chainlist.json file to search via chain ID. If the network isn't listed, you can either add a network entry into the json abi_fetcher/chainlist.json or try inputing the beginning of the explorer API Url like this :

https://api.etherscan.io/v2/api ?chainid=1 &module=contract &action=getabi &address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413 &apikey=YourApiKeyToken

replace the part between * * with your own url.

The abi json should be in the ABI folder. If anything went wrong, you will find the recorded error message in the created json file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abi_fetcher-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abi_fetcher-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file abi_fetcher-0.1.1.tar.gz.

File metadata

  • Download URL: abi_fetcher-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for abi_fetcher-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5bac0ebc0877d25a02a0fc63f02e09213e645a4eb2db0bf8bbded3db3f360427
MD5 8d21fdfe31ac1c4c939c620af93f7597
BLAKE2b-256 1a6b477aa808bb968cfa70a1ceba002c1f612a730017174cfd97360a3cd6aded

See more details on using hashes here.

File details

Details for the file abi_fetcher-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: abi_fetcher-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for abi_fetcher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9041bd192ecf7e8562bc604b6255d82ab3c5558be2ff5c6ff91309f18727b828
MD5 fa6340a9cadba2068e9b2defd96e0fba
BLAKE2b-256 dc99361b9c058d096027006f738fd4437ca4fefad2748c038f4ce45676f0c50c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page