Skip to content
Verified contractPartial

Forwarder

Address0xcc242ffc747cd007963c9f28cea02ec1e4f37d81
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.4.24

 

Same code

1,011 more contracts

 

Details

Compiler
solc 0.4.24+commit.e67f0147
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
7,279,216
Creation transaction
0xae15a0bd63…73e4b33836
Main copy (most transactions)
0xc899fe53…7d79777e

Forwarder.sol

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

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

contract Forwarder {
    address public parentAddress;
    event ForwarderDeposited(address from, uint value, bytes data);

    constructor() public {
        parentAddress = msg.sender;
    }

    modifier onlyParent {
        if (msg.sender != parentAddress) {
            revert();
        }
        _;
    }

    function() payable {
        parentAddress.transfer(msg.value);
        emit ForwarderDeposited(msg.sender, msg.value, msg.data);
    }

    function flushTokens(address tokenContractAddress) onlyParent {
        ERC20Interface instance = ERC20Interface(tokenContractAddress);
        var forwarderAddress = address(this);
        var forwarderBalance = instance.balanceOf(forwarderAddress);
        if (forwarderBalance == 0) {
            return;
        }
        if (!instance.transfer(parentAddress, forwarderBalance)) {
            revert();
        }
    }

    function flush() {
        parentAddress.transfer(this.balance);
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.