Small educational ERC20 token project built with Solidity and web3.py.
This repository combines:
- a simple ERC20 token contract in
ERC20.sol - a compiled ABI in
MyTokenABI.json - Python scripts for RPC connectivity, balance checks, and token transfers
It is best understood as a learning/demo repo rather than production-ready token infrastructure.
ERC20.sol
MyTokenABI.json
Connect.py
Token_dApp.py
Test.py
ERC20.sol: basic OpenZeppelin-based ERC20 token contract namedMyToken(MTK)MyTokenABI.json: ABI used by the Python scripts to interact with the deployed contractConnect.py: quick RPC connection check and latest-block lookupToken_dApp.py: balance lookup and token transfer flow using a configured contract addressTest.py: alternate interactive transfer script against a configured token contract
The Python scripts currently:
- connect to
https://rpc-mumbai.maticvigil.com - expect a deployed token contract address to be hardcoded in the script
- rely on the ABI file in the repo root
Before running anything against your own deployment, update the RPC endpoint and contract address to match the network you actually want to use.
- Install Python 3.
- Install the required dependency:
pip install web3- If you deploy your own token, compile
ERC20.soland make sure the ABI inMyTokenABI.jsonmatches the deployed contract. - Update the contract address in
Token_dApp.pyorTest.py.
Check RPC connectivity:
python Connect.pyRun the token interaction flow:
python Token_dApp.pyDo not hardcode real private keys in source files or commit them to GitHub.
If you continue this project, move secrets into environment variables or a local config file that is excluded from version control.
- move RPC URLs and contract addresses into a config file or environment variables
- remove plaintext private-key handling from the example scripts
- add a
requirements.txt - add deployment instructions for Remix, Hardhat, or Brownie
- document the expected token decimals and deployment network