{"id":21598459,"url":"https://github.com/aviksaikat/ape-utils","last_synced_at":"2025-04-11T01:03:47.831Z","repository":{"id":247371423,"uuid":"825230678","full_name":"Aviksaikat/ape-utils","owner":"Aviksaikat","description":"Utility plugin to expose some of the Ape's awesome features to CLI","archived":false,"fork":false,"pushed_at":"2025-02-25T05:01:17.000Z","size":18713,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T01:03:41.535Z","etag":null,"topics":["apeworx","ethereum","foundry","solidity","solidity-contracts","vyper","vyper-contracts","web3py"],"latest_commit_sha":null,"homepage":"https://aviksaikat.github.io/ape-utils/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aviksaikat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["aviksaikat"],"buy_me_a_coffee":"aviksaikat","patreon":"CyberPuzzlePros","polar":"aviksaikat","custom":["https://www.paypal.me/aviksaikat007"]}},"created_at":"2024-07-07T07:31:02.000Z","updated_at":"2025-02-25T05:01:20.000Z","dependencies_parsed_at":"2024-11-24T23:31:18.327Z","dependency_job_id":null,"html_url":"https://github.com/Aviksaikat/ape-utils","commit_stats":null,"previous_names":["aviksaikat/ape-utils"],"tags_count":4,"template":false,"template_full_name":"ApeWorX/project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aviksaikat%2Fape-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aviksaikat%2Fape-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aviksaikat%2Fape-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aviksaikat%2Fape-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aviksaikat","download_url":"https://codeload.github.com/Aviksaikat/ape-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322597,"owners_count":21084336,"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":["apeworx","ethereum","foundry","solidity","solidity-contracts","vyper","vyper-contracts","web3py"],"created_at":"2024-11-24T18:12:15.243Z","updated_at":"2025-04-11T01:03:47.800Z","avatar_url":"https://github.com/Aviksaikat.png","language":"Python","funding_links":["https://github.com/sponsors/aviksaikat","https://buymeacoffee.com/aviksaikat","https://patreon.com/CyberPuzzlePros","https://polar.sh/aviksaikat","https://www.paypal.me/aviksaikat007"],"categories":[],"sub_categories":[],"readme":"# Ape_utils\n\n## Quick Start\n\nApe Utils is a CLI tool designed to interact with Ethereum smart contracts, specifically focusing on calling view functions. The tool allows you to call a view function from a given function signature and address directly from the command line.\n\n## Demo\n\n![demo](media/demo.gif)\n\n## Features\n\n- **Call View Functions:** Invoke view functions on Ethereum smart contracts using their function signature and address.\n- **Flexible Input:** Provide function signature, contract address, and arguments through the command line.\n\n## Dependencies\n\n- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.\n\n## Installation\n\n### via `pip`\n\nYou can install the latest release via [`pip`](https://pypi.org/project/pip/):\n\n```bash\npip install ape_utils\n```\n\n### Build locally\n\nYou can clone the repository and use [`pip`](https://github.com/pypa/pip) for the most up-to-date version:\n\n```bash\ngit clone https://github.com/Aviksaikat/ape_utils.git\ncd ape_utils\npip install -e .\n```\n\n## Quick Usage\n\nOnce installed, you can use the ape_utils command to call view functions on Ethereum smart contracts. Here is how you can use it:\n\n![help](media/help.png)\n\n```sh\nape_utils call --function-sig \"function_signature\" --address \"contract_address\" --args [argument] --network [ecosystem-name][:[network-name][:[provider-name]]]\n```\n\n### Examples\n\n#### Calling a view function with single parameter\n\nTo call a view function with the signature `call_this_view_function(uint256)(string)` on a contract at address `0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54` with an argument `6147190`, you can use:\n\n```bash\n# function which takes a single input parameter\nape_utils call --function-sig \"call_this_view_function(uint256)(string)\" --address \"0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54\" --args '[6147190]' --network :sepolia:infura\n# or\nape utils call -s \"call_this_view_function(uint256)(string)\" -a \"0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54\" -ag '[6147190]' --network :sepolia:infura\n```\n\n#### Calling a view function with multiple parameter\n\n```bash\n# function which takes multiple input parameters\nape_utils call --function-sig 'couple_param_function(uint256,string)(string)' --address '0x894A02d4574318a9da4EEc7884a7D0c095E65507' --args \"[6147190,'string']\" --network :sepolia\n```\n\n```bash\n# function with 3 input parameters\nape_utils call --function-sig 'multiple_param_function(uint256,string,address)(string)' --address '0x894A02d4574318a9da4EEc7884a7D0c095E65507' --args \"[6147190,'string', '0x894A02d4574318a9da4EEc7884a7D0c095E65507']\" --network :sepolia\n```\n\n### Use as ape plugin\n\n```bash\nape utils --help\nape utils call --function-sig \"call_this_view_function(uint256)(string)\" --address \"0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54\" --args '[6147190]' --network :sepolia:infura\n```\n\n#### ABI encode the given function\n\n```sh\nape_utils encode --signature 'call_this_view_function(uint256 arg1, string addr)' 1234 '0xdeadbeef'\n```\n\n#### ABI Decode input data\n\n```sh\nape_utils decode --signature 'call_this_view_function(uint256 arg1, string addr)' '0x00000000000000000000000000000000000000000000000000000000000004d20000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000a3078646561646265656600000000000000000000000000000000000000000000'\n```\n\n#### Encode the given function with function selector\n\n```sh\nape_utils encode --signature \"call_this_view_function(uint256 arg1)\" 1234\n```\n\n#### Decode the given function with function selector\n\n```sh\nape_utils decode --signature \"call_this_view_function(uint256 arg1)\" \"0x1e4f420d00000000000000000000000000000000000000000000000000000000000004d2\"\n```\n\n#### Don't want beautiful print statements ?\n\nYou can now pass the `--raw` flag to each option to print the output data only\n\n```sh\nape_utils encode --signature 'isLastFloor(uint256 arg1)' 1234 --raw\n```\n\n#### Read storage slots of a contract\n\n```sh\nape utils read --address \"0xDbB18e367E4A2A36A9F2AF7af8b3c743938deCF2\" --slot 1 --network :sepolia\n```\n\n![working](media/working.png)\n\n## Development\n\nPlease see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.\nComments, questions, criticisms and pull requests are welcomed.\n\n## Contact\n\nFor any issues or questions, please open an issue on the [GitHub repository](https://github.com/Aviksaikat/ape-utils).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviksaikat%2Fape-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faviksaikat%2Fape-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faviksaikat%2Fape-utils/lists"}