Skip to content
Verified contractPartial

TokenCollector

Address0x6f57c8e21fdaef4c299ad138fd05058fcd507a0e
Balance

0 ETH

 

Transactions

44

 

Compiler

solc 0.4.12

 

Same code

474 more contracts

 

Details

Compiler
solc 0.4.12+commit.194ff033
Language
solidity
Optimization
Yes, 0 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
4,241,002
Creation transaction
0x21964ddbca…45fd5c091a
Main copy (most transactions)
0x250e4e30…25182d44

TokenCollector.sol

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

contract Ownable {
    address public owner;

    function Ownable() {
        owner = msg.sender;
    }

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address newOwner) onlyOwner {
        if (newOwner != address(0)) {
            owner = newOwner;
        }
    }
}

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

contract TokenCollector is Ownable {
    function TokenCollector(address _owner) {
        require(_owner != address(0));
        owner = _owner;
    }

    function () payable {
        owner.transfer(this.balance);
    }

    function collectToken(address _token, address _to) onlyOwner {
        require(_token != address(0));
        ERC20Basic token = ERC20Basic(_token);
        uint256 balance = token.balanceOf(this);
        address to = _to;
        if (to == address(0)) {
            to = owner;
        }
        require(balance > 0);
        token.transfer(to, balance);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 0,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.