Skip to content

hpp-io/token-multisender

Repository files navigation

HPP Token Multisender

A DApp for sending ERC20 tokens to multiple wallet addresses in a single transaction.

Live site: https://multisend.hpp.io/

Features

  • Batch transfer ERC20 tokens to multiple addresses
  • Send same amount to all recipients
  • Support for HPP Mainnet / HPP Sepolia networks
  • Default HPP token or custom token address input
  • Browser wallet connection (MetaMask, etc.)
  • Bulk paste recipients (up to 200)
  • Transfer preview with total and gas estimate

Tech Stack

Category Technology
Smart Contract Solidity 0.8.20, Hardhat
Frontend Vite, React 19, Tailwind CSS
Web3 wagmi 3.x, viem 2.x
Deployment Cloudflare Workers (static assets)

Network Information

Network RPC URL Chain ID
HPP Mainnet https://mainnet.hpp.io/ 190415
HPP Sepolia https://sepolia.hpp.io/ 181228

Default HPP Token Addresses

Network Address
HPP Mainnet 0xB48334E7938367bC24Fe1F19000D6f06C622E6c7
HPP Sepolia 0x8ebCaf48D2D91b8CEcF1668A4519823881Bf8fc3

Multisend Contract Addresses

Network Address
HPP Mainnet 0x8a8f37909eD50Ed9c8000383e446930b8a68eDb2
HPP Sepolia 0x4BDb7b787Ea71C255e4EE98013a71c516eA704fB

Project Structure

token-multisender/
├── contracts/
│   ├── TokenMultisender.sol    # Multisend smart contract
│   └── mocks/
│       └── MockERC20.sol       # Test mock token
├── test/
│   └── TokenMultisender.test.js # Unit tests
├── scripts/
│   ├── deploy.js               # Deployment script
│   ├── multisend-sepolia.js    # Sepolia multisend test script
│   ├── multisend-csv.js        # CSV batch multisend script
│   ├── examples/
│   │   └── recipients.csv      # CSV example file
│   └── output/
│       └── sepolia-recipients-*.json # Generated recipients
├── frontend/
│   ├── src/                    # Vite source
│   ├── index.html              # Vite entry
│   ├── vite.config.ts          # Vite config
│   ├── tailwind.config.js      # Tailwind config
│   └── wrangler.jsonc          # Cloudflare Workers configuration
├── BulkSendGuide.md
├── hardhat.config.js
└── package.json

Getting Started

Requirements

  • Node.js 24.13.0 or higher
  • npm or yarn

Installation

# Install root dependencies (smart contract)
npm install

# Install frontend dependencies
cd frontend
npm install

Environment Variables

Create a .env file in the project root for Hardhat scripts:

PRIVATE_KEY=your_private_key

Optional overrides for the Sepolia multisend script:

MULTISENDER_ADDRESS=0x4BDb7b787Ea71C255e4EE98013a71c516eA704fB
TOKEN_ADDRESS=0x8ebCaf48D2D91b8CEcF1668A4519823881Bf8fc3
COUNT=200
AMOUNT=0.001
RECIPIENTS_FILE=./scripts/output/recipients.json
OUTPUT_FILE=./scripts/output/sepolia-recipients.json
CONFIRM=yes

Smart Contract

# Compile
npm run compile

# Run tests
npm run test

# Deploy to HPP Sepolia
PRIVATE_KEY=your_private_key npm run deploy:sepolia

# Deploy to HPP Mainnet
PRIVATE_KEY=your_private_key npm run deploy:mainnet

Sepolia Multisend Test Script

This script sends 0.001 HPP to 200 recipients on HPP Sepolia using the multisend contract.

CONFIRM=yes npx hardhat run scripts/multisend-sepolia.js --network hppSepolia

Notes:

  • If RECIPIENTS_FILE is not provided, the script generates 200 random addresses and writes them to scripts/output/.
  • Set CONFIRM=yes to execute the transfer; otherwise it will print a dry-run summary.

CSV Multisend Script (Batch Mode)

See BulkSendGuide.md for the full CSV batch-send guide.

After deployment, update MULTISENDER_ADDRESSES in frontend/src/config/contracts.ts.

Frontend

cd frontend

# Run development server
npm run dev

# Production build
npm run build

# Preview production build
npm run preview

Access http://localhost:5173 in your browser

Cloudflare Deployment

cd frontend

# Build assets
npm run build

# Deploy to Cloudflare Workers
npm run deploy

Authentication with wrangler login is required before Cloudflare deployment.

Smart Contract API

multisend(address token, address[] recipients, uint256[] amounts)

Sends different amounts of tokens to multiple addresses.

  • token: ERC20 token contract address
  • recipients: Array of recipient addresses (max 200)
  • amounts: Array of token amounts to send to each recipient

multisendSameAmount(address token, address[] recipients, uint256 amount)

Sends the same amount of tokens to multiple addresses.

  • token: ERC20 token contract address
  • recipients: Array of recipient addresses (max 200)
  • amount: Same token amount to send to each recipient

Usage

  1. Connect wallet (MetaMask, etc.)
  2. Select network (HPP Mainnet / HPP Sepolia)
  3. Select token (default HPP token or enter custom token address)
  4. Choose amount mode (individual or same amount)
  5. Enter recipient addresses and amounts (or bulk paste)
  6. Review the transfer preview (total + estimated gas)
  7. Click "Approve" to grant token spending permission to the contract
  8. Click "Send" to execute batch transfer

Bulk Paste Examples

Same Amount Mode

Paste one address per line (or separated by commas/spaces):

0x1234...abcd
0x5678...efgh
0x9abc...def0

Individual Amounts Mode

One line per recipient, address, amount:

0x1234...abcd, 1.5
0x5678...efgh, 2
0x9abc...def0, 0.75

License

MIT

About

ERC20 token multisender dapp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors