Skip to content

RedDuck-Software/erc20-multisend-template

Repository files navigation

ERC20 Multisend Template

A browser-only React + Vite template for sending one ERC20 token to many recipients with Uniswap Permit2.

The app lets a sender choose any ERC20 token on the configured network, approve Permit2 once for that token, paste or upload recipient rows, and send the batch with one Permit2 signature plus one transaction.

Features

  • Any ERC20 token address can be entered in the UI.
  • Recipient rows use a strict address,amount format with no header row.
  • Duplicate recipients are detected before sending.
  • Balance, allowance, gas, and block-limit checks run before broadcast.
  • No backend, no server-held keys, and no token-specific config.
  • Ready for Vercel or Cloudflare Workers static-assets deployment.

Important Security Note

This template is not audited. It is useful starter code, but you should review and test it before using valuable tokens. The setup step grants Permit2 a high allowance for the selected token. Users can revoke that allowance later with a wallet or allowance management tool.

How It Works

  1. Connect an injected wallet such as MetaMask.
  2. Enter an ERC20 token contract address on the selected network.
  3. The app reads token metadata, balance, and the wallet's Permit2 allowance.
  4. Approve Permit2 once with standard ERC20 approve.
  5. Paste or upload recipient rows.
  6. Sign the Permit2 batch transfer and submit one transaction.

Private keys stay in the wallet. The app runs fully in the browser.

Recipient Format

Use one recipient per line with two comma-separated values: recipient address, then token amount.

0x0000000000000000000000000000000000000000,100
0x1111111111111111111111111111111111111111,250.5

Do not include a header row. Every non-empty row is parsed as a recipient row.

Permit2 Flow

The template uses the canonical Uniswap Permit2 contract:

0x000000000022D473030F116dDEE9F6B43aC78BA3

Generic ERC20 tokens cannot be assumed to support EIP-2612 permit, so setup uses a normal ERC20 approve(Permit2, max) transaction. The actual multisend uses Permit2 permitTransferFrom: the sender signs typed data for the batch, then submits one transaction that transfers every row.

Local Development

npm ci
cp .env.example .env
npm run dev

The default app runs on Ethereum Mainnet. Change VITE_CHAIN in .env to use another configured network.

Configuration

src/config.js defines supported networks. The template currently includes:

  • mainnet
  • sepolia

To add another EVM network, add a chain entry with:

  • key
  • chainId
  • hexChainId
  • name
  • native
  • explorer

Checks

npm test
npm run build
npm run audit:prod

npm run audit:prod audits production dependencies only. Development tooling may report transitive audit warnings depending on the npm registry state.

Deployment

Vercel works with the included vercel.json.

For Cloudflare Workers static assets:

npm run build
npm run deploy

Set VITE_CHAIN in your hosting provider's environment variables if you do not want the default mainnet setting.

Repository Hygiene

Do not commit:

  • .env files
  • private keys or API secrets
  • node_modules
  • dist
  • .wrangler

License

MIT

About

A browser-only ERC20 multisend template powered by Uniswap Permit2.

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors