Browse by type
Drain is an open-source EVM wallet rescue and token migration tool. Move native gas tokens and ERC-20s from one wallet to another quickly when you are migrating wallets, consolidating long-tail assets, or rescuing funds from a wallet you still control.
Non-custodial. Open source. You connect your own wallet and approve every transaction.
Moving a crypto wallet is still too manual. If you have a wallet full of small ERC-20 balances across EVM networks, you usually have to:
Drain turns that into a focused rescue/migration flow: connect the source wallet, review discovered tokens, choose what to move, enter a destination, and sign the transfers.
Drain is built for situations like:
Drain is not a seed phrase recovery service, private-key recovery tool, mixer, custody product, or way to move assets you do not own or control.
Before using Drain, especially in a stressful compromised-wallet situation:
For more detail, review the safety checklist above and inspect the source before connecting valuable wallets.
Running locally is the best way to inspect exactly what the app does before connecting a wallet.
git clone https://github.com/dawsbot/drain.git
cd drain
npm install
cp .env.example .env.local
npm run dev
Then open http://localhost:3000.
Required environment variables:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
MORALIS_API_KEY=
MORALIS_API_KEY server-side: use .env.local for local development
and the Vercel project environment for Preview and Production. Never prefix
it with NEXT_PUBLIC_ or commit the real value.npm run lint
npx tsc --noEmit
npm test
npm run build
The default test run skips live Moralis suites when MORALIS_API_KEY is not
configured. Add the key to the ignored .env.local file to run those live API
checks locally.
Wallet connection
└─ RainbowKit / Wagmi
Token discovery
└─ pages/api/chain-info/[chainId]/[evmAddress].ts
└─ Moralis API
Token selection UI
└─ components/contract/GetTokens.tsx
└─ src/atoms/*
Transfer flow
└─ components/contract/SendTokens.tsx
├─ ERC-20 transfer calls
├─ native token value transfers
├─ ENS destination resolution
└─ batched sendCalls when supported
Contributions are welcome, especially around safety, chain support, simulation, and wallet UX.
Good areas to improve:
Local workflow:
npm install
npm run lint
npx tsc --noEmit
npm test
Please keep security-sensitive UX conservative: users should always know exactly what token, amount, destination, and network they are signing for.
Drain is intended for moving assets that you own or are authorized to control. Do not use this project for theft, phishing, unauthorized transfers, or deception. The maintainers do not endorse malicious use.
Drain began as an ETHGlobal project and has continued as an open-source wallet migration and rescue tool.
Read the original project page: https://ethglobal.com/showcase/drain-6f9sc
See repository license information before reuse.
browse all types & interfaces →
$ claude mcp add drain \
-- python -m otcore.mcp_server <graph>