Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Named mapings variables #96

Open
wants to merge 1 commit into
base: sb-short-term-fee-model
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/ImmutableSimulator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {DEPLOYER_SYSTEM_CONTRACT} from "./Constants.sol";
contract ImmutableSimulator is IImmutableSimulator {
/// @dev mapping (contract address) => (index of immutable variable) => value
/// @notice that address uses `uint256` type to leave the option to introduce 32-byte address space in future.
mapping(uint256 => mapping(uint256 => bytes32)) internal immutableDataStorage;
mapping(uint256 contractAddress => mapping(uint256 index => bytes32 value)) internal immutableDataStorage;

/// @notice Method that returns the immutable with a certain index for a user.
/// @param _dest The address which the immutable belongs to.
Expand Down
2 changes: 1 addition & 1 deletion contracts/L2EthToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {IMailbox} from "./interfaces/IMailbox.sol";
*/
contract L2EthToken is IEthToken, ISystemContract {
/// @notice The balances of the users.
mapping(address => uint256) internal balance;
mapping(address account => uint256 balance) internal balance;

/// @notice The total amount of tokens that have been minted.
uint256 public override totalSupply;
Expand Down
4 changes: 2 additions & 2 deletions contracts/NonceHolder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ contract NonceHolder is INonceHolder, ISystemContract {
/// RawNonces for accounts are stored in format
/// minNonce + 2^128 * deploymentNonce, where deploymentNonce
/// is the nonce used for deploying smart contracts.
mapping(uint256 => uint256) internal rawNonces;
mapping(uint256 account => uint256 packedMinAndDeploymentNonce) internal rawNonces;

/// Mapping of values under nonces for accounts.
/// The main key of the mapping is the 256-bit address of the account, while the
/// inner mapping is a mapping from a nonce to the value stored there.
mapping(uint256 => mapping(uint256 => uint256)) internal nonceValues;
mapping(uint256 account => mapping(uint256 nonceKey => uint256 value)) internal nonceValues;

/// @notice Returns the current minimal nonce for account.
/// @param _address The account to return the minimal nonce for
Expand Down
10 changes: 5 additions & 5 deletions contracts/SystemContext.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr

/// @notice The hashes of batches.
/// @dev It stores batch hashes for all previous batches.
mapping(uint256 => bytes32) internal batchHash;
mapping(uint256 batchNumber => bytes32 batchHash) internal batchHashes;

/// @notice The number and the timestamp of the current L2 block.
BlockInfo internal currentL2BlockInfo;
Expand Down Expand Up @@ -117,7 +117,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr
} else if (_block < currentVirtualBlockUpgradeInfo.virtualBlockStartBatch) {
// Note, that we will get into this branch only for a brief moment of time, right after the upgrade
// for virtual blocks before 256 virtual blocks are produced.
hash = batchHash[_block];
hash = batchHashes[_block];
} else if (
_block >= currentVirtualBlockUpgradeInfo.virtualBlockFinishL2Block &&
currentVirtualBlockUpgradeInfo.virtualBlockFinishL2Block > 0
Expand All @@ -135,7 +135,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr
/// @param _batchNumber The number of the batch.
/// @return hash The hash of the batch.
function getBatchHash(uint256 _batchNumber) external view returns (bytes32 hash) {
hash = batchHash[_batchNumber];
hash = batchHashes[_batchNumber];
}

/// @notice Returns the current batch's number and timestamp.
Expand Down Expand Up @@ -424,7 +424,7 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr

_ensureBatchConsistentWithL2Block(_newTimestamp);

batchHash[previousBatchNumber] = _prevBatchHash;
batchHashes[previousBatchNumber] = _prevBatchHash;

// Setting new block number and timestamp
BlockInfo memory newBlockInfo = BlockInfo({number: previousBatchNumber + 1, timestamp: _newTimestamp});
Expand Down Expand Up @@ -478,6 +478,6 @@ contract SystemContext is ISystemContext, ISystemContextDeprecated, ISystemContr
/// @notice Returns the hash of the given batch.
/// @dev Deprecated in favor of getBatchHash.
function blockHash(uint256 _blockNumber) external view returns (bytes32 hash) {
hash = batchHash[_blockNumber];
hash = batchHashes[_blockNumber];
}
}
Loading