{"id":24327808,"url":"https://github.com/solidity-utilities/abi-to-interface","last_synced_at":"2026-05-01T12:31:34.422Z","repository":{"id":57161482,"uuid":"441775954","full_name":"solidity-utilities/abi-to-interface","owner":"solidity-utilities","description":"JavaScript CLI tool for converting contract ABI to Solidity interface contract","archived":false,"fork":false,"pushed_at":"2021-12-25T23:39:19.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T16:05:50.193Z","etag":null,"topics":["abi","interface","javascript","solidity","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidity-utilities.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":"2021-12-25T23:33:33.000Z","updated_at":"2024-06-08T08:18:59.000Z","dependencies_parsed_at":"2022-09-09T07:40:40.820Z","dependency_job_id":null,"html_url":"https://github.com/solidity-utilities/abi-to-interface","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidity-utilities%2Fabi-to-interface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidity-utilities%2Fabi-to-interface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidity-utilities%2Fabi-to-interface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidity-utilities%2Fabi-to-interface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidity-utilities","download_url":"https://codeload.github.com/solidity-utilities/abi-to-interface/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242990364,"owners_count":20217975,"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","interface","javascript","solidity","typescript"],"created_at":"2025-01-17T22:15:40.760Z","updated_at":"2025-10-18T02:58:45.051Z","avatar_url":"https://github.com/solidity-utilities.png","language":"JavaScript","funding_links":["https://liberapay.com/solidity-utilities"],"categories":[],"sub_categories":[],"readme":"# Solidity ABI To Interface\n[heading__top]:\n  #solidity-abi-to-interface\n  \"\u0026#x2B06; Node JS CLI script for converting Solidity ABI to interface contract\"\n\n\nNode JS CLI script for converting Solidity ABI to interface contract\n\n\n## [![Byte size of Abi To Interface][badge__main__abi_to_interface__source_code]][abi_to_interface__main__source_code] [![Open Issues][badge__issues__abi_to_interface]][issues__abi_to_interface] [![Open Pull Requests][badge__pull_requests__abi_to_interface]][pull_requests__abi_to_interface] [![Latest commits][badge__commits__abi_to_interface__main]][commits__abi_to_interface__main] [![License][badge__license]][branch__current__license]\n\n\n---\n\n\n- [:arrow_up: Top of Document][heading__top]\n\n- [:building_construction: Requirements][heading__requirements]\n\n- [:zap: Quick Start][heading__quick_start]\n\n- [\u0026#x1F9F0; Usage][heading__usage]\n\n- [\u0026#x1F5D2; Notes][heading__notes]\n\n- [:chart_with_upwards_trend: Contributing][heading__contributing]\n\n  - [:trident: Forking][heading__forking]\n  - [:currency_exchange: Sponsor][heading__sponsor]\n\n- [:card_index: Attribution][heading__attribution]\n\n- [:balance_scale: Licensing][heading__license]\n\n\n---\n\n\n\n## Requirements\n[heading__requirements]:\n  #requirements\n  \"\u0026#x1F3D7; Prerequisites and/or dependencies that this project needs to function properly\"\n\n\n\u003e Prerequisites and/or dependencies that this project needs to function properly\n\n\nNode JS and NPM, or similar Node JS package manager, is required to utilize this\nproject and dependencies.\n\n\n______\n\n\n## Quick Start\n[heading__quick_start]:\n  #quick-start\n  \"\u0026#9889; Perhaps as easy as one, 2.0,...\"\n\n\n\u003e Perhaps as easy as one, 2.0,...\n\n\nInstall project globally...\n\n\n```bash\nnpm install --global @solidity-utilities/abi-to-interface\n```\n\n\nAvailable CLI parameters may be listed via `--help` option...\n\n\n```bash\nsolidity-abi-to-interface --help\n```\n\n\n---\n\n\nNote, if `solidity-abi-to-interface` reports errors similar to...\n\n\n    bash: solidity-abi-to-interface: command not found\n\n\n... then please ensure the `PATH` variable includes a reference to the NPM\nprefixed `bin/` directory, eg.\n\n\n```bash\n# Add prefix if not defined\ngrep -qE '^prefix ' \u003c(npm config ls) || {\n  tee -a \"${HOME}/.npmrc\" 1\u003e/dev/null \u003c\u003cEOF\nprefix = \"${HOME}/.npm\"\nEOF\n}\n\n\n# Append to PATH variable if not defined\n_npm_prefix=\"$(awk '/^prefix / {\n  gsub(\"\\\"\", \"\");\n  print $3;\n}' \u003c(npm config ls))\"\n\ngrep -qE \"(:)?(${_npm_prefix}/bin)(:)?\" \u003c\u003c\u003c\"${PATH}\" || {\n  tee -a \"${HOME}/.bashrc\" 1\u003e/dev/null \u003c\u003cEOF\nexport PATH=\"${PATH}:${_npm_prefix}/bin\"\nEOF\n}\n\n\n# Reload Bash RC file\nsource \"${HOME}/.bashrc\"\n```\n\n\n______\n\n\n## Usage\n[heading__usage]:\n  #usage\n  \"\u0026#x1F9F0; How to utilize this repository\"\n\n\n\u003e How to utilize this repository\n\n\nChange current working directory to a Solidity project...\n\n\n```bash\ncd ~/git/hub/solidity-utilities/example\n```\n\n\nCompile contract(s) into ABI JSON file(s)...\n\n\n```bash\ntruffle compile\n```\n\n\nGenerate an interface contract based on _`Account`_ contract ABI...\n\n\n```bash\nsolidity-abi-to-interface --abi build/contracts/Account.json\\\n                          --out contracts/InterfaceAccount.sol\n```\n\n\n---\n\n\nA source contract such as...\n\n\n**`contracts/Account.sol`**\n\n\n```solidity\n// SPDX-License-Identifier: AGPL-3.0\npragma solidity 0.8.7;\n\ncontract Account {\n    string public name;\n    address payable public owner;\n\n    function updateName(string calldata _new_name) external {\n        require(msg.sender == owner, \"Owner required\");\n        name = _new_name;\n    }\n}\n```\n\n\nWill result in an interface similar to...\n\n\n**`contracts/InterfaceAccount.sol`**\n\n\n```solidity\n// SPDX-License-Identifier: AGPL-3.0\npragma solidity 0.8.7;\n\n/// @title Automatically generated by `@solidity-utilities/abi-to-interface`\ninterface InterfaceAccount {\n    /* Variable getters */\n\n    function name() external view returns (string memory);\n\n    function owner() external view returns (address payable);\n\n    /* Function definitions */\n\n    function updateName(string calldata _new_name) external;\n}\n```\n\n\n______\n\n\n## Notes\n[heading__notes]:\n  #notes\n  \"\u0026#x1F5D2; Additional things to keep in mind when utilizing this project\"\n\n\n\u003e Additional things to keep in mind when utilizing this project\n\n\nThis repository may not be feature complete and/or fully functional, Pull\nRequests that add features or fix bugs are certainly welcomed.\n\n\n______\n\n\n## Contributing\n[heading__contributing]:\n  #contributing\n  \"\u0026#x1F4C8; Options for contributing to abi-to-interface and solidity-utilities\"\n\n\n\u003e Options for contributing to abi-to-interface and solidity-utilities\n\n\n---\n\n\n### Forking\n[heading__forking]:\n  #forking\n  \"\u0026#x1F531; Tips for forking abi-to-interface\"\n\n\n\u003e Tips for forking `abi-to-interface`\n\n\nMake a [Fork][abi_to_interface__fork_it] of this repository to an account that\nyou have write permissions for.\n\n\n- Clone fork URL. The URL syntax is _`git@github.com:\u003cNAME\u003e/\u003cREPO\u003e.git`_, then add this repository as a remote...\n\n\n```bash\nmkdir -p ~/git/hub/solidity-utilities\n\ncd ~/git/hub/solidity-utilities\n\ngit clone --origin fork git@github.com:\u003cNAME\u003e/abi-to-interface.git\n\ngit remote add origin git@github.com:solidity-utilities/abi-to-interface.git\n```\n\n\n- Install development dependencies\n\n\n```bash\ncd ~/git/hub/solidity-utilities/abi-to-interface\n\nnpm ci\n```\n\n\n\u003e Note, the `ci` option above is recommended instead of `install` to avoid\n\u003e mutating the `package.json`, and/or `package-lock.json`, file(s) implicitly\n\n\n- Commit your changes and push to your fork, eg. to fix an issue...\n\n\n```bash\ncd ~/git/hub/solidity-utilities/abi-to-interface\n\n\ngit commit -F- \u003c\u003c'EOF'\n:bug: Fixes #42 Issue\n\n\n**Edits**\n\n\n- `\u003cSCRIPT-NAME\u003e` script, fixes some bug reported in issue\nEOF\n\n\ngit push fork main\n```\n\n\n- Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is _`https://github.com/\u003cNAME\u003e/\u003cREPO\u003e/pull/new/\u003cBRANCH\u003e`_\n\n\n\u003e Note; to decrease the chances of your Pull Request needing modifications\n\u003e before being accepted, please check the\n\u003e [dot-github](https://github.com/solidity-utilities/.github) repository for\n\u003e detailed contributing guidelines.\n\n\n\n---\n\n\n### Sponsor\n  [heading__sponsor]:\n  #sponsor\n  \"\u0026#x1F4B1; Methods for financially supporting solidity-utilities that maintains abi-to-interface\"\n\n\n\u003e Methods for financially supporting `solidity-utilities` that maintains\n\u003e `abi-to-interface`\n\n\nThanks for even considering it!\n\n\nVia Liberapay you may\n\u003csub\u003e[![sponsor__shields_io__liberapay]][sponsor__link__liberapay]\u003c/sub\u003e on a\nrepeating basis.\n\n\nFor non-repeating contributions Ethereum is accepted via the following public address;\n\n\n    0x5F3567160FF38edD5F32235812503CA179eaCbca\n\n\nRegardless of if you're able to financially support projects such as\n`abi-to-interface` that `solidity-utilities` maintains, please consider sharing\nprojects that are useful with others, because one of the goals of maintaining\nOpen Source repositories is to provide value to the community.\n\n\n______\n\n\n## Attribution\n[heading__attribution]:\n  #attribution\n  \"\u0026#x1F4C7; Resources that where helpful in building this project so far.\"\n\n\n- [Etherum StackExchange -- How to create interface to read Struct in mapping?](https://ethereum.stackexchange.com/questions/61366/)\n\n- [GitHub -- `github-utilities/make-readme`](https://github.com/github-utilities/make-readme)\n\n- [Medium -- Build and Publish Your First Command Line Application with Node.JS and NPM](https://medium.com/@cruzw/build-and-publish-your-first-command-line-application-with-npm-6192f4044779)\n\n- [Solidity Docs -- Contracts -- Interfaces](https://docs.soliditylang.org/en/v0.8.9/contracts.html#interfaces)\n\n\n______\n\n\n## License\n[heading__license]:\n  #license\n  \"\u0026#x2696; Legal side of Open Source\"\n\n\n```\nNode JS CLI script for converting Solidity ABI to interface contract\nCopyright (C) 2021 S0AndS0\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, version 3 of the License.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n\nFor further details review full length version of [AGPL-3.0][branch__current__license] License.\n\n\n\n[branch__current__license]:\n  /LICENSE\n  \"\u0026#x2696; Full length version of AGPL-3.0 License\"\n\n[badge__license]:\n  https://img.shields.io/github/license/solidity-utilities/abi-to-interface\n\n[badge__commits__abi_to_interface__main]:\n  https://img.shields.io/github/last-commit/solidity-utilities/abi-to-interface/main.svg\n\n[commits__abi_to_interface__main]:\n  https://github.com/solidity-utilities/abi-to-interface/commits/main\n  \"\u0026#x1F4DD; History of changes on this branch\"\n\n\n[abi_to_interface__community]:\n  https://github.com/solidity-utilities/abi-to-interface/community\n  \"\u0026#x1F331; Dedicated to functioning code\"\n\n\n[issues__abi_to_interface]:\n  https://github.com/solidity-utilities/abi-to-interface/issues\n  \"\u0026#x2622; Search for and _bump_ existing issues or open new issues for project maintainer to address.\"\n\n[abi_to_interface__fork_it]:\n  https://github.com/solidity-utilities/abi-to-interface/fork\n  \"\u0026#x1F531; Fork it!\"\n\n[pull_requests__abi_to_interface]:\n  https://github.com/solidity-utilities/abi-to-interface/pulls\n  \"\u0026#x1F3D7; Pull Request friendly, though please check the Community guidelines\"\n\n[abi_to_interface__main__source_code]:\n  https://github.com/solidity-utilities/abi-to-interface/\n  \"\u0026#x2328; Project source!\"\n\n[badge__issues__abi_to_interface]:\n  https://img.shields.io/github/issues/solidity-utilities/abi-to-interface.svg\n\n[badge__pull_requests__abi_to_interface]:\n  https://img.shields.io/github/issues-pr/solidity-utilities/abi-to-interface.svg\n\n[badge__main__abi_to_interface__source_code]:\n  https://img.shields.io/github/repo-size/solidity-utilities/abi-to-interface\n\n\n[sponsor__shields_io__liberapay]:\n  https://img.shields.io/static/v1?logo=liberapay\u0026label=Sponsor\u0026message=solidity-utilities\n\n[sponsor__link__liberapay]:\n  https://liberapay.com/solidity-utilities\n  \"\u0026#x1F4B1; Sponsor developments and projects that solidity-utilities maintains via Liberapay\"\n\n\n[badge__github_actions]:\n  https://github.com/solidity-utilities/abi-to-interface/actions/workflows/test.yaml/badge.svg?branch=main\n\n[activity_log__github_actions]:\n  https://github.com/solidity-utilities/abi-to-interface/deployments/activity_log\n\n[truffle__package_management_via_npm]:\n  https://www.trufflesuite.com/docs/truffle/getting-started/package-management-via-npm\n  \"Documentation on how to install, import, and interact with Solidity packages\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidity-utilities%2Fabi-to-interface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidity-utilities%2Fabi-to-interface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidity-utilities%2Fabi-to-interface/lists"}