Verified contractPartial
Forwarder
Address0x3fc2dd3741b6f3be5031ab8e48ffa2837d6bd655
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.4.24
- Same code
2,499 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,767,937
- Creation transaction
- 0xc57c8ebf83…7e5d5bde52
- Main copy (most transactions)
- 0x75ef6e83…9c72420c
2 files
- Forwarder.solmain478 B
- DelegateProxy.sol1.08 KB
Forwarder.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.4.18;
import "./DelegateProxy.sol";
contract Forwarder is DelegateProxy {
// After compiling contract, `beefbeef...` is replaced in the bytecode by the real target address
address public constant target = 0x92268D9c15657F14c9b0D551b97e260467DBe585; // checksumed to silence warning
/*
* @dev Forwards all calls to target
*/
function() payable {
delegatedFwd(target, msg.data);
}
}DelegateProxy.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.4.18;
contract DelegateProxy {
/**
* @dev Performs a delegatecall and returns whatever the delegatecall returned (entire context execution will return!)
* @param _dst Destination address to perform the delegatecall
* @param _calldata Calldata for the delegatecall
*/
function delegatedFwd(address _dst, bytes _calldata) internal {
require(isContract(_dst));
assembly {
let result := delegatecall(sub(gas, 10000), _dst, add(_calldata, 0x20), mload(_calldata), 0, 0)
let size := returndatasize
let ptr := mload(0x40)
returndatacopy(ptr, 0, size)
// revert instead of invalid() bc if the underlying call failed with invalid() it already wasted gas.
// if the call returned error data, forward it
switch result case 0 {revert(ptr, size)}
default {return (ptr, size)}
}
}
function isContract(address _target) internal view returns (bool) {
uint256 size;
assembly {size := extcodesize(_target)}
return size > 0;
}
}Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.