ape-utils


Nameape-utils JSON
Version 0.0.5 PyPI version JSON
download
home_pageNone
SummaryUtility plugin to expose some of the Ape's awesome features to CLI
upload_time2024-07-14 08:21:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache-2.0
keywords ethereum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Ape_utils

## Quick Start

Ape 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.

## Demo

![demo](media/demo.gif)

## Features

- **Call View Functions:** Invoke view functions on Ethereum smart contracts using their function signature and address.
- **Flexible Input:** Provide function signature, contract address, and arguments through the command line.

## Dependencies

- [python3](https://www.python.org/downloads) version 3.9 up to 3.12.

## Installation

### via `pip`

You can install the latest release via [`pip`](https://pypi.org/project/pip/):

```bash
pip install ape_utils
```

### Build locally

You can clone the repository and use [`pip`](https://github.com/pypa/pip) for the most up-to-date version:

```bash
git clone https://github.com/Aviksaikat/ape_utils.git
cd ape_utils
pip install -e .
```

## Quick Usage

Once installed, you can use the ape_utils command to call view functions on Ethereum smart contracts. Here is how you can use it:

![help](media/help.png)

```sh
ape_utils call --function-sig "function_signature" --address "contract_address" --args [argument] --network [ecosystem-name][:[network-name][:[provider-name]]]
```

### Examples

#### Calling a view function with single parameter

To 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:

```bash
# function which takes a single input parameter
ape_utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```

#### Calling a view function with multiple parameter

```bash
# function which takes multiple input parameters
ape_utils call --function-sig 'couple_param_function(uint256,string)(string)' --address '0x894A02d4574318a9da4EEc7884a7D0c095E65507' --args "[6147190,'string']" --network :sepolia
```

```bash
# function with 3 input parameters
ape_utils call --function-sig 'multiple_param_function(uint256,string,address)(string)' --address '0x894A02d4574318a9da4EEc7884a7D0c095E65507' --args "[6147190,'string', '0x894A02d4574318a9da4EEc7884a7D0c095E65507']" --network :sepolia
```

### Use as ape plugin

```bash
ape utils --help
ape utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```

#### ABI encode the given function

```sh
ape_utils encode --signature 'call_this_view_function(uint256 arg1, string addr)' 1234 '0xdeadbeef'
```

#### ABI Decode input data

```sh
ape_utils decode --signature 'call_this_view_function(uint256 arg1, string addr)' '0x00000000000000000000000000000000000000000000000000000000000004d20000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000a3078646561646265656600000000000000000000000000000000000000000000'
```

#### Encode the given function with function selector

```sh
ape_utils encode --signature "call_this_view_function(uint256 arg1)" 1234
```

#### Decode the given function with function selector

```sh
ape_utils decode --signature "call_this_view_function(uint256 arg1)" "0x1e4f420d00000000000000000000000000000000000000000000000000000000000004d2"
```

![working](media/working.png)

## Development

Please see the [contributing guide](CONTRIBUTING.md) to learn more how to contribute to this project.
Comments, questions, criticisms and pull requests are welcomed.

## Contact

For any issues or questions, please open an issue on the [GitHub repository](https://github.com/Aviksaikat/ape-utils).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ape-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ethereum",
    "author": null,
    "author_email": "SAIKAT KARMAKAR <github.maturity983@passinbox.com>",
    "download_url": "https://files.pythonhosted.org/packages/9f/75/477926e7fac1dcc95fa929d4b581bec91dc444bf10c04d3b02b682f7abab/ape_utils-0.0.5.tar.gz",
    "platform": null,
    "description": "# 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```\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![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",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Utility plugin to expose some of the Ape's awesome features to CLI",
    "version": "0.0.5",
    "project_urls": {
        "Documentation": "https://github.com/Aviksaikat/ape-utils#readme",
        "Issues": "https://github.com/Aviksaikat/ape-utils/issues",
        "Source": "https://github.com/Aviksaikat/ape-utils"
    },
    "split_keywords": [
        "ethereum"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0692cc5850d8685e4c4acbc629fc9cf393fe3d3cf9c71cf43988c5beb23f6b02",
                "md5": "dbd284887f2fa4cc99c9ebb7c8c7b3f1",
                "sha256": "d0967b6e41848463642b41ebc521cfc2dc6e27ede21977011c9336f9e56dfd05"
            },
            "downloads": -1,
            "filename": "ape_utils-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dbd284887f2fa4cc99c9ebb7c8c7b3f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11638,
            "upload_time": "2024-07-14T08:21:36",
            "upload_time_iso_8601": "2024-07-14T08:21:36.639867Z",
            "url": "https://files.pythonhosted.org/packages/06/92/cc5850d8685e4c4acbc629fc9cf393fe3d3cf9c71cf43988c5beb23f6b02/ape_utils-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f75477926e7fac1dcc95fa929d4b581bec91dc444bf10c04d3b02b682f7abab",
                "md5": "8c1dac01e66722d48e31496f259aecc9",
                "sha256": "7a7db50c97392dcb1fe3e21edc43317f3e828502d318e4758dec8a2f9439dc90"
            },
            "downloads": -1,
            "filename": "ape_utils-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8c1dac01e66722d48e31496f259aecc9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 12225,
            "upload_time": "2024-07-14T08:21:37",
            "upload_time_iso_8601": "2024-07-14T08:21:37.884835Z",
            "url": "https://files.pythonhosted.org/packages/9f/75/477926e7fac1dcc95fa929d4b581bec91dc444bf10c04d3b02b682f7abab/ape_utils-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-14 08:21:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Aviksaikat",
    "github_project": "ape-utils#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ape-utils"
}
        
Elapsed time: 0.27384s