https://github.com/filiprokita/eth-input-call-data-builder
A Python script utilizing Web3.py to construct input call data for ERC-20 token transfers on the Ethereum blockchain. The script encodes the transfer function call, allowing developers to create raw transaction data for smart contract interactions.
https://github.com/filiprokita/eth-input-call-data-builder
api blockchain developer-tools erc-20 erc20 ethereum input-call-data metamask python smart-contracts token web3
Last synced: 7 months ago
JSON representation
A Python script utilizing Web3.py to construct input call data for ERC-20 token transfers on the Ethereum blockchain. The script encodes the transfer function call, allowing developers to create raw transaction data for smart contract interactions.
- Host: GitHub
- URL: https://github.com/filiprokita/eth-input-call-data-builder
- Owner: FilipRokita
- License: mit
- Created: 2025-01-22T10:36:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-22T10:56:04.000Z (9 months ago)
- Last Synced: 2025-01-22T11:31:06.732Z (9 months ago)
- Topics: api, blockchain, developer-tools, erc-20, erc20, ethereum, input-call-data, metamask, python, smart-contracts, token, web3
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ERC-20 Input Call Data Generator
This Python script constructs input call data for transferring ERC-20 tokens using the `transfer(address,uint256)` function.
## Features
- Generates the input call data for the ERC-20 `transfer(address,uint256)` function.
- Encodes:
- The recipient's Ethereum address.
- The transfer amount in the smallest units of the token (e.g., 1 USDC = 10^6).
- Provides a reusable function (`construct_input_data`) for creating input call data for any ERC-20 token.## Prerequisites
1. Python 3.12 or later installed.
2. Installed required Python dependencies.## Installation
1. Clone this repository.
2. Install the required Python dependencies:
```bash
pip install -r requirements.txt
```## Usage
1. Open the script file and ensure the recipient address and transfer amount are correct:
- **Recipient Address**: `0x85b931A32a0725Be14285B66f1a22178c672d69B` (PLACEHOLDER; Binance 10 account).
- **Transfer Amount**: `100 USDC` (PLACEHOLDER; represented as `100 * 10^6` in smallest units).2. Run the script:
```bash
python eth-input-call-data-builder.py
```3. The output will display the constructed input call data.
## Author
[Filip Rokita](https://www.filiprokita.com/)