creation_sourcecode: {"iAbs_BaseCrossDomainMessenger.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity \u003e0.5.0 \u003c0.8.0;\npragma experimental ABIEncoderV2;\n\n/**\n * @title iAbs_BaseCrossDomainMessenger\n */\ninterface iAbs_BaseCrossDomainMessenger {\n    /**********\n     * Events *\n     **********/\n\n    event SentMessage(bytes message);\n    event RelayedMessage(bytes32 msgHash);\n    event FailedRelayedMessage(bytes32 msgHash);\n\n    /*************\n     * Variables *\n     *************/\n\n    function xDomainMessageSender() external view returns (address);\n\n    /********************\n     * Public Functions *\n     ********************/\n\n    /**\n     * Sends a cross domain message to the target messenger.\n     * @param _target Target contract address.\n     * @param _message Message to send to the target.\n     * @param _gasLimit Gas limit for the provided message.\n     */\n    function sendMessage(\n        address _target,\n        bytes calldata _message,\n        uint32 _gasLimit\n    ) external;\n}\n"},"Owned.sol":{"content":"pragma solidity ^0.5.16;\n\n/**\n * @title The Owned contract\n * @notice A contract with helpers for basic contract ownership.\n */\ncontract Owned {\n    address payable public owner;\n    address private pendingOwner;\n\n    event OwnershipTransferRequested(address indexed from, address indexed to);\n    event OwnershipTransferred(address indexed from, address indexed to);\n\n    constructor(address payable _owner) public {\n        owner = _owner;\n    }\n\n    /**\n     * @dev Allows an owner to begin transferring ownership to a new address,\n     * pending.\n     */\n    function transferOwnership(address _to) external onlyOwner {\n        pendingOwner = _to;\n\n        emit OwnershipTransferRequested(owner, _to);\n    }\n\n    /**\n     * @dev Allows an ownership transfer to be completed by the recipient.\n     */\n    function acceptOwnership() external {\n        require(msg.sender == pendingOwner, \"Must be proposed owner\");\n\n        address oldOwner = owner;\n        owner = msg.sender;\n        pendingOwner = address(0);\n\n        emit OwnershipTransferred(oldOwner, msg.sender);\n    }\n\n    /**\n     * @dev Reverts if called by anyone other than the contract owner.\n     */\n    modifier onlyOwner() {\n        require(msg.sender == owner, \"Only callable by owner\");\n        _;\n    }\n}\n"},"OwnerRelayOnEthereum.sol":{"content":"pragma solidity ^0.5.16;\npragma experimental ABIEncoderV2;\n\nimport \"./Owned.sol\";\nimport \"./iAbs_BaseCrossDomainMessenger.sol\";\n\ninterface IOwnerRelayOnOptimism {\n    function finalizeRelay(address target, bytes calldata payload) external;\n\n    function finalizeRelayBatch(\n        address[] calldata target,\n        bytes[] calldata payloads\n    ) external;\n}\n\ncontract OwnerRelayOnEthereum is Owned {\n    address public constant extMessenger =\n        0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1;\n    address public optimismRelay;\n\n    constructor(address payable _owner) public Owned(_owner) {}\n\n    function _messenger() private pure returns (iAbs_BaseCrossDomainMessenger) {\n        return iAbs_BaseCrossDomainMessenger(extMessenger);\n    }\n\n    function _ownerRelayOnOptimism() private view returns (address) {\n        return optimismRelay;\n    }\n\n    /* ========== RESTRICTED ========== */\n\n    function initiateRelay(\n        address target,\n        bytes calldata payload,\n        uint32 crossDomainGasLimit\n    ) external onlyOwner {\n        IOwnerRelayOnOptimism ownerRelayOnOptimism;\n        bytes memory messageData = abi.encodeWithSelector(\n            ownerRelayOnOptimism.finalizeRelay.selector,\n            target,\n            payload\n        );\n\n        _messenger().sendMessage(\n            _ownerRelayOnOptimism(),\n            messageData,\n            crossDomainGasLimit\n        );\n\n        emit RelayInitiated(target, payload);\n    }\n\n    function initiateRelayBatch(\n        address[] calldata targets,\n        bytes[] calldata payloads,\n        uint32 crossDomainGasLimit\n    ) external onlyOwner {\n        // First check that the length of the arguments match\n        require(targets.length == payloads.length, \"Argument length mismatch\");\n\n        IOwnerRelayOnOptimism ownerRelayOnOptimism;\n        bytes memory messageData = abi.encodeWithSelector(\n            ownerRelayOnOptimism.finalizeRelayBatch.selector,\n            targets,\n            payloads\n        );\n\n        _messenger().sendMessage(\n            _ownerRelayOnOptimism(),\n            messageData,\n            crossDomainGasLimit\n        );\n\n        emit RelayBatchInitiated(targets, payloads);\n    }\n\n    function setOptimismRelayAddress(address _relay) external onlyOwner {\n        optimismRelay = _relay;\n    }\n\n    /* ========== EVENTS ========== */\n\n    event RelayInitiated(address target, bytes payload);\n    event RelayBatchInitiated(address[] targets, bytes[] payloads);\n}\n"}}