Skip to content
Verified contractPartial

Sweeper

Address0x76d0155be895efbf1971d453ab35e9b725db022c
Balance

0 ETH

 

Transactions

23

 

Compiler

solc 0.4.21

 

Same code

887 more contracts

 

Details

Compiler
solc 0.4.21+commit.dfe3193c
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
8,251,897
Creation transaction
0x75ba215e93…2111285760
Main copy (most transactions)
0xa4a904f7…82a2b01c

Sweeper.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.4.13;

contract ERC20 {
    function balanceOf(address who) public constant returns (uint256);
    function transfer(address to, uint256 value) public returns (bool);
}

contract Sweeper {
    address public destinationAddress;

    event TokenSweep(address token, uint256 amount);
    event Sweep(uint256 amount);

    function Sweeper(address _destinationAddress) public {
        destinationAddress = _destinationAddress;
    }

    function () public payable {
        destinationAddress.transfer(msg.value);
        Sweep(msg.value);
    }

    function tokenFallback(address _from, uint256 _value, bytes _data) public {
        ERC20 token = ERC20(msg.sender);
        if (token.transfer(destinationAddress, _value)) {
            TokenSweep(msg.sender, _value);
        } else {
            revert();
        }
    }

    function sweepTokens(address _token) public {
        ERC20 token = ERC20(_token);
        uint256 balance = token.balanceOf(this);
        token.transfer(destinationAddress, balance);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.