Description:
Smart contract deployed on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract EthRecovery {
address payable public targetContract = payable(0x53a07D6DDf2eAa3891cBF9E39CFcDBebf5f21b9b);
// Call this to transfer ETH from the target to your address
function recoverETH(address payable _to) external {
require(msg.sender == tx.origin, "No contracts allowed"); // Prevent reentrancy
uint256 amount = address(targetContract).balance;
targetContract.transfer(amount); // This contract must have ETH first (see below)
_to.transfer(amount);
}
// Send ETH to this contract first (to cover gas costs)
receive() external payable {}
}
Submitted on: 2025-10-14 15:08:13
Comments
Log in to comment.
No comments yet.