basiliskawakens.xyz

How to Spot a Wallet Draining Approval by Reading the Function Call

A wallet draining approval is a transaction that tricks you into giving a data/verify-contract-owner-and-proxy/">smart contract unlimited permission to spend a specific token from your wallet, after which the contract immediately transfers your entire balance to an address the attacker controls. You can spot one before signing by reading the function call in the transaction's input data, not by trusting the name or description shown in your wallet interface.

What a legitimate approval looks like

When you approve a token for a DEX or lending protocol, the smart contract function being called is almost always approve(address spender, uint256 amount). The spender is the contract address of the protocol, and the amount is typically a very large number (like 2^256 - 1) for an unlimited approval, or an exact number for a limited one.

In a normal case, the transaction interacts with the token's own contract address, not a separate contract. The function selector (the first four bytes of the input data) for approve is 0x095ea7b3. Any transaction that starts with those bytes is calling the approve function on a token contract.

How a draining approval is different

A wallet draining approval does not use the standard approve function on the token contract. Instead, it uses a different function on a different contract. The most common pattern is:

  1. The transaction targets a contract that is not the token you think you are approving.
  2. The function selector is something other than 0x095ea7b3, often 0xac9650d8 (multicall), 0x5ae401dc (multicall with deadline), or a custom function name like permit, deposit, or execute.
  3. Inside that function, the contract calls approve on the token contract on your behalf, but the spender is set to an address you have never seen before - the drainer's contract.
  4. The transaction also contains a second call that immediately transfers your tokens out using the approval it just created.

Step-by-Step: how to check before signing

1. Look at the "Interact With (To)" Address

Do not trust the name shown in MetaMask or your wallet. The "Interact With" field shows the contract address the transaction is calling. Compare that address to the token's official contract address. If they are different, you are not approving the token directly - you are calling some other contract.

Paste both addresses into a block explorer and check the contract names and verified source code. If the "To" address is not the token's contract, proceed with extreme caution.

2. Decode the Input Data

Use your wallet's "Hex" or "Data" tab, or paste the raw input data into a tool like Etherscan's "Decode Input Data" feature (available on the transaction page under the "Click to see More" section). If the function signature does not match approve(address,uint256), you are not calling the standard approve function.

Common suspicious function signatures to watch for:

3. Check the Spender Address

If the function is approve and the "To" address is the token contract, the second parameter (the spender) is the address that will be allowed to spend your tokens. Look up that spender address on a block explorer. If it is a contract that was deployed within the last few hours or days, has no verified source code, or has no legitimate reputation (no known protocol name, no GitHub link, no social media), do not proceed.

4. Look for a Second Call in the Same Transaction

If the input data decodes to a multicall or an execute function, decode the nested calls. You will often see:

If you see a transferFrom call in the same transaction as an approval, and the recipient is not a known exchange or protocol address, that transaction will drain your token balance.

5. Simulate the Transaction Before Signing

Use a transaction simulation tool such as Tenderly's Transaction Simulator, Blowfish, or the simulation feature built into wallets like Rabby or Safe. Run the exact transaction data through the simulator. The output will show you exactly which tokens leave your wallet and where they go. If the simulation shows your tokens being sent to an unknown address, reject the transaction.

Do not rely on the preview shown by your wallet's UI. Draining contracts often manipulate the metadata or use proxy contracts to display a misleading name or description.

Red flags that do not require reading input data

Even before you decode the function call, these warning signs should make you stop:

What to do if you already signed

If you approved a draining contract, revoke the approval immediately. Use a token approval checker like Etherscan's "Token Approvals" tab, Revoke.cash, or the approval checker built into your wallet. Find the token contract and the spender address from the transaction you signed, and call approve(spender, 0) to set the allowance to zero. Do this from a different device or a fresh browser session to avoid interacting with the same malicious site.

If the tokens are already gone, the drain cannot be reversed. Report the contract address to block explorers and security tools so other users can see the warning label.

Not financial advice. basiliskawakens.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to on-chain data