Verified contractPartial
Forwarder
Address0x2dd960d91cd4d56c97fc9f5e78270abacaacf1ef
- Balance
0 ETH
- Transactions
10
- Compiler
solc 0.4.24
- Same code
178 more contracts
Details
- Compiler
- solc 0.4.24+commit.e67f0147
- Language
- solidity
- Optimization
- No
- EVM version
- byzantium
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 7,785,855
- Creation transaction
- 0x629579d3d3…5c09f4a372
- Main copy (most transactions)
- 0xf8d7e96b…af6380ae
2 files
- Forwarder.solmain420 B
- DelegateProxy.sol1.02 KB
Forwarder.sol
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 = 0x1ed7fc52ac5a37aa3ff6d9b94c894724e2f992b1; // checksumed to silence warning
/*
* @dev Forwards all calls to target
*/
function() payable {
delegatedFwd(target, msg.data);
}
}DelegateProxy.sol
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
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
},
"evmVersion": "byzantium",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.