Verified contractPartial
Forwarder
Address0xc7f7e13480dc8e921e09d330ee3f91133c729ded
- Balance
0 ETH
- Transactions
2,454
- Compiler
solc 0.4.24
- Same code
166 more contracts
Details
- Compiler
- solc 0.4.24+commit.e67f0147
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: no, runtime code: yes
- Verified on Sourcify
- Created in block
- 6,738,556
- Creation transaction
- 0x3907fe6965…4a87fe6592
Forwarder.sol
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.24;
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner());
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Registry {
function getTargetAddress() public returns (address);
}
contract ERC20 {
function transfer(address to, uint256 value) public returns (bool);
}
contract Forwarder is Ownable {
Registry private registry;
event EthForwarded(address indexed from, address indexed to, uint256 value);
function () external payable {
address target = registry.getTargetAddress();
target.transfer(msg.value);
emit EthForwarded(msg.sender, target, msg.value);
}
function transferETH(address to, uint256 amount) public onlyOwner returns (bool) {
to.transfer(amount);
return true;
}
function transferTokens(address token, uint256 amount) public {
address target = registry.getTargetAddress();
ERC20 t = ERC20(token);
require(t.transfer(target, amount), "Token transfer has failed");
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.