Skip to content
Verified contractPartial

Forwarder

Address0xecab2ea480b1494fddd6477d179c4934950cbad6
Balance

0 ETH

 

Transactions

276

 

Compiler

solc 0.4.18

 

Same code

7 more contracts

 

Details

Compiler
solc 0.4.18+commit.9cf6e910
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
5,416,388
Creation transaction
0x2edfa9c0b0…ec413804ab

Forwarder.sol

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

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

contract Forwarder {
    address public destinationAddress;

    event LogForward(address indexed from, address indexed to, address indexed token, uint256 value);

    function Forwarder(address _destinationAddress) {
        destinationAddress = _destinationAddress;
    }

    function () payable {
        if (msg.value > 0) {
            assert(destinationAddress.send(msg.value));
            LogForward(this, destinationAddress, 0, msg.value);
        }
    }

    function forwardTokens(address _token) {
        uint256 balance = ERC20(_token).balanceOf(this);
        assert(ERC20(_token).transfer(destinationAddress, balance));
        LogForward(this, destinationAddress, _token, balance);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.