Network: Base
Tools: Auto verification, deploy scripts, gas estimation, ERC20 utilities
This repository provides essential scripts and tools for developers building on the Base network.
The goal is to simplify contract deployment, verification, and common on-chain operations during development.
Follow my builder journey on Farcaster: @Alignerz_
BaseScan: https://basescan.org
- Auto Verify Script → Verify any contract on BaseScan with one command
- Deploy Script → Deploy ERC20 or custom contracts quickly
- Gas Estimation Script → Estimate gas usage for ERC20 transfers
- Sample ERC20 Contract included
- Pre-configured Hardhat environment for Base
.env.examplefor secure environment setup
npm install
cp .env.example .env
# Then open the .env file and set:
# PRIVATE_KEY=0xYourPrivateKey
# BASESCAN_API_KEY=YourBaseScanAPIKeyGet your BaseScan API key here:
https://basescan.org/myapikey
npx hardhat run scripts/deploy.js --network baseThis script deploys the SampleToken ERC20 contract and prints the deployed address.
node scripts/verify-on-basescan.js <CONTRACT_ADDRESS>This script automatically:
- Runs the Hardhat verification task
- Submits source code to BaseScan
- Uses optimized Solidity compiler settings
- Shows verification status in the terminal
node scripts/estimate-transfer-gas.js <TOKEN_ADDRESS> <TO_ADDRESS> <AMOUNT>Example:
node scripts/estimate-transfer-gas.js 0xToken 0xRecipient 10This tool:
- Connects to Base
- Loads ERC20 ABI
- Estimates the gas needed for
transfer() - Prints the gas cost in a clean format
Useful for:
- Airdrops
- Mass transfers
- Fee estimation
- Optimization before mainnet deployment
The included ERC20 contract:
contracts/SampleToken.sol
Features:
- Uses OpenZeppelin ERC20 implementation
- Mints 1,000,000 tokens (18 decimals) to the deployer
- Clean, simple, Base-ready
Hardhat is pre-configured with two networks:
- Base Mainnet →
https://mainnet.base.org - Base Sepolia Testnet →
https://sepolia.base.org
You can easily modify or extend networks in:
hardhat.config.js
| Script | Description |
|---|---|
deploy.js |
Deploys SampleToken or custom contracts |
verify-on-basescan.js |
Automatically verifies any contract on BaseScan |
estimate-transfer-gas.js |
Estimates gas usage for ERC20 transfers |
- Never commit real private keys
.envis ignored by git (see.gitignore)- Test on Base Sepolia before mainnet
- Always verify contract source code
For detailed security practices, see:
SECURITY.md
MIT License © 2025