diff --git a/ethereum/contracts/bridge/L1ERC20Bridge.sol b/ethereum/contracts/bridge/L1ERC20Bridge.sol index 984e1b365..105735fc4 100644 --- a/ethereum/contracts/bridge/L1ERC20Bridge.sol +++ b/ethereum/contracts/bridge/L1ERC20Bridge.sol @@ -33,11 +33,11 @@ contract L1ERC20Bridge is IL1Bridge, IL1BridgeLegacy, ReentrancyGuard { /// @dev A mapping L2 batch number => message number => flag /// @dev Used to indicate that zkSync L2 -> L1 message was already processed - mapping(uint256 => mapping(uint256 => bool)) public isWithdrawalFinalized; + mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized)) public isWithdrawalFinalized; /// @dev A mapping account => L1 token address => L2 deposit transaction hash => amount /// @dev Used for saving the number of deposited funds, to claim them in case the deposit transaction will fail - mapping(address => mapping(address => mapping(bytes32 => uint256))) internal depositAmount; + mapping(address account => mapping(address l1Token => mapping(bytes32 depositL2TxHash => uint256 amount))) internal depositAmount; /// @dev The address of deployed L2 bridge counterpart address public l2Bridge; @@ -55,7 +55,7 @@ contract L1ERC20Bridge is IL1Bridge, IL1BridgeLegacy, ReentrancyGuard { /// @dev The accumulated deposited amount per user. /// @dev A mapping L1 token address => user address => the total deposited amount by the user - mapping(address => mapping(address => uint256)) public totalDepositedAmountPerUser; + mapping(address => mapping(address => uint256)) public __DEPRECATED_totalDepositedAmountPerUser; /// @dev Contract is expected to be used as proxy implementation. /// @dev Initialize the implementation to prevent Parity hack. diff --git a/ethereum/contracts/bridge/L1WethBridge.sol b/ethereum/contracts/bridge/L1WethBridge.sol index 5dc4c6f3d..dd8509fe0 100644 --- a/ethereum/contracts/bridge/L1WethBridge.sol +++ b/ethereum/contracts/bridge/L1WethBridge.sol @@ -54,7 +54,7 @@ contract L1WethBridge is IL1Bridge, ReentrancyGuard { /// @dev A mapping L2 batch number => message number => flag /// @dev Used to indicate that zkSync L2 -> L1 WETH message was already processed - mapping(uint256 => mapping(uint256 => bool)) public isWithdrawalFinalized; + mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized)) public isWithdrawalFinalized; /// @dev Contract is expected to be used as proxy implementation. /// @dev Initialize the implementation to prevent Parity hack. diff --git a/ethereum/contracts/governance/Governance.sol b/ethereum/contracts/governance/Governance.sol index 42527bd82..521eb566d 100644 --- a/ethereum/contracts/governance/Governance.sol +++ b/ethereum/contracts/governance/Governance.sol @@ -29,7 +29,7 @@ contract Governance is IGovernance, Ownable2Step { /// @dev - 0 means the operation is not created. /// @dev - 1 (EXECUTED_PROPOSAL_TIMESTAMP) means the operation is already executed. /// @dev - any other value means timestamp in seconds when the operation will be ready for execution. - mapping(bytes32 => uint256) public timestamps; + mapping(bytes32 operationId => uint256 executionTimestamp) public timestamps; /// @notice The minimum delay in seconds for operations to be ready for execution. uint256 public minDelay; diff --git a/ethereum/contracts/zksync/Storage.sol b/ethereum/contracts/zksync/Storage.sol index 1af0eaa86..8724798b2 100644 --- a/ethereum/contracts/zksync/Storage.sol +++ b/ethereum/contracts/zksync/Storage.sol @@ -108,7 +108,7 @@ struct AppStorage { /// @notice Address that the governor proposed as one that will replace it address pendingGovernor; /// @notice List of permitted validators - mapping(address => bool) validators; + mapping(address validatorAddress => bool isValidator) validators; /// @dev Verifier contract. Used to verify aggregated proof for batches IVerifier verifier; /// @notice Total number of executed batches i.e. batches[totalBatchesExecuted] points at the latest executed batch @@ -120,9 +120,9 @@ struct AppStorage { /// batch uint256 totalBatchesCommitted; /// @dev Stored hashed StoredBatch for batch number - mapping(uint256 => bytes32) storedBatchHashes; + mapping(uint256 batchNumber => bytes32 batchHash) storedBatchHashes; /// @dev Stored root hashes of L2 -> L1 logs - mapping(uint256 => bytes32) l2LogsRootHashes; + mapping(uint256 batchNumber => bytes32 l2LogsRootHash) l2LogsRootHashes; /// @dev Container that stores transactions requested from L1 PriorityQueue.Queue priorityQueue; /// @dev The smart contract that manages the list with permission to call contract functions @@ -148,13 +148,13 @@ struct AppStorage { /// @dev The L2 -> L1 log is sent for every withdrawal, so this mapping is serving as /// a flag to indicate that the message was already processed. /// @dev Used to indicate that eth withdrawal was already processed - mapping(uint256 => mapping(uint256 => bool)) isEthWithdrawalFinalized; + mapping(uint256 l2BatchNumber => mapping(uint256 l2ToL1MessageNumber => bool isFinalized)) isEthWithdrawalFinalized; /// @dev The most recent withdrawal time and amount reset uint256 __DEPRECATED_lastWithdrawalLimitReset; /// @dev The accumulated withdrawn amount during the withdrawal limit window uint256 __DEPRECATED_withdrawnAmountInWindow; /// @dev A mapping user address => the total deposited amount by the user - mapping(address => uint256) totalDepositedAmountPerUser; + mapping(address => uint256) __DEPRECATED_totalDepositedAmountPerUser; /// @dev Stores the protocol version. Note, that the protocol version may not only encompass changes to the /// smart contracts, but also to the node behavior. uint256 protocolVersion; diff --git a/ethereum/contracts/zksync/libraries/Diamond.sol b/ethereum/contracts/zksync/libraries/Diamond.sol index 4bc925bcc..00cdc280b 100644 --- a/ethereum/contracts/zksync/libraries/Diamond.sol +++ b/ethereum/contracts/zksync/libraries/Diamond.sol @@ -47,8 +47,8 @@ library Diamond { /// @param facets The array of all unique facet addresses that belong to the diamond proxy /// @param isFrozen Denotes whether the diamond proxy is frozen and all freezable facets are not accessible struct DiamondStorage { - mapping(bytes4 => SelectorToFacet) selectorToFacet; - mapping(address => FacetToSelectors) facetToSelectors; + mapping(bytes4 selector => SelectorToFacet selectorInfo) selectorToFacet; + mapping(address facetAddress => FacetToSelectors facetInfo) facetToSelectors; address[] facets; bool isFrozen; } diff --git a/ethereum/contracts/zksync/libraries/LibMap.sol b/ethereum/contracts/zksync/libraries/LibMap.sol index 800dede2c..31ab5a39d 100644 --- a/ethereum/contracts/zksync/libraries/LibMap.sol +++ b/ethereum/contracts/zksync/libraries/LibMap.sol @@ -7,7 +7,7 @@ pragma solidity 0.8.20; library LibMap { /// @dev A uint32 map in storage. struct Uint32Map { - mapping(uint256 => uint256) map; + mapping(uint256 packedIndex => uint256 eightPackedValues) map; } /// @dev Retrieves the uint32 value at a specific index from the Uint32Map. diff --git a/ethereum/contracts/zksync/libraries/PriorityQueue.sol b/ethereum/contracts/zksync/libraries/PriorityQueue.sol index e177f7735..e62ade979 100644 --- a/ethereum/contracts/zksync/libraries/PriorityQueue.sol +++ b/ethereum/contracts/zksync/libraries/PriorityQueue.sol @@ -25,7 +25,7 @@ library PriorityQueue { /// @param head The pointer to the first unprocessed priority operation, equal to the tail if the queue is empty /// @param tail The pointer to the free slot struct Queue { - mapping(uint256 => PriorityOperation) data; + mapping(uint256 priorityOpId => PriorityOperation priorityOp) data; uint256 tail; uint256 head; } diff --git a/zksync/contracts/bridge/L2ERC20Bridge.sol b/zksync/contracts/bridge/L2ERC20Bridge.sol index b044160fb..280570aec 100644 --- a/zksync/contracts/bridge/L2ERC20Bridge.sol +++ b/zksync/contracts/bridge/L2ERC20Bridge.sol @@ -29,7 +29,7 @@ contract L2ERC20Bridge is IL2Bridge, Initializable { bytes32 internal l2TokenProxyBytecodeHash; /// @dev A mapping l2 token address => l1 token address - mapping(address => address) public override l1TokenAddress; + mapping(address l2TokenAddress => address l1TokenAddress) public override l1TokenAddress; /// @dev Contract is expected to be used as proxy implementation. /// @dev Disable the initialization to prevent Parity hack.