{"id":14958620,"url":"https://github.com/owodunni/ethscan","last_synced_at":"2026-01-21T17:33:39.530Z","repository":{"id":39652030,"uuid":"478683857","full_name":"owodunni/ethscan","owner":"owodunni","description":"A simple CLI for querying contract information from block-explorers","archived":false,"fork":false,"pushed_at":"2022-05-29T12:01:07.000Z","size":119,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T10:04:28.443Z","etag":null,"topics":["abi","cli","ethereum","etherscan","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owodunni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-06T18:36:35.000Z","updated_at":"2022-06-02T23:40:26.000Z","dependencies_parsed_at":"2022-09-14T03:00:18.929Z","dependency_job_id":null,"html_url":"https://github.com/owodunni/ethscan","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owodunni%2Fethscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owodunni%2Fethscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owodunni%2Fethscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owodunni%2Fethscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owodunni","download_url":"https://codeload.github.com/owodunni/ethscan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247684480,"owners_count":20979072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abi","cli","ethereum","etherscan","npm"],"created_at":"2024-09-24T13:17:35.831Z","updated_at":"2026-01-21T17:33:39.484Z","avatar_url":"https://github.com/owodunni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethscan\n[![CodeFactor](https://www.codefactor.io/repository/github/owodunni/ethscan/badge)](https://www.codefactor.io/repository/github/owodunni/ethscan)[![Build](https://github.com/owodunni/ethscan/actions/workflows/build.yml/badge.svg)](https://github.com/owodunni/ethscan/actions/workflows/build.yml)[![npm version](https://badge.fury.io/js/@owodunni%2Fethscan.svg)](https://badge.fury.io/js/@owodunni%2Fethscan)[![License](https://img.shields.io/github/license/owodunni/ethscan)](https://github.com/owodunni/ethscan/blob/main/LICENSE)[![codecov](https://codecov.io/gh/owodunni/ethscan/branch/main/graph/badge.svg?token=YIFCXZXJ7I)](https://codecov.io/gh/owodunni/ethscan)\n\nA simple CLI for querying contract information from block-explorers.\n\n## Install\n```\nnpm install -g @owodunni/ethscan\n```\n### Configure\nBy default Ethscan querries [Etherscans api](https://etherscan.io/apis), this\nis rate limited to 1Hz. To change Blockexplorer or use an API key the\nfollowing environment variables can be set:\n\n```bash\nETHSCAN_KEY='Your api key'\nETHSCAN_URL='https://rinkeby.etherscan.io/api'\n```\nThese can also be set by the cli. There are predefined block-explorers for **Polygon**, **Ethereum**, **Fantom**, **BSC**.\n\n## Usage\n\n```yaml\nethscan -h\n```\n```yaml\nUsage:\n  ethscan (abi | code) \u003caddress\u003e [options]\n  ethscan -h | --help | --version\n\nOptions:\n  -o, --output=\u003cfile\u003e    Write to output file.\n  -k, --api=\u003ckey\u003e        API key\n  -u, --url=\u003curl\u003e        Block-explorer url\n  -c, --chain=\u003cname\u003e     Use predefined chain block-explorer\n  -h --help              Show this screen.\n  -v, --version          Show version.\n  -d, --debug            Print debug logs.\n```\n\n**Output contract ABI:**\n```yaml\nethscan abi 0xD33526068D116cE69F19A9ee46F0bd304F21A51f -chain ethereum\n```\n```yaml\n[\n{\n  \"inputs\": [\n    {\n      \"internalType\": \"contract RocketStorageInterface\",\n      \"name\": \"_rocketStorageAddress\",\n      \"type\": \"address\"\n    },\n    {\n      \"internalType\": \"contract IERC20\",\n      \"name\": \"_rocketTokenRPLFixedSupplyAddress\",\n      \"type\": \"address\"\n    }\n  ],\n  \"stateMutability\": \"nonpayable\",\n  \"type\": \"constructor\"\n},\n...\n]\n```\n\n**Save contract code:**\n```yaml\nethscan code 0xD33526068D116cE69F19A9ee46F0bd304F21A51f -o ~/code\n```\n```\n    ~/code  tree .\n.\n├── contracts\n│   ├── contract\n│   │   ├── RocketBase.sol\n│   │   └── token\n│   │       └── RocketTokenRPL.sol\n│   └── interface\n│       ├── dao\n│       │   └── protocol\n│       │       └── settings\n│       │           └── RocketDAOProtocolSettingsInflationInterface.sol\n│       ├── RocketStorageInterface.sol\n│       ├── RocketVaultInterface.sol\n│       └── token\n│           └── RocketTokenRPLInterface.sol\n└── @openzeppelin\n    └── contracts\n        ├── math\n        │   └── SafeMath.sol\n        ├── token\n        │   └── ERC20\n        │       ├── ERC20Burnable.sol\n        │       ├── ERC20.sol\n        │       └── IERC20.sol\n        └── utils\n            └── Context.sol\n\n14 directories, 11 files\n\n```\n**Output contract code:**\n```yaml\nethscan code 0xD33526068D116cE69F19A9ee46F0bd304F21A51f\n```\n\n```yaml\n[\n...\n{\n    content: '/**\\n' +\n      '  *       .\\n' +\n      '  *      / \\\\\\n' +\n      \"  *     |.'.|\\n\" +\n      \"  *     |'.'|\\n\" +\n      \"  *   ,'|   |`.\\n\" +\n      \"  *  |,-'-|-'-.|\\n\" +\n      '  *   __|_| |         _        _      _____           _\\n' +\n      '  *  | ___ \\\\|        | |      | |    | ___ \\\\         | |\\n' +\n      '  *  | |_/ /|__   ___| | _____| |_   | |_/ /__   ___ | |\\n' +\n      '  *  |    // _ \\\\ / __| |/ / _ \\\\ __|  |  __/ _ \\\\ / _ \\\\| |\\n' +\n      '  *  | |\\\\ \\\\ (_) | (__|   \u003c  __/ |_   | | | (_) | (_) | |\\n' +\n      '  *  \\\\_| \\\\_\\\\___/ \\\\___|_|\\\\_\\\\___|\\\\__|  \\\\_|  \\\\___/ \\\\___/|_|\\n' +\n      '  * +---------------------------------------------------+\\n' +\n      '  * |    DECENTRALISED STAKING PROTOCOL FOR ETHEREUM    |\\n' +\n      '  * +---------------------------------------------------+\\n' +\n  ...\n      'interface RocketTokenRPLInterface is IERC20 {\\n' +\n      '    function getInflationCalcTime() external view returns(uint256);\\n' +\n      '    function getInflationIntervalTime() external view returns(uint256);\\n' +\n  ...\n      '}\\n',\n    path: '/contracts/interface/token/RocketTokenRPLInterface.sol'\n  }\n]\n\n```\n\n## Development\n\nFor local development linking the package is useful. This enables us to use a development version of `ethscan`\ninstead of fetching from npm.\n\n```bash\nnpm link\n```\n\n## Contribution\nContributions are welcome! Leave an issue or send an email.\n\nDon't forget to format the code:\n```bash\nnpm run fix\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowodunni%2Fethscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowodunni%2Fethscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowodunni%2Fethscan/lists"}