Skip to content
Verified contractPartial

Collector

Address0x7bcc4e74441cd739e60b9c41f5c9ebfd6f9a8c87
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.4.23

 

Same code

1,815 more contracts

 

Details

Compiler
solc 0.4.23+commit.124ca40d
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
20,475,495
Creation transaction
0xa2d8191532…68b3fa48ac
Main copy (most transactions)
0xc87af16c…efb1dec5

Collector.sol

// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.23;

contract ERC20 {
    function balanceOf(address _owner) public view returns (uint256);
    function transfer(address _to, uint256 _value) public returns (bool);
}

contract Collector {
    address public owner;
    address public beneficiary;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event Released(uint256 amount);

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

    function collect(address _token) public {
        uint256 balance = ERC20(_token).balanceOf(this);
        require(balance > 0);
        ERC20(_token).transfer(beneficiary, balance);
        emit Released(balance);
    }

    function balanceOf(address _token) public view returns (uint256) {
        require(_token != address(0));
        return ERC20(_token).balanceOf(this);
    }

    function changeBeneficiary(address _beneficiary) public onlyOwner {
        beneficiary = _beneficiary;
    }

    function transferOwnership(address _newOwner) public onlyOwner {
        require(_newOwner != address(0));
        emit OwnershipTransferred(owner, _newOwner);
        owner = _newOwner;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.