creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/dev-contracts/SyncL2TxHashRelayer.sol": {
        "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.0;\n\nimport {IArbitrator} from \"../interfaces/IArbitrator.sol\";\nimport {IZkLink} from \"../interfaces/IZkLink.sol\";\n\ncontract SyncL2TxHashRelayer {\n    /// @dev The address of the arbitrator contract\n    IArbitrator public immutable ARBITRATOR;\n\n    constructor(IArbitrator _arbitrator) {\n        ARBITRATOR = _arbitrator;\n    }\n\n    function claimPrimaryChainSyncL2TxHashMessage(\n        address _sourceChainCanonicalMessageService,\n        bytes calldata _sourceChainClaimCallData,\n        address _secondaryChainL1Gateway,\n        bytes32 _secondaryChainL2TxHash,\n        bytes32 _primaryChainL2TxHash,\n        bytes calldata _forwardParams\n    ) external payable {\n        // Send l2 tx hash to secondary chain by gateway\n        bytes[] memory gatewayDataList = new bytes[](1);\n        bytes memory callData = abi.encodeCall(IZkLink.syncL2TxHash, (_secondaryChainL2TxHash, _primaryChainL2TxHash));\n        gatewayDataList[0] = abi.encode(_secondaryChainL1Gateway, 0, callData);\n\n        ARBITRATOR.claimMessage{value: msg.value}(\n            _sourceChainCanonicalMessageService,\n            _sourceChainClaimCallData,\n            ARBITRATOR.primaryChainGateway(),\n            0,\n            abi.encode(gatewayDataList),\n            _forwardParams\n        );\n    }\n}\n"
      },
      "contracts/interfaces/IArbitrator.sol": {
        "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\nimport {IL1Gateway} from \"./IL1Gateway.sol\";\n\ninterface IArbitrator {\n    /// @notice Return true if relayer is active\n    function isRelayerActive(address _relayer) external view returns (bool);\n\n    /// @notice Return the primary chain gateway\n    function primaryChainGateway() external view returns (IL1Gateway);\n\n    /// @notice Enqueue message from EthereumGateway\n    /// @dev Used by EthereumGateway to temporarily store message\n    /// @param _value The msg value\n    /// @param _callData The call data\n    function enqueueMessage(uint256 _value, bytes calldata _callData) external payable;\n\n    /// @notice Deliver message from one L1 gateway to another L1 gateway\n    /// @dev Used by L1Gateways to deliver message\n    /// @param _value The msg value\n    /// @param _callData The call data\n    function receiveMessage(uint256 _value, bytes calldata _callData) external payable;\n\n    /// @notice Forward message from one L1 gateway to another L1 gateway\n    /// @param _gateway The message source gateway\n    /// @param _value The msg value\n    /// @param _callData The call data\n    /// @param _adapterParams Some params need to call canonical message service\n    function forwardMessage(\n        IL1Gateway _gateway,\n        uint256 _value,\n        bytes calldata _callData,\n        bytes calldata _adapterParams\n    ) external payable;\n\n    /// @notice Claim a message of source chain and deliver it to the target chain\n    /// @param _sourceChainCanonicalMessageService The message service to claim message\n    /// @param _sourceChainClaimCallData The call data that need to claim message from source chain\n    /// @param _sourceChainL1Gateway The msg.sender passed in the `receiveMessage` interface\n    /// @param _receiveValue The value passed in the `receiveMessage` interface\n    /// @param _receiveCallData The call data passed in the `receiveMessage` interface\n    /// @param _forwardParams Some params need to call canonical message service of target chain\n    function claimMessage(\n        address _sourceChainCanonicalMessageService,\n        bytes calldata _sourceChainClaimCallData,\n        IL1Gateway _sourceChainL1Gateway,\n        uint256 _receiveValue,\n        bytes calldata _receiveCallData,\n        bytes calldata _forwardParams\n    ) external payable;\n}\n"
      },
      "contracts/interfaces/IGateway.sol": {
        "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\ninterface IGateway {\n    /// @return Remote gateway\n    function getRemoteGateway() external view returns (address);\n}\n"
      },
      "contracts/interfaces/IL1Gateway.sol": {
        "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity ^0.8.0;\n\nimport {IGateway} from \"./IGateway.sol\";\n\ninterface IL1Gateway is IGateway {\n    /// @notice Send message to remote gateway\n    /// @param _value The msg value\n    /// @param _callData The call data\n    /// @param _adapterParams Some params need to call canonical message service\n    function sendMessage(uint256 _value, bytes calldata _callData, bytes calldata _adapterParams) external payable;\n}\n"
      },
      "contracts/interfaces/IZkLink.sol": {
        "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.0;\n\n/// @title ZkLink interface contract\n/// @author zk.link\ninterface IZkLink {\n    /// @notice Send l2 requests sync status to primary chain\n    /// @param _newTotalSyncedPriorityTxs New sync point\n    function syncL2Requests(uint256 _newTotalSyncedPriorityTxs) external payable;\n\n    /// @notice Receive batch root from primary chain\n    /// @param _batchNumber The batch number\n    /// @param _l2LogsRootHash The L2 to L1 log root hash\n    /// @param _forwardEthAmount The forward eth amount\n    function syncBatchRoot(uint256 _batchNumber, bytes32 _l2LogsRootHash, uint256 _forwardEthAmount) external payable;\n\n    /// @notice Receive range batch root hash from primary chain\n    /// @param _fromBatchNumber The batch number from\n    /// @param _toBatchNumber The batch number to\n    /// @param _rangeBatchRootHash The accumulation hash of l2LogsRootHash in the range [`_fromBatchNumber`, `_toBatchNumber`]\n    /// @param _forwardEthAmount The forward eth amount\n    function syncRangeBatchRoot(\n        uint256 _fromBatchNumber,\n        uint256 _toBatchNumber,\n        bytes32 _rangeBatchRootHash,\n        uint256 _forwardEthAmount\n    ) external payable;\n\n    /// @notice Receive l2 tx hash from primary chain\n    /// @param _l2TxHash The l2 tx hash on local chain\n    /// @param _primaryChainL2TxHash The l2 tx hash on primary chain\n    function syncL2TxHash(bytes32 _l2TxHash, bytes32 _primaryChainL2TxHash) external;\n}\n"
      }
    },
    "settings": {
      "viaIR": true,
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}