{"file_path":"contracts/dev-contracts/SyncL2TxHashRelayer.sol","creation_status":"success","source_code":"// 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","deployed_bytecode":"0x608080604052600436101561001357600080fd5b600090813560e01c90816368871c9c146103f5575063bf22d9c31461003757600080fd5b60c03660031901126103f2576004356001600160a01b03811681036103ee5760243567ffffffffffffffff81116103ea57610076903690600401610438565b92604435916001600160a01b03831683036103ee5760a43567ffffffffffffffff81116103ea576100ab903690600401610438565b959094604051966040880188811067ffffffffffffffff8211176103d65760405260018852845b6020808210156100ed57906060602092828c010152016100d2565b505086889660405190637050dfb960e11b6020830152606435602483015260843560448301526044825281608081011067ffffffffffffffff6080840111176103c25760808083016040526001600160a01b0390911660a083015260c08201889052606060e08301529061017f816101696101008201826104a3565b03609f19810184840152607f190183830161046b565b01610189886104e3565b52610193876104e3565b5060405163129f52b360e31b8152916020836004817f0000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c60026001600160a01b03165afa9283156103b7578793610373575b506040516040810160208083015289518091526060820190602060608260051b8501019b01918a905b828210610347575050505061022d81899a99989903601f19810183528261046b565b7f0000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c60026001600160a01b03163b15610343576102d2936102c0916102986040519a8b998a99631a99738960e11b8b5260018060a01b031660048b015260c060248b015260c48a0191610506565b6001600160a01b039092166044880152606487018990528682036003190160848801526104a3565b8481036003190160a486015291610506565b0381347f0000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c60026001600160a01b03165af180156103385761030f575080f35b67ffffffffffffffff81116103245760405280f35b634e487b7160e01b82526041600452602482fd5b6040513d84823e3d90fd5b8680fd5b9091929b6020806103658f93600194605f198a8303018752516104a3565b9e019201920190929161020b565b9092506020813d6020116103af575b8161038f6020938361046b565b8101031261034357516001600160a01b03811681036103435791886101e2565b3d9150610382565b6040513d89823e3d90fd5b634e487b7160e01b88526041600452602488fd5b634e487b7160e01b86526041600452602486fd5b8280fd5b5080fd5b80fd5b9050346103ee57816003193601126103ee577f0000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c60026001600160a01b03168152602090f35b9181601f840112156104665782359167ffffffffffffffff8311610466576020838186019501011161046657565b600080fd5b90601f8019910116810190811067ffffffffffffffff82111761048d57604052565b634e487b7160e01b600052604160045260246000fd5b919082519283825260005b8481106104cf575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016104ae565b8051156104f05760200190565b634e487b7160e01b600052603260045260246000fd5b908060209392818452848401376000828201840152601f01601f191601019056fea2646970667358221220c891c8f2c594d34f40e19dcf55e38d40f9a944a43a60d5309ef73de9743f30c964736f6c63430008120033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"compilationTarget":{"contracts/dev-contracts/SyncL2TxHashRelayer.sol":"SyncL2TxHashRelayer"},"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[],"viaIR":true},"optimization_runs":200,"sourcify_repo_url":null,"decoded_constructor_args":[["0x1Ee09A2cAa0813A5183f90F5a6d0E4871f4C6002",{"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"}]],"compiler_version":"0.8.18+commit.87f61d96","is_verified_via_verifier_alliance":true,"verified_at":"2024-04-27T06:04:36.514847Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60a03461007f57601f6105f838819003918201601f19168301916001600160401b038311848410176100845780849260209460405283398101031261007f57516001600160a01b038116810361007f5760805260405161055d908161009b82396080518181816101aa0152818161022f015281816102d701526104090152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816368871c9c146103f5575063bf22d9c31461003757600080fd5b60c03660031901126103f2576004356001600160a01b03811681036103ee5760243567ffffffffffffffff81116103ea57610076903690600401610438565b92604435916001600160a01b03831683036103ee5760a43567ffffffffffffffff81116103ea576100ab903690600401610438565b959094604051966040880188811067ffffffffffffffff8211176103d65760405260018852845b6020808210156100ed57906060602092828c010152016100d2565b505086889660405190637050dfb960e11b6020830152606435602483015260843560448301526044825281608081011067ffffffffffffffff6080840111176103c25760808083016040526001600160a01b0390911660a083015260c08201889052606060e08301529061017f816101696101008201826104a3565b03609f19810184840152607f190183830161046b565b01610189886104e3565b52610193876104e3565b5060405163129f52b360e31b8152916020836004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9283156103b7578793610373575b506040516040810160208083015289518091526060820190602060608260051b8501019b01918a905b828210610347575050505061022d81899a99989903601f19810183528261046b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163b15610343576102d2936102c0916102986040519a8b998a99631a99738960e11b8b5260018060a01b031660048b015260c060248b015260c48a0191610506565b6001600160a01b039092166044880152606487018990528682036003190160848801526104a3565b8481036003190160a486015291610506565b0381347f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af180156103385761030f575080f35b67ffffffffffffffff81116103245760405280f35b634e487b7160e01b82526041600452602482fd5b6040513d84823e3d90fd5b8680fd5b9091929b6020806103658f93600194605f198a8303018752516104a3565b9e019201920190929161020b565b9092506020813d6020116103af575b8161038f6020938361046b565b8101031261034357516001600160a01b03811681036103435791886101e2565b3d9150610382565b6040513d89823e3d90fd5b634e487b7160e01b88526041600452602488fd5b634e487b7160e01b86526041600452602486fd5b8280fd5b5080fd5b80fd5b9050346103ee57816003193601126103ee577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9181601f840112156104665782359167ffffffffffffffff8311610466576020838186019501011161046657565b600080fd5b90601f8019910116810190811067ffffffffffffffff82111761048d57604052565b634e487b7160e01b600052604160045260246000fd5b919082519283825260005b8481106104cf575050826000602080949584010152601f8019910116010190565b6020818301810151848301820152016104ae565b8051156104f05760200190565b634e487b7160e01b600052603260045260246000fd5b908060209392818452848401376000828201840152601f01601f191601019056fea2646970667358221220c891c8f2c594d34f40e19dcf55e38d40f9a944a43a60d5309ef73de9743f30c964736f6c634300081200330000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c6002","name":"SyncL2TxHashRelayer","is_blueprint":false,"license_type":"none","is_fully_verified":true,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"paris","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":false,"additional_sources":[{"file_path":"contracts/interfaces/IArbitrator.sol","source_code":"// 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"},{"file_path":"contracts/interfaces/IGateway.sol","source_code":"// 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"},{"file_path":"contracts/interfaces/IL1Gateway.sol","source_code":"// 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"},{"file_path":"contracts/interfaces/IZkLink.sol","source_code":"// 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"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"contract IArbitrator","name":"_arbitrator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ARBITRATOR","outputs":[{"internalType":"contract IArbitrator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sourceChainCanonicalMessageService","type":"address"},{"internalType":"bytes","name":"_sourceChainClaimCallData","type":"bytes"},{"internalType":"address","name":"_secondaryChainL1Gateway","type":"address"},{"internalType":"bytes32","name":"_secondaryChainL2TxHash","type":"bytes32"},{"internalType":"bytes32","name":"_primaryChainL2TxHash","type":"bytes32"},{"internalType":"bytes","name":"_forwardParams","type":"bytes"}],"name":"claimPrimaryChainSyncL2TxHashMessage","outputs":[],"stateMutability":"payable","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":false,"constructor_args":"0x0000000000000000000000001ee09a2caa0813a5183f90f5a6d0e4871f4c6002"}