Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Read Proxy
Write Contract
Write Proxy
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- ControllerDelegator
- Optimization enabled
- true
- Compiler version
- v0.7.6+commit.7338295f
- Optimization runs
- 200
- Verified at
- 2022-03-31T12:17:35.133644Z
Constructor Arguments
0000000000000000000000001ccca1ce62c62f7be95d4a67722a8fdbed6eecb4000000000000000000000000c7ff25ad08aa8ea665cf78532f7317067cffb2900000000000000000000000004446fc4eb47f2f6586f9faab68b3498f86c0752100000000000000000000000015d530e620da0bacddbdea7fb37eaaabb4ae1d070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c2e51ab824cc088cb5253e74963b00a15be7d2340000000000000000000000000000000000000000000000000000000000000120000000000000000000000000ad0bfa476fb71215ba026ebe60ffa9b31d98efe700000000000000000000000001af643dd8dd41ed1f1066fac465cc8bfc52d6eb00000000000000000000000000000000000000000000000000000000000000010d00000000000000000000000000000000000000000000000000000000000000
Arg [0] (address) : 0x1ccca1ce62c62f7be95d4a67722a8fdbed6eecb4
Arg [1] (address) : 0xc7ff25ad08aa8ea665cf78532f7317067cffb290
Arg [2] (address) : 0x4446fc4eb47f2f6586f9faab68b3498f86c07521
Arg [3] (address) : 0x15d530e620da0bacddbdea7fb37eaaabb4ae1d07
Arg [4] (address) : 0x0000000000000000000000000000000000000000
Arg [5] (address) : 0xc2e51ab824cc088cb5253e74963b00a15be7d234
Arg [6] (bytes) : 0d
Arg [7] (address) : 0xad0bfa476fb71215ba026ebe60ffa9b31d98efe7
Arg [8] (address) : 0x01af643dd8dd41ed1f1066fac465cc8bfc52d6eb
project:/contracts/ControllerDelegator.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; import "./Adminable.sol"; import "./DelegatorInterface.sol"; contract ControllerDelegator is DelegatorInterface, Adminable { constructor(address _oleToken, address _xoleToken, address _wETH, address _lpoolImplementation, address _openlev, address _dexAggregator, bytes memory _oleWethDexData, address payable admin_, address implementation_) { admin = msg.sender; // Creator of the contract is admin during initialization // First delegate gets to initialize the delegator (i.e. storage contract) delegateTo(implementation_, abi.encodeWithSignature("initialize(address,address,address,address,address,address,bytes)", _oleToken, _xoleToken, _wETH, _lpoolImplementation, _openlev, _dexAggregator, _oleWethDexData )); implementation = implementation_; // Set the proper admin now that initialization is done admin = admin_; } /** * Called by the admin to update the implementation of the delegator * @param implementation_ The address of the new implementation for delegation */ function setImplementation(address implementation_) public override onlyAdmin { address oldImplementation = implementation; implementation = implementation_; emit NewImplementation(oldImplementation, implementation); } }
project:/contracts/Adminable.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; abstract contract Adminable { address payable public admin; address payable public pendingAdmin; address payable public developer; event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin); event NewAdmin(address oldAdmin, address newAdmin); constructor () { developer = msg.sender; } modifier onlyAdmin() { require(msg.sender == admin, "caller must be admin"); _; } modifier onlyAdminOrDeveloper() { require(msg.sender == admin || msg.sender == developer, "caller must be admin or developer"); _; } function setPendingAdmin(address payable newPendingAdmin) external virtual onlyAdmin { // Save current value, if any, for inclusion in log address oldPendingAdmin = pendingAdmin; // Store pendingAdmin with value newPendingAdmin pendingAdmin = newPendingAdmin; // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin) emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin); } function acceptAdmin() external virtual { require(msg.sender == pendingAdmin, "only pendingAdmin can accept admin"); // Save current values for inclusion in log address oldAdmin = admin; address oldPendingAdmin = pendingAdmin; // Store admin with value pendingAdmin admin = pendingAdmin; // Clear the pending value pendingAdmin = address(0); emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); } }
project:/contracts/DelegatorInterface.sol
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.6; abstract contract DelegatorInterface { /** * Implementation address for this contract */ address public implementation; /** * Emitted when implementation is changed */ event NewImplementation(address oldImplementation, address newImplementation); /** * Called by the admin to update the implementation of the delegator * @param implementation_ The address of the new implementation for delegation */ function setImplementation(address implementation_) public virtual; /** * Internal method to delegate execution to another contract * @dev It returns to the external caller whatever the implementation returns or forwards reverts * @param callee The contract to delegatecall * @param data The raw data to delegatecall * @return The returned bytes from the delegatecall */ function delegateTo(address callee, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returnData) = callee.delegatecall(data); assembly { if eq(success, 0) {revert(add(returnData, 0x20), returndatasize())} } return returnData; } /** * Delegates execution to the implementation contract * @dev It returns to the external caller whatever the implementation returns or forwards reverts * @param data The raw data to delegatecall * @return The returned bytes from the delegatecall */ function delegateToImplementation(bytes memory data) public returns (bytes memory) { return delegateTo(implementation, data); } /** * Delegates execution to an implementation contract * @dev It returns to the external caller whatever the implementation returns or forwards reverts * There are an additional 2 prefix uints from the wrapper returndata, which we ignore since we make an extra hop. * @param data The raw data to delegatecall * @return The returned bytes from the delegatecall */ function delegateToViewImplementation(bytes memory data) public view returns (bytes memory) { (bool success, bytes memory returnData) = address(this).staticcall(abi.encodeWithSignature("delegateToImplementation(bytes)", data)); assembly { if eq(success, 0) {revert(add(returnData, 0x20), returndatasize())} } return abi.decode(returnData, (bytes)); } /** * Delegates execution to an implementation contract * @dev It returns to the external caller whatever the implementation returns or forwards reverts */ fallback() external payable { _fallback(); } receive() external payable { _fallback(); } function _fallback() internal { // delegate all other functions to current implementation if (msg.data.length > 0) { (bool success,) = implementation.delegatecall(msg.data); assembly { let free_mem_ptr := mload(0x40) returndatacopy(free_mem_ptr, 0, returndatasize()) switch success case 0 {revert(free_mem_ptr, returndatasize())} default {return (free_mem_ptr, returndatasize())} } } } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_oleToken","internalType":"address"},{"type":"address","name":"_xoleToken","internalType":"address"},{"type":"address","name":"_wETH","internalType":"address"},{"type":"address","name":"_lpoolImplementation","internalType":"address"},{"type":"address","name":"_openlev","internalType":"address"},{"type":"address","name":"_dexAggregator","internalType":"address"},{"type":"bytes","name":"_oleWethDexData","internalType":"bytes"},{"type":"address","name":"admin_","internalType":"address payable"},{"type":"address","name":"implementation_","internalType":"address"}]},{"type":"event","name":"NewAdmin","inputs":[{"type":"address","name":"oldAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NewImplementation","inputs":[{"type":"address","name":"oldImplementation","internalType":"address","indexed":false},{"type":"address","name":"newImplementation","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NewPendingAdmin","inputs":[{"type":"address","name":"oldPendingAdmin","internalType":"address","indexed":false},{"type":"address","name":"newPendingAdmin","internalType":"address","indexed":false}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"acceptAdmin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"admin","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"delegateToImplementation","inputs":[{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"delegateToViewImplementation","inputs":[{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"developer","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"implementation","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"pendingAdmin","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setImplementation","inputs":[{"type":"address","name":"implementation_","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPendingAdmin","inputs":[{"type":"address","name":"newPendingAdmin","internalType":"address payable"}]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x608060405234801561001057600080fd5b50604051610d39380380610d39833981810160405261012081101561003457600080fd5b815160208301516040808501516060860151608087015160a088015160c0890180519551979996989497939692959194830192918464010000000082111561007b57600080fd5b90830190602082018581111561009057600080fd5b82516401000000008111828201881017156100aa57600080fd5b82525081516020918201929091019080838360005b838110156100d75781810151838201526020016100bf565b50505050905090810190601f1680156101045780820380516001836020036101000a031916815260200191505b506040818152602083810151939091015160038054336001600160a01b031991821681179092556001805490911690911790556001600160a01b038d8116602485019081528d821660448601528c821660648601528b821660848601528a821660a486015290891660c485015260e060e48501908152885161010486015288519597509195506102359486948f948f948f948f948f948f948f9492610124909201919085019080838360005b838110156101c85781810151838201526020016101b0565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b0390811663256886bb60e21b1790915290995061027216975050505050505050565b50600080546001600160a01b039283166001600160a01b031991821617909155600180549390921692169190911790555061033395505050505050565b6060600080846001600160a01b0316846040518082805190602001908083835b602083106102b15780518252601f199092019160209182019101610292565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610311576040519150601f19603f3d011682016040523d82523d6000602084013e610316565b606091505b5091509150600082141561032b573d60208201fd5b949350505050565b6109f7806103426000396000f3fe60806040526004361061008a5760003560e01c80634dd18bf5116100595780634dd18bf5146102c25780635c60da1b146102f5578063ca4b208b1461030a578063d784d4261461031f578063f851a4401461035257610099565b80630933c1ed146100a15780630e18b681146101c957806326782247146101de5780634487152f1461020f57610099565b3661009957610097610367565b005b610097610367565b3480156100ad57600080fd5b50610154600480360360208110156100c457600080fd5b8101906020810181356401000000008111156100df57600080fd5b8201836020820111156100f157600080fd5b8035906020019184600183028401116401000000008311171561011357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506103f2945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018e578181015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b50610097610411565b3480156101ea57600080fd5b506101f3610511565b604080516001600160a01b039092168252519081900360200190f35b34801561021b57600080fd5b506101546004803603602081101561023257600080fd5b81019060208101813564010000000081111561024d57600080fd5b82018360208201111561025f57600080fd5b8035906020019184600183028401116401000000008311171561028157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610520945050505050565b3480156102ce57600080fd5b50610097600480360360208110156102e557600080fd5b50356001600160a01b0316610740565b34801561030157600080fd5b506101f36107f9565b34801561031657600080fd5b506101f3610808565b34801561032b57600080fd5b506100976004803603602081101561034257600080fd5b50356001600160a01b0316610817565b34801561035e57600080fd5b506101f36108cf565b36156103f057600080546040516001600160a01b0390911690829036908083838082843760405192019450600093509091505080830381855af49150503d80600081146103d0576040519150601f19603f3d011682016040523d82523d6000602084013e6103d5565b606091505b505090506040513d6000823e8180156103ec573d82f35b3d82fd5b565b60005460609061040b906001600160a01b0316836108de565b92915050565b6002546001600160a01b0316331461045a5760405162461bcd60e51b81526004018080602001828103825260228152602001806109a06022913960400191505060405180910390fd5b60018054600280546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600254604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a15050565b6002546001600160a01b031681565b6060600080306001600160a01b0316846040516024018080602001828103825283818151815260200191508051906020019080838360005b83811015610570578181015183820152602001610558565b50505050905090810190601f16801561059d5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b0316630933c1ed60e01b178152905182519295509350839250908083835b602083106105f85780518252601f1990920191602091820191016105d9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114610658576040519150601f19603f3d011682016040523d82523d6000602084013e61065d565b606091505b50915091506000821415610672573d60208201fd5b80806020019051602081101561068757600080fd5b81019080805160405193929190846401000000008211156106a757600080fd5b9083019060208201858111156106bc57600080fd5b82516401000000008111828201881017156106d657600080fd5b82525081516020918201929091019080838360005b838110156107035781810151838201526020016106eb565b50505050905090810190601f1680156107305780820380516001836020036101000a031916815260200191505b5060405250505092505050919050565b6001546001600160a01b03163314610796576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a15050565b6000546001600160a01b031681565b6003546001600160a01b031681565b6001546001600160a01b0316331461086d576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b0319831617928390556040805192821680845293909116602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a15050565b6001546001600160a01b031681565b6060600080846001600160a01b0316846040518082805190602001908083835b6020831061091d5780518252601f1990920191602091820191016108fe565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461097d576040519150601f19603f3d011682016040523d82523d6000602084013e610982565b606091505b50915091506000821415610997573d60208201fd5b94935050505056fe6f6e6c792070656e64696e6741646d696e2063616e206163636570742061646d696ea264697066735822122081b5062c1561766f23bbb7aa5e79200064f2f61b81dde766099db196b2a8bfd664736f6c634300070600330000000000000000000000001ccca1ce62c62f7be95d4a67722a8fdbed6eecb4000000000000000000000000c7ff25ad08aa8ea665cf78532f7317067cffb2900000000000000000000000004446fc4eb47f2f6586f9faab68b3498f86c0752100000000000000000000000015d530e620da0bacddbdea7fb37eaaabb4ae1d070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c2e51ab824cc088cb5253e74963b00a15be7d2340000000000000000000000000000000000000000000000000000000000000120000000000000000000000000ad0bfa476fb71215ba026ebe60ffa9b31d98efe700000000000000000000000001af643dd8dd41ed1f1066fac465cc8bfc52d6eb00000000000000000000000000000000000000000000000000000000000000010d00000000000000000000000000000000000000000000000000000000000000
Deployed ByteCode
0x60806040526004361061008a5760003560e01c80634dd18bf5116100595780634dd18bf5146102c25780635c60da1b146102f5578063ca4b208b1461030a578063d784d4261461031f578063f851a4401461035257610099565b80630933c1ed146100a15780630e18b681146101c957806326782247146101de5780634487152f1461020f57610099565b3661009957610097610367565b005b610097610367565b3480156100ad57600080fd5b50610154600480360360208110156100c457600080fd5b8101906020810181356401000000008111156100df57600080fd5b8201836020820111156100f157600080fd5b8035906020019184600183028401116401000000008311171561011357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506103f2945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018e578181015183820152602001610176565b50505050905090810190601f1680156101bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d557600080fd5b50610097610411565b3480156101ea57600080fd5b506101f3610511565b604080516001600160a01b039092168252519081900360200190f35b34801561021b57600080fd5b506101546004803603602081101561023257600080fd5b81019060208101813564010000000081111561024d57600080fd5b82018360208201111561025f57600080fd5b8035906020019184600183028401116401000000008311171561028157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610520945050505050565b3480156102ce57600080fd5b50610097600480360360208110156102e557600080fd5b50356001600160a01b0316610740565b34801561030157600080fd5b506101f36107f9565b34801561031657600080fd5b506101f3610808565b34801561032b57600080fd5b506100976004803603602081101561034257600080fd5b50356001600160a01b0316610817565b34801561035e57600080fd5b506101f36108cf565b36156103f057600080546040516001600160a01b0390911690829036908083838082843760405192019450600093509091505080830381855af49150503d80600081146103d0576040519150601f19603f3d011682016040523d82523d6000602084013e6103d5565b606091505b505090506040513d6000823e8180156103ec573d82f35b3d82fd5b565b60005460609061040b906001600160a01b0316836108de565b92915050565b6002546001600160a01b0316331461045a5760405162461bcd60e51b81526004018080602001828103825260228152602001806109a06022913960400191505060405180910390fd5b60018054600280546001600160a01b038082166001600160a01b031980861682179687905590921690925560408051938316808552949092166020840152815190927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600254604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a15050565b6002546001600160a01b031681565b6060600080306001600160a01b0316846040516024018080602001828103825283818151815260200191508051906020019080838360005b83811015610570578181015183820152602001610558565b50505050905090810190601f16801561059d5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529181526020820180516001600160e01b0316630933c1ed60e01b178152905182519295509350839250908083835b602083106105f85780518252601f1990920191602091820191016105d9565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114610658576040519150601f19603f3d011682016040523d82523d6000602084013e61065d565b606091505b50915091506000821415610672573d60208201fd5b80806020019051602081101561068757600080fd5b81019080805160405193929190846401000000008211156106a757600080fd5b9083019060208201858111156106bc57600080fd5b82516401000000008111828201881017156106d657600080fd5b82525081516020918201929091019080838360005b838110156107035781810151838201526020016106eb565b50505050905090810190601f1680156107305780820380516001836020036101000a031916815260200191505b5060405250505092505050919050565b6001546001600160a01b03163314610796576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a15050565b6000546001600160a01b031681565b6003546001600160a01b031681565b6001546001600160a01b0316331461086d576040805162461bcd60e51b815260206004820152601460248201527331b0b63632b91036bab9ba1031329030b236b4b760611b604482015290519081900360640190fd5b600080546001600160a01b038381166001600160a01b0319831617928390556040805192821680845293909116602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a15050565b6001546001600160a01b031681565b6060600080846001600160a01b0316846040518082805190602001908083835b6020831061091d5780518252601f1990920191602091820191016108fe565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461097d576040519150601f19603f3d011682016040523d82523d6000602084013e610982565b606091505b50915091506000821415610997573d60208201fd5b94935050505056fe6f6e6c792070656e64696e6741646d696e2063616e206163636570742061646d696ea264697066735822122081b5062c1561766f23bbb7aa5e79200064f2f61b81dde766099db196b2a8bfd664736f6c63430007060033