Overview
A secure, self-custody cryptocurrency wallet designed specifically for ERC-20 token interactions on the Ethereum blockchain. This solution eliminates dependency on third-party wallets like MetaMask, offering full control over token management—sending, receiving, and withdrawals—via a lightweight implementation built with ethers.js. Currently optimized for the Sepolia testnet.
Key Features
- Self-Managed Accounts: Create new wallets or import existing ones via private keys.
- ERC-20 Token Operations: Transfer tokens, check balances, and audit transactions.
- Sepolia Testnet Integration: Test functionalities risk-free before mainnet deployment.
- Security-First Design: Encrypted private key storage with industry-best practices.
- CLI Interface: Simple console-based UI for developers.
Prerequisites
Ensure your system has:
- Node.js v14+ and npm
- An Infura account (for Ethereum network access)
- Deployed ERC-20 contract on Sepolia testnet
Installation
1. Clone the Repository
git clone https://github.com/yourusername/custom-erc20-wallet.git
cd custom-erc20-wallet 2. Install Dependencies
npm install 3. Configure Environment
Create a .env file with:
INFURA_API_KEY=your_infura_project_id
SEPOLIA_TOKEN_ADDRESS=your_token_contract_address
SEPOLIA_PRIVATE_KEY=your_wallet_private_key # ⚠️ Never commit this! Usage Examples
Generate a New Wallet
const newWallet = ethers.Wallet.createRandom();
console.log("Address:", newWallet.address); Check ETH Balance
const balance = await sepoliaProvider.getBalance(wallet.address);
console.log("Balance:", ethers.utils.formatEther(balance)); Transfer ERC-20 Tokens
const tx = await tokenContract.transfer(recipientAddress, amount);
console.log("Tx Hash:", tx.hash); Security Best Practices
- 🔒 Never expose private keys in client-side code.
- 🛡️ Use environment variables for sensitive data.
- 🧑💻 Audit dependencies regularly.
FAQ
Q: Can I use this wallet for mainnet transactions?
A: Yes, after thorough testing on Sepolia. Update the Infura endpoint to mainnet in the configuration.
Q: How do I recover a lost wallet?
A: Without the private key or seed phrase, recovery is impossible—this emphasizes self-custody security.
Q: Is MetaMask integration possible?
A: The wallet operates independently, but you can manually connect to dApps via injected providers.
👉 Explore advanced wallet setups
Contributing & License
- Contributions: Fork → Feature Branch → Pull Request.
- License: MIT (see
LICENSEfile).
### Keywords Integrated:
1. ERC-20 Wallet
2. Ethereum Blockchain
3. Sepolia Testnet
4. ethers.js
5. Self-Custody Crypto
6. Token Management
7. Secure Transactions
👉 [Learn about Ethereum development](https://www.okx.com/join/BLOCKSTAR)