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.
- App: https://drain-tokens.vercel.app/
- Source: https://github.com/dawsbot/drain
- Original ETHGlobal project: https://ethglobal.com/showcase/drain-6f9sc
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:
- Find every token.
- Open each token contract or wallet asset page.
- Copy the new destination address repeatedly.
- Sign one transfer after another.
- Hope you did not miss dust, long-tail tokens, or the native gas token.
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:
- Wallet migration: You are retiring an old wallet and moving assets to a new one.
- Compromised-wallet response: You may be compromised, but you still have signing access and need to move assets quickly.
- Asset consolidation: You have long-tail ERC-20s or dust spread across an EVM wallet.
- Transparent recovery workflow: You want an open-source alternative to one-off scripts or opaque websites.
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.
- Connects to your wallet with RainbowKit / Wagmi.
- Reads token balances for the connected wallet.
- Shows token logos, balances, and estimated USD value.
- Lets you select the assets you want to move.
- Resolves ENS names for destination addresses.
- Transfers selected ERC-20 tokens to your destination wallet.
- Handles native gas tokens with value transfers while reserving gas.
- Attempts an atomic batched transfer when the wallet supports it, then falls back to one-by-one transfers.
- It does not ask for, store, or transmit your seed phrase or private key.
- It does not custody funds.
- It does not bypass wallet signatures.
- It does not guarantee recovery from wallets already controlled by an attacker.
- It does not currently recover NFTs.
- It should not be used to move assets you do not own or have permission to control.
Before using Drain, especially in a stressful compromised-wallet situation:
- Verify you are using the intended app URL or run the app locally.
- Confirm the destination address carefully before signing.
- Read each wallet prompt and verify the token, amount, and recipient.
- Start with a small test transfer when time allows.
- Keep enough native gas token for required transaction fees.
- If you believe your wallet is compromised, consider revoking approvals after moving assets.
- Move high-value assets first if you are racing an active attacker.
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 devThen open http://localhost:3000.
Required environment variables:
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
MORALIS_API_KEY=- Get a WalletConnect project ID from https://cloud.walletconnect.com/.
- Get a Moralis API key from https://admin.moralis.io/.
npm run lint
npx tsc --noEmit
npm test
npm run buildWallet 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:
- Add a clearer pre-signing simulation screen.
- Improve compromised-wallet mode and safety guidance.
- Expand network support documentation.
- Add NFT rescue support.
- Improve mobile WalletConnect flows.
- Add more automated tests for token discovery and transfer edge cases.
Local workflow:
npm install
npm run lint
npx tsc --noEmit
npm testPlease 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.
- Dedicated compromised-wallet rescue mode.
- Transaction simulation before signing.
- NFT discovery and transfer support.
- Approval revoke integrations after rescue.
- Better multi-chain sweep flow.
- More detailed network support matrix.
- Local-only / self-hosted mode docs.
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.