Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Base Token Info πŸ”

Get comprehensive token data for any ERC20 token on Base network. Perfect for pre-trade due diligence and market research.

Features

  • On-Chain Data: name, symbol, decimals, total supply (via Foundry)
  • Market Data: price, 24h change, liquidity, volume (DexScreener API)
  • Security Info: contract address, Basescan link, DEX info
  • Zero Cost: Read-only operations, no gas fees

Quick Start

Prerequisites

  • Foundry (cast command)
  • jq (JSON parsing)
  • curl (API calls)
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Install jq (Ubuntu/Debian)
sudo apt-get install jq

# Install jq (macOS)
brew install jq

Usage

chmod +x token-info.sh
./token-info.sh <token_address>

Example: USDC on Base

./token-info.sh 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Output:

πŸ” Fetching token info for 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913...

πŸ“Š On-Chain Data
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Name:        USD Coin
Symbol:      USDC
Decimals:    6
Total Supply: 70,000,000,000 USDC

πŸ’° Market Data
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Price:       $1.00
24h Change:  0.01%
Liquidity:   $616,007.96
Volume (24h): $28,405.94
DEX:         aerodrome
Main Pair:   USDC/USDbC
Chart:       https://dexscreener.com/base/0x98c7A2338336d2d354663246F64676009c7bDa97

πŸ” Security
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Contract:    0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Basescan:    https://basescan.org/address/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
⚠️  Warning:  Always verify token contract on Basescan
             Malicious contracts can fake names/symbols

Example: DEGEN

./token-info.sh 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed

Use Cases

Pre-Trade Checks

  • Verify token has liquidity before swapping
  • Check current price and recent trends
  • Estimate potential price impact

Market Research

  • Compare trading volumes across tokens
  • Find active trading pairs
  • Track price movements

Security

  • Confirm token contract exists
  • Verify on Basescan before trading
  • Check for adequate liquidity

Integration with Bankr

Perfect companion for Bankr trading:

# 1. Check token info
./token-info.sh 0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed

# 2. If looks good, trade via Bankr
bankr "Buy $50 of DEGEN on Base"

Configuration

Custom RPC Endpoint

export BASE_RPC_URL="https://your-custom-rpc.com"
./token-info.sh 0x...

Default: https://mainnet.base.org

Security Notes

βœ… Safe to use:

  • Read-only operations (no transactions)
  • No private keys required
  • No gas fees
  • Input validation prevents injection

⚠️ User responsibility:

  • Always verify contract on Basescan
  • Malicious contracts can fake names/symbols
  • Check contract address matches expected token
  • Cross-reference multiple sources

How It Works

  1. On-Chain Queries: Uses Foundry's cast to call ERC20 functions
    • name(), symbol(), decimals(), totalSupply()
  2. Market Data: Fetches from DexScreener API
    • Price, volume, liquidity from main trading pair
  3. Validation: Checks address format before execution
  4. Error Handling: Graceful fallbacks for missing data

Limitations

  • Base network only (easily modified for other chains)
  • DexScreener API required for market data
  • Public RPC may rate limit on heavy usage
  • Unverified contracts may return misleading data

Contributing

PRs welcome! Ideas:

  • Multi-chain support
  • Additional data sources
  • Historical price data
  • Holder distribution
  • Contract verification check

License

MIT

Credits

Built with:

Created by @droppingbeans 🫘

About

Get comprehensive token data for any ERC20 on Base. On-chain info + market data in one command. πŸ”

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages