From c96964903fb8685540e7abec5580f5198ec83aad Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Thu, 21 Dec 2023 15:09:27 +0100 Subject: [PATCH 1/2] include security contact --- ethereum/contracts/zksync/interfaces/IAdmin.sol | 3 +++ ethereum/contracts/zksync/interfaces/IBase.sol | 3 +++ ethereum/contracts/zksync/interfaces/IExecutor.sol | 3 +++ ethereum/contracts/zksync/interfaces/IGetters.sol | 3 +++ ethereum/contracts/zksync/interfaces/ILegacyGetters.sol | 1 + ethereum/contracts/zksync/interfaces/IMailbox.sol | 3 +++ ethereum/contracts/zksync/interfaces/IVerifier.sol | 3 +++ ethereum/contracts/zksync/interfaces/IZkSync.sol | 4 ++++ 8 files changed, 23 insertions(+) diff --git a/ethereum/contracts/zksync/interfaces/IAdmin.sol b/ethereum/contracts/zksync/interfaces/IAdmin.sol index 15edb7ec1..61fcb9115 100644 --- a/ethereum/contracts/zksync/interfaces/IAdmin.sol +++ b/ethereum/contracts/zksync/interfaces/IAdmin.sol @@ -6,6 +6,9 @@ import "./IBase.sol"; import {Diamond} from "../libraries/Diamond.sol"; +/// @title The interface of the Admin Contract that controls access rights for contract management. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IAdmin is IBase { function setPendingGovernor(address _newPendingGovernor) external; diff --git a/ethereum/contracts/zksync/interfaces/IBase.sol b/ethereum/contracts/zksync/interfaces/IBase.sol index d77eb205c..2fcc615a2 100644 --- a/ethereum/contracts/zksync/interfaces/IBase.sol +++ b/ethereum/contracts/zksync/interfaces/IBase.sol @@ -1,6 +1,9 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.20; +/// @title The interface of the zkSync contract, responsible for the main zkSync logic. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IBase { function getName() external view returns (string memory); } diff --git a/ethereum/contracts/zksync/interfaces/IExecutor.sol b/ethereum/contracts/zksync/interfaces/IExecutor.sol index 50e983945..190298a9b 100644 --- a/ethereum/contracts/zksync/interfaces/IExecutor.sol +++ b/ethereum/contracts/zksync/interfaces/IExecutor.sol @@ -25,6 +25,9 @@ uint256 constant L2_LOG_KEY_OFFSET = 24; /// @dev Offset used to pull Value From Log. Equal to 4 (bytes for isService) + 20 (bytes for address) + 32 (bytes for key) uint256 constant L2_LOG_VALUE_OFFSET = 56; +/// @title The interface of the zkSync Executor contract capable of processing events emitted in the zkSync protocol. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IExecutor is IBase { /// @notice Rollup batch stored data /// @param batchNumber Rollup batch number diff --git a/ethereum/contracts/zksync/interfaces/IGetters.sol b/ethereum/contracts/zksync/interfaces/IGetters.sol index 46310b556..c9e7c7607 100644 --- a/ethereum/contracts/zksync/interfaces/IGetters.sol +++ b/ethereum/contracts/zksync/interfaces/IGetters.sol @@ -6,6 +6,9 @@ import "../libraries/PriorityQueue.sol"; import {VerifierParams, UpgradeState} from "../Storage.sol"; import "./IBase.sol"; +/// @title The interface of the Getters Contract that implements functions for getting contract state from outside the blockchain. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IGetters is IBase { /*////////////////////////////////////////////////////////////// CUSTOM GETTERS diff --git a/ethereum/contracts/zksync/interfaces/ILegacyGetters.sol b/ethereum/contracts/zksync/interfaces/ILegacyGetters.sol index faaa76e36..cda005d4d 100644 --- a/ethereum/contracts/zksync/interfaces/ILegacyGetters.sol +++ b/ethereum/contracts/zksync/interfaces/ILegacyGetters.sol @@ -7,6 +7,7 @@ import "./IBase.sol"; /// @author Matter Labs /// @dev This interface contains getters for the zkSync contract that should not be used, /// but still are keot for backward compatibility. +/// @custom:security-contact security@matterlabs.dev interface ILegacyGetters is IBase { function getTotalBlocksCommitted() external view returns (uint256); diff --git a/ethereum/contracts/zksync/interfaces/IMailbox.sol b/ethereum/contracts/zksync/interfaces/IMailbox.sol index fedd3eee7..9a4663064 100644 --- a/ethereum/contracts/zksync/interfaces/IMailbox.sol +++ b/ethereum/contracts/zksync/interfaces/IMailbox.sol @@ -13,6 +13,9 @@ enum TxStatus { Success } +/// @title The interface of the zkSync Mailbox contract that provides interfaces for L1 <-> L2 interaction. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IMailbox is IBase { /// @dev Structure that includes all fields of the L2 transaction /// @dev The hash of this structure is the "canonical L2 transaction hash" and can be used as a unique identifier of a tx diff --git a/ethereum/contracts/zksync/interfaces/IVerifier.sol b/ethereum/contracts/zksync/interfaces/IVerifier.sol index b4c103e9a..42fb8c922 100644 --- a/ethereum/contracts/zksync/interfaces/IVerifier.sol +++ b/ethereum/contracts/zksync/interfaces/IVerifier.sol @@ -2,6 +2,9 @@ pragma solidity 0.8.20; +/// @title The interface of the Verifier contract, responsible for the zero knowledge proof verification. +/// @author Matter Labs +/// @custom:security-contact security@matterlabs.dev interface IVerifier { function verify( uint256[] calldata _publicInputs, diff --git a/ethereum/contracts/zksync/interfaces/IZkSync.sol b/ethereum/contracts/zksync/interfaces/IZkSync.sol index 020ecb034..c2a38fb9b 100644 --- a/ethereum/contracts/zksync/interfaces/IZkSync.sol +++ b/ethereum/contracts/zksync/interfaces/IZkSync.sol @@ -7,4 +7,8 @@ import "./IAdmin.sol"; import "./IExecutor.sol"; import "./IGetters.sol"; +/// @title The interface of the zkSync contract, responsible for the main zkSync logic. +/// @author Matter Labs +/// @dev This interface combines the interfaces of all the facets of the zkSync contract. +/// @custom:security-contact security@matterlabs interface IZkSync is IMailbox, IAdmin, IExecutor, IGetters {} From 8ac55b309cc6e451f863618b849e63b24131f5f0 Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Thu, 21 Dec 2023 21:40:14 +0100 Subject: [PATCH 2/2] fix lint --- ethereum/contracts/zksync/interfaces/IZkSync.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereum/contracts/zksync/interfaces/IZkSync.sol b/ethereum/contracts/zksync/interfaces/IZkSync.sol index c2a38fb9b..af3c01af0 100644 --- a/ethereum/contracts/zksync/interfaces/IZkSync.sol +++ b/ethereum/contracts/zksync/interfaces/IZkSync.sol @@ -11,4 +11,6 @@ import "./IGetters.sol"; /// @author Matter Labs /// @dev This interface combines the interfaces of all the facets of the zkSync contract. /// @custom:security-contact security@matterlabs -interface IZkSync is IMailbox, IAdmin, IExecutor, IGetters {} +interface IZkSync is IMailbox, IAdmin, IExecutor, IGetters { + +}