One thing most DeFi users eventually run into is the frustration of having funds “stuck” in contracts. A farm shuts down, the frontend disappears, or a liquidity pool is abandoned, and suddenly your tokens feel inaccessible. Over the past months I’ve been focusing on recovering these funds directly from EVM contracts — bypassing the dead UI and talking straight to the blockchain.

    I’ve managed to extract tokens from dead yield farms, abandoned liquidity protocols, and other DeFi ghost towns. These aren’t hacks or exploits — they’re simply direct contract interactions using functions that were always there. If you understand how the EVM works and how to interact with contracts via block explorers or scripting tools, you can often recover assets that most users assume are gone.

    I’ve documented the process step by step in a guide here (Part 1):
    👉 https://fuk.io/how-to-remove-liquidity-or-tokens-directly-from-evm-contract/

    How it works (technical TL;DR)

    Most DeFi projects are just thin frontends that call existing smart contracts. When those frontends disappear, the contracts remain on-chain. Using tools like Etherscan/Polygonscan’s “Write Contract” tab, or frameworks like Hardhat, Foundry, or even web3.py, you can still call the functions yourself.

    Here are some of the common functions you’ll run into:

    • Liquidity Pools (Uniswap/Sushiswap style)These let you burn your LP tokens and withdraw the underlying assets directly. You’ll usually need to approve the router contract to spend your LP first.
      • removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline)
      • removeLiquidityETH(token, liquidity, amountTokenMin, amountETHMin, to, deadline)
    • MasterChef / Farming ContractsEven if the frontend is gone, these calls still work if you know the right pool ID (pid).
      • withdraw(pid, amount) → withdraw your staked LP tokens (with rewards).
      • emergencyWithdraw(pid) → pull out your staked LP without caring about rewards.
      • claim(pid) or harvest(pid) (sometimes custom-named) → claim pending rewards.
    • ERC20 Token Recovery
      • balanceOf(address) → check if you still hold farm/reward tokens.
      • transfer(to, amount) → move them out manually.
      • Some contracts even expose helper functions like recoverERC20(address token, uint256 amount) that admins/developers used to rescue stuck funds — sometimes left public by accident.

    Risks and Caveats

    Not every contract is recoverable. In some cases, developers hard-rugged by draining liquidity or leaving no valid withdraw functions. Others may include modifiers that lock withdrawals permanently after a certain block. Always read the contract code (or verified source on Etherscan) before interacting.

    Also, gas can be high — especially if you’re trying this on Ethereum mainnet. Sometimes it’s not worth spending $50+ in gas to recover $20 worth of dead farm tokens.

    I got tokens out of few dead website smart contracts
    byu/kingscrown69 inCryptoCurrency



    Posted by kingscrown69

    2 Comments

    1. I’m in this situation where I did LP in a sushiswap pool on moonriver netwoork and forget about it. I went back to check recently and sushiswap doesn’t support moonriver anymore and my money stuck there. will try your guide. thanks

    2. I once sent XDC to a Chinese exchange that had another token named XDC that was different from Xinfin. I tried to get my coin back for months translating emails to Chinese, but no luck. The exchange is now shut down. I wonder if I can use these methods in my case… I will probably try out the ECR20 method. Thanks for sharing!

      Edit: added that the exchange is also shut down now.

    Leave A Reply
    Share via