Contract 0x271901c3268D0959bbc9543DE4f073D3708C88F7 1
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x2f7e8d952d7d825b5b9749cc481504f9162c56f52a79d490d1fa9d6cebc1ab4b | 0x60a06040 | 3347081 | 779 days 14 hrs ago | 0x294cb241ebf6fe95bbb76071c7cda8dd62eb138e | IN | Create: OptimisticTreasury | 0 ETH | 0.008103673909 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
OptimisticTreasury
Compiler Version
v0.7.5+commit.eb77ed08
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "./Proprietor.sol"; /** * @title TCAP Treasury * @author Cryptex.finance * @notice This contract will hold the assets generated on L2 networks. */ contract ITreasury is Proprietor { /// @notice An event emitted when a transaction is executed event TransactionExecuted( address indexed target, uint256 value, string signature, bytes data ); /** * @notice Constructor * @param _owner the owner of the contract */ constructor(address _owner) Proprietor(_owner) {} /** * @notice Allows the owner to execute custom transactions * @param target address * @param value uint256 * @param signature string * @param data bytes * @dev Only owner can call it */ function executeTransaction( address target, uint256 value, string memory signature, bytes memory data ) external payable onlyOwner returns (bytes memory) { bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } require( target != address(0), "ITreasury::executeTransaction: target can't be zero" ); // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value : value}(callData); require( success, "ITreasury::executeTransaction: Transaction execution reverted." ); emit TransactionExecuted(target, value, signature, data); (target, value, signature, data); return returnData; } /** * @notice Retrieves the eth stuck on the treasury * @param _to address * @dev Only owner can call it */ function retrieveETH(address _to) external onlyOwner { require( _to != address(0), "ITreasury::retrieveETH: address can't be zero" ); uint256 amount = address(this).balance; payable(_to).transfer(amount); } /// @notice Allows the contract to receive ETH receive() external payable {} }
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Proprietor { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor (address _owner) { require(_owner != address(0), "Proprietor::constructor: address can't be zero"); owner = _owner; emit OwnershipTransferred(address(0), owner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() virtual { require(owner == msg.sender, "Proprietor: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(owner, address(0)); owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Proprietor: new owner is the zero address"); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; import "../ITreasury.sol"; import "./iOVM_CrossDomainMessenger.sol"; /** * @title TCAP Optimistic Treasury * @author Cryptex.finance * @notice This contract will hold the assets generated by the optimism network. */ contract OptimisticTreasury is ITreasury { /// @notice Address of the optimistic ovmL2CrossDomainMessenger contract. iOVM_CrossDomainMessenger public immutable ovmL2CrossDomainMessenger; /** * @notice Constructor * @param _owner the owner of the contract * @param _ovmL2CrossDomainMessenger address of the optimism ovmL2CrossDomainMessenger */ constructor( address _owner, address _ovmL2CrossDomainMessenger ) ITreasury(_owner) { require( _ovmL2CrossDomainMessenger != address(0), "OptimisticTreasury::constructor: address can't be zero" ); ovmL2CrossDomainMessenger = iOVM_CrossDomainMessenger(_ovmL2CrossDomainMessenger); } // @notice Throws if called by an account different from the owner // @dev call needs to come from ovmL2CrossDomainMessenger modifier onlyOwner() override { require( msg.sender == address(ovmL2CrossDomainMessenger) && ovmL2CrossDomainMessenger.xDomainMessageSender() == owner, "OptimisticTreasury: caller is not the owner" ); _; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; pragma experimental ABIEncoderV2; /** * @title iOVM_CrossDomainMessenger */ interface iOVM_CrossDomainMessenger { /********** * Events * **********/ event SentMessage(bytes message); event RelayedMessage(bytes32 msgHash); event FailedRelayedMessage(bytes32 msgHash); /************* * Variables * *************/ function xDomainMessageSender() external view returns (address); /******************** * Public Functions * ********************/ /** * Sends a cross domain message to the target messenger. * @param _target Target contract address. * @param _message Message to send to the target. * @param _gasLimit Gas limit for the provided message. */ function sendMessage( address _target, bytes calldata _message, uint32 _gasLimit ) external; }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_ovmL2CrossDomainMessenger","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"string","name":"signature","type":"string"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"TransactionExecuted","type":"event"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"string","name":"signature","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"executeTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"ovmL2CrossDomainMessenger","outputs":[{"internalType":"contract iOVM_CrossDomainMessenger","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"retrieveETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a060405234801561001057600080fd5b50604051610ec9380380610ec98339818101604052604081101561003357600080fd5b50805160209091015181806001600160a01b0381166100835760405162461bcd60e51b815260040180806020018281038252602e815260200180610e9b602e913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383811691909117808355604051911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350506001600160a01b0381166101165760405162461bcd60e51b8152600401808060200182810382526036815260200180610e656036913960400191505060405180910390fd5b606081901b6001600160601b0319166080526001600160a01b03169050610cf3610172600039806102ea5280610331528061048952806104d0528061087a52806108a752806108ee5280610a1b5280610a625250610cf36000f3fe6080604052600436106100595760003560e01c806310a76fb1146100655780632224fa251461009a5780634413977814610251578063715018a6146102825780638da5cb5b14610297578063f2fde38b146102ac57610060565b3661006057005b600080fd5b34801561007157600080fd5b506100986004803603602081101561008857600080fd5b50356001600160a01b03166102df565b005b6101dc600480360360808110156100b057600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100e057600080fd5b8201836020820111156100f257600080fd5b8035906020019184600183028401116401000000008311171561011457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561016757600080fd5b82018360208201111561017957600080fd5b8035906020019184600183028401116401000000008311171561019b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061047c945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102165781810151838201526020016101fe565b50505050905090810190601f1680156102435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025d57600080fd5b50610266610878565b604080516001600160a01b039092168252519081900360200190f35b34801561028e57600080fd5b5061009861089c565b3480156102a357600080fd5b50610266610a01565b3480156102b857600080fd5b50610098600480360360208110156102cf57600080fd5b50356001600160a01b0316610a10565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156103bf575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561038857600080fd5b505afa15801561039c573d6000803e3d6000fd5b505050506040513d60208110156103b257600080fd5b50516001600160a01b0316145b6103fa5760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b6001600160a01b03811661043f5760405162461bcd60e51b815260040180806020018281038252602d815260200180610c33602d913960400191505060405180910390fd5b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610477573d6000803e3d6000fd5b505050565b6060336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561055e575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561052757600080fd5b505afa15801561053b573d6000803e3d6000fd5b505050506040513d602081101561055157600080fd5b50516001600160a01b0316145b6105995760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b60608351600014156105ac57508161062f565b83805190602001208360405160200180836001600160e01b031916815260040182805190602001908083835b602083106105f75780518252601f1990920191602091820191016105d8565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b6001600160a01b0386166106745760405162461bcd60e51b8152600401808060200182810382526033815260200180610c606033913960400191505060405180910390fd5b60006060876001600160a01b031687846040518082805190602001908083835b602083106106b35780518252601f199092019160209182019101610694565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610715576040519150601f19603f3d011682016040523d82523d6000602084013e61071a565b606091505b50915091508161075b5760405162461bcd60e51b815260040180806020018281038252603e815260200180610bcc603e913960400191505060405180910390fd5b876001600160a01b03167f02351f450e2fc766dda692922cd0e080a07d702d68757f2154bf686ee052be6e888888604051808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156107d05781810151838201526020016107b8565b50505050905090810190601f1680156107fd5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015610830578181015183820152602001610818565b50505050905090810190601f16801561085d5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a2979650505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561097c575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561094557600080fd5b505afa158015610959573d6000803e3d6000fd5b505050506040513d602081101561096f57600080fd5b50516001600160a01b0316145b6109b75760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031681565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610af0575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610ab957600080fd5b505afa158015610acd573d6000803e3d6000fd5b505050506040513d6020811015610ae357600080fd5b50516001600160a01b0316145b610b2b5760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b6001600160a01b038116610b705760405162461bcd60e51b8152600401808060200182810382526029815260200180610c0a6029913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4954726561737572793a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e50726f70726965746f723a206e6577206f776e657220697320746865207a65726f20616464726573734954726561737572793a3a72657472696576654554483a20616464726573732063616e2774206265207a65726f4954726561737572793a3a657865637574655472616e73616374696f6e3a207461726765742063616e2774206265207a65726f4f7074696d697374696354726561737572793a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122074b269e972af771488b6e3c7cec8bb96db0be42601fc72fcb6058bca8efe876d64736f6c634300070500334f7074696d697374696354726561737572793a3a636f6e7374727563746f723a20616464726573732063616e2774206265207a65726f50726f70726965746f723a3a636f6e7374727563746f723a20616464726573732063616e2774206265207a65726f000000000000000000000000a54074b2cc0e96a43048d4a68472f7f046ac0da80000000000000000000000004200000000000000000000000000000000000007
Deployed Bytecode
0x6080604052600436106100595760003560e01c806310a76fb1146100655780632224fa251461009a5780634413977814610251578063715018a6146102825780638da5cb5b14610297578063f2fde38b146102ac57610060565b3661006057005b600080fd5b34801561007157600080fd5b506100986004803603602081101561008857600080fd5b50356001600160a01b03166102df565b005b6101dc600480360360808110156100b057600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156100e057600080fd5b8201836020820111156100f257600080fd5b8035906020019184600183028401116401000000008311171561011457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561016757600080fd5b82018360208201111561017957600080fd5b8035906020019184600183028401116401000000008311171561019b57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061047c945050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102165781810151838201526020016101fe565b50505050905090810190601f1680156102435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025d57600080fd5b50610266610878565b604080516001600160a01b039092168252519081900360200190f35b34801561028e57600080fd5b5061009861089c565b3480156102a357600080fd5b50610266610a01565b3480156102b857600080fd5b50610098600480360360208110156102cf57600080fd5b50356001600160a01b0316610a10565b336001600160a01b037f0000000000000000000000004200000000000000000000000000000000000007161480156103bf575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000076001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561038857600080fd5b505afa15801561039c573d6000803e3d6000fd5b505050506040513d60208110156103b257600080fd5b50516001600160a01b0316145b6103fa5760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b6001600160a01b03811661043f5760405162461bcd60e51b815260040180806020018281038252602d815260200180610c33602d913960400191505060405180910390fd5b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610477573d6000803e3d6000fd5b505050565b6060336001600160a01b037f00000000000000000000000042000000000000000000000000000000000000071614801561055e575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000076001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561052757600080fd5b505afa15801561053b573d6000803e3d6000fd5b505050506040513d602081101561055157600080fd5b50516001600160a01b0316145b6105995760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b60608351600014156105ac57508161062f565b83805190602001208360405160200180836001600160e01b031916815260040182805190602001908083835b602083106105f75780518252601f1990920191602091820191016105d8565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b6001600160a01b0386166106745760405162461bcd60e51b8152600401808060200182810382526033815260200180610c606033913960400191505060405180910390fd5b60006060876001600160a01b031687846040518082805190602001908083835b602083106106b35780518252601f199092019160209182019101610694565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610715576040519150601f19603f3d011682016040523d82523d6000602084013e61071a565b606091505b50915091508161075b5760405162461bcd60e51b815260040180806020018281038252603e815260200180610bcc603e913960400191505060405180910390fd5b876001600160a01b03167f02351f450e2fc766dda692922cd0e080a07d702d68757f2154bf686ee052be6e888888604051808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156107d05781810151838201526020016107b8565b50505050905090810190601f1680156107fd5780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b83811015610830578181015183820152602001610818565b50505050905090810190601f16801561085d5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a2979650505050505050565b7f000000000000000000000000420000000000000000000000000000000000000781565b336001600160a01b037f00000000000000000000000042000000000000000000000000000000000000071614801561097c575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000076001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b15801561094557600080fd5b505afa158015610959573d6000803e3d6000fd5b505050506040513d602081101561096f57600080fd5b50516001600160a01b0316145b6109b75760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031681565b336001600160a01b037f000000000000000000000000420000000000000000000000000000000000000716148015610af0575060008054906101000a90046001600160a01b03166001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000076001600160a01b0316636e296e456040518163ffffffff1660e01b815260040160206040518083038186803b158015610ab957600080fd5b505afa158015610acd573d6000803e3d6000fd5b505050506040513d6020811015610ae357600080fd5b50516001600160a01b0316145b610b2b5760405162461bcd60e51b815260040180806020018281038252602b815260200180610c93602b913960400191505060405180910390fd5b6001600160a01b038116610b705760405162461bcd60e51b8152600401808060200182810382526029815260200180610c0a6029913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4954726561737572793a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e50726f70726965746f723a206e6577206f776e657220697320746865207a65726f20616464726573734954726561737572793a3a72657472696576654554483a20616464726573732063616e2774206265207a65726f4954726561737572793a3a657865637574655472616e73616374696f6e3a207461726765742063616e2774206265207a65726f4f7074696d697374696354726561737572793a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122074b269e972af771488b6e3c7cec8bb96db0be42601fc72fcb6058bca8efe876d64736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a54074b2cc0e96a43048d4a68472f7f046ac0da80000000000000000000000004200000000000000000000000000000000000007
-----Decoded View---------------
Arg [0] : _owner (address): 0xa54074b2cc0e96a43048d4a68472F7F046aC0DA8
Arg [1] : _ovmL2CrossDomainMessenger (address): 0x4200000000000000000000000000000000000007
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a54074b2cc0e96a43048d4a68472f7f046ac0da8
Arg [1] : 0000000000000000000000004200000000000000000000000000000000000007
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.