From 4808a1dec928f78231fe7e6d4436192ea5cdf27e Mon Sep 17 00:00:00 2001 From: Raid Ateir Date: Mon, 1 Apr 2024 21:39:36 +0200 Subject: [PATCH 1/2] add named parameters and improve descriptions --- .../StateTransitionManager.sol | 22 +++++++++---------- .../state-transition/ValidatorTimelock.sol | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/l1-contracts/contracts/state-transition/StateTransitionManager.sol b/l1-contracts/contracts/state-transition/StateTransitionManager.sol index 0c274397f..d94965475 100644 --- a/l1-contracts/contracts/state-transition/StateTransitionManager.sol +++ b/l1-contracts/contracts/state-transition/StateTransitionManager.sol @@ -26,31 +26,31 @@ contract StateTransitionManager is IStateTransitionManager, ReentrancyGuard, Own /// @notice Address of the bridgehub address public immutable bridgehub; - /// @notice chainId => chainContract - mapping(uint256 => address) public stateTransition; + /// @notice The mapping from chainId => chainContract + mapping(uint256 chainId => address chainContract) public stateTransition; - /// @dev Batch hash zero, calculated at initialization + /// @dev The batch zero hash, calculated at initialization bytes32 public storedBatchZero; - /// @dev Stored cutData for diamond cut + /// @dev The stored cutData for diamond cut bytes32 public initialCutHash; - /// @dev genesisUpgrade contract address, used to setChainId + /// @dev The genesisUpgrade contract address, used to setChainId address public genesisUpgrade; - /// @dev current protocolVersion + /// @dev The current protocolVersion uint256 public protocolVersion; - /// @dev validatorTimelock contract address, used to setChainId + /// @dev The validatorTimelock contract address, used to setChainId address public validatorTimelock; - /// @dev Stored cutData for upgrade diamond cut. protocolVersion => cutHash - mapping(uint256 => bytes32) public upgradeCutHash; + /// @dev The stored cutData for upgrade diamond cut. protocolVersion => cutHash + mapping(uint256 protocolVersion => bytes32 cutHash) public upgradeCutHash; - /// @dev used to manage non critical updates + /// @dev The address used to manage non critical updates address public admin; - /// @dev used to accept the admin role + /// @dev The address to accept the admin role address private pendingAdmin; /// @dev Contract is expected to be used as proxy implementation. diff --git a/l1-contracts/contracts/state-transition/ValidatorTimelock.sol b/l1-contracts/contracts/state-transition/ValidatorTimelock.sol index 944e7cb1b..204c3596e 100644 --- a/l1-contracts/contracts/state-transition/ValidatorTimelock.sol +++ b/l1-contracts/contracts/state-transition/ValidatorTimelock.sol @@ -44,7 +44,7 @@ contract ValidatorTimelock is IExecutor, Ownable2Step { IStateTransitionManager public stateTransitionManager; /// @dev The mapping of L2 chainId => batch number => timestamp when it was committed. - mapping(uint256 => LibMap.Uint32Map) internal committedBatchTimestamp; + mapping(uint256 chainId => LibMap.Uint32Map batchNumberToTimestampMapping) internal committedBatchTimestamp; /// @dev The address that can commit/revert/validate/execute batches. mapping(uint256 _chainId => mapping(address _validator => bool)) public validators; From 8d001d3bd20639739494c140271c2f16e2a1c449 Mon Sep 17 00:00:00 2001 From: kelemeno Date: Mon, 1 Apr 2024 23:17:23 +0200 Subject: [PATCH 2/2] zk lint --- .../contracts/state-transition/StateTransitionManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l1-contracts/contracts/state-transition/StateTransitionManager.sol b/l1-contracts/contracts/state-transition/StateTransitionManager.sol index d94965475..63ef4516e 100644 --- a/l1-contracts/contracts/state-transition/StateTransitionManager.sol +++ b/l1-contracts/contracts/state-transition/StateTransitionManager.sol @@ -26,7 +26,7 @@ contract StateTransitionManager is IStateTransitionManager, ReentrancyGuard, Own /// @notice Address of the bridgehub address public immutable bridgehub; - /// @notice The mapping from chainId => chainContract + /// @notice The mapping from chainId => chainContract mapping(uint256 chainId => address chainContract) public stateTransition; /// @dev The batch zero hash, calculated at initialization