Skip to content

A python script, that transfers Ether or ERC-20 tokens between Ethereum addresses. It supports other forks to. bep20, polygon, etc.

Notifications You must be signed in to change notification settings

SafeSwap1/erc20token-transfer-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TokenTransfer

This Python script provides a simple class, TokenTransfer, for transferring Ethereum-based tokens (including Ether and ERC20 tokens) from one address to another using the web3.py library.

Prerequisites

  • Python 3.6 or higher
  • web3.py library installed

Usage

  1. Import the TokenTransfer class from the script:
from token_transfer import TokenTransfer
  1. Create an instance of the TokenTransfer class with the necessary parameters:
rpc_url = "YOUR_RPC_URL"
private_key = "YOUR_PRIVATE_KEY"
contract_address = "TOKEN_CONTRACT_ADDRESS"  # Optional for ERC20 tokens, leave it empty for Ether
token_transfer = TokenTransfer(rpc_url, private_key, contract_address)
  1. Get the token balance of the sender's address:
balance = token_transfer.get_balance()
print("Balance:", balance)
  1. Transfer tokens to a recipient address:
recipient_address = "RECIPIENT_ADDRESS"
amount = 10  # Change this to the desired amount of tokens
transaction_hash = token_transfer.transfer_tokens(recipient_address, amount)
print("Transaction Hash:", transaction_hash)

For more detailed usage and customization options, refer to the source code.

DONATE: 0xb9C1de0E8764Ac737A114cfD9831eacE78e47856

About

A python script, that transfers Ether or ERC-20 tokens between Ethereum addresses. It supports other forks to. bep20, polygon, etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages