Skip to content
Verified contractExactMIT

ETHRecovery

Address0x6a488bb9700d28cd2757f7a836129dee552df0db
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.31

 

Same code

1 more contract

 

Details

Compiler
solc 0.8.31+commit.fd3a2265
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
24,447,134
Creation transaction
0x248bb8a799…dcf614c018

ETHRecovery.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.31;

contract ETHRecovery {

    address public constant wallet = 0xC36EA18e8758672dcC2FA7b1A1c5810f47982E80;

    // Call this to pull ETH from another contract
    function recover(address target) public {
        require(msg.sender == wallet, "Not allowed");

        // Call the target contract to trigger fallback and receive ETH
        (bool success, ) = target.call{value: 0}("");
        require(success, "Call failed");

        // Send all ETH to your wallet safely
        uint256 balance = address(this).balance;
        require(balance > 0, "No ETH recovered");
        (bool sent, ) = payable(wallet).call{value: balance}("");
        require(sent, "ETH transfer failed");
    }

    // Receive ETH from other contracts
    receive() external payable {}
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.