Context:
s.governor = _governor;
L39s.validators[_validator] = true;
L40s.pendingGovernor = _newPendingGovernor;
L21l2TokenFactory = _l2TokenFactory;
L79l1Bridge = _l1Bridge;
L36l1Bridge = _l1Bridge;
L31
Recommendation:
Add non-zero address checks when set address state variables.
Context:
Recommendation:
Choose named return variable or return statement. It is unnecessary to use both.
Context:
- Executor.commitBlocks, Executor.executeBlocks, Executor.proveBlocks, Executor.revertBlocks (external functions must be before all public, internal, and private functions)
- Mailbox.l2TransactionBaseCost (public function can not go after internal function)
- L1ERC20Bridge.claimFailedDeposit (external function can not go after internal function)
- L1EthBridge.sol (all internal functions must be after all external functions)
- AllowList.sol (all internal functions must be after all external functions)
- L2ERC20Bridge.withdraw (external function can not go after internal function)
- L2ETHBridge.l2TokenAddress (public function can not go after internal function)
Description:
According to official solidity documentation functions should be grouped according to their visibility and ordered:
-
constructor
-
receive function (if exists)
-
fallback function (if exists)
-
external
-
public
-
internal
-
private
Within a grouping, place the view and pure functions last.
Recommendation:
Put the functions in the correct order according to the documentation.
Context:
Description:
Public functions can be declared external if they are not called by the contract.
Recommendation:
Declare these functions as external instead of public.
Context:
require(expectedNumberOfLayer1Txs == _newBlock.numberOfLayer1Txs);
L43require(l2BlockTimestamp == _newBlock.timestamp);
L45require(_recurisiveAggregationInput.length == 4);
L297require(amount != 0);
L145require(_message.length == 56);
L221require(bytes4(functionSignature) == this.finalizeWithdrawal.selector);
L224require(callSuccess);
L238require(_l1Token == CONVENTIONAL_ETH_ADDRESS);
L50require(msg.sender == l2Bridge);
L96
Context:
- Executor._calculateBlockHash
- Executor._blockPassThroughData
- Executor._blockMetaParameters
- Executor._blockAuxilaryOutput
- Mailbox._requestL2Transaction
- IDiamondCut.sol
- IExecutor.commitBlocks
- IExecutor.proveBlocks
- IExecutor.executeBlocks
- IExecutor.revertBlocks
- IGetters.sol
- IGovernance.sol
- IMailbox.sol
- IZkSync.sol
- IL1Bridge.sol
- IL2Bridge.sol
- L2ContractHelper.sol
- ReentrancyGuard._initializeReentrancyGuard
- UncheckedMath.sol
- UnsafeBytes.sol
- IAllowList.sol
- L2StandardERC20.name
- L2StandardERC20.symbol
- L2StandardERC20.decimals
- IL1Bridge.sol
- IL2Bridge.sol
- IL2EthInitializable.sol
- L2ContractHelper.sol
Context:
/// @title Diamond Proxy Cotract (EIP-2535)
L7 (change Cotract to Contract)/// @dev The sender is an `address` type, although we are using `uint256` for addreses in `L2CanonicalTransaction`.
L36 (change addreses to addresses)// Check that block contain all meta information for L2 logs.
L30 (change contain to contains)/// @param initAddress The address that's dellegate called after setting up new facet changes
L63 (change dellegate to delegate)/// @param initCalldata Calldata for the delegete call to 'initAddress'
L64 (change delegete to delegate)/// NOTE: It is expected but NOT enforced that there are no selectors associated wih '_facet'
L255 (change wih to with)/// @dev It is standard implementation of ERC20 Bridge that can be used as a refference
L19 (change refference to reference)// We are expecting to see the exect two bytecodes that are needed to initiailize the bridge
L76 (change exect to exact)// We are expecting to see the exect two bytecodes that are needed to initiailize the bridge
L76 (change initiailize to initialize)// Save the deposit amount, to claim funds back if the L2 transaction will failed
L106 (change will failed to will fail or will be failed)/// @notice Address of the L2 token by its L1 couterpart
L78 (change couterpart to counterpart)/// @dev Stores the L1 address of the bridge and set `name`/`symbol`/`decimls` getters that L1 token has.
L42 (change decimls to decimals)
Context:
// TODO: change constant to the real root hash of empty Merkle tree (SMA-184)
L28// TODO: estimate gas for L1 execute
L94// TODO: Restore after stable priority op fee modeling. (SMA-1230)
L127layer2Tip: uint192(0) // TODO: Restore after fee modeling will be stable. (SMA-1230)
L169/// TODO: The verifier integration is not finished yet, change the structure for compatibility later
L56
Context:
/// @dev Logically separated part of the storage structure, which is responsible for everything related to proxy upgrades and diamond cuts
L9/// @param securityCouncilMemberLastApprovedProposalId The mapping of the security council addresses and the last diamond cut that they approved
L15/// @notice Total number of executed blocks i.e. blocks[totalBlocksExecuted] points at the latest executed block (block 0 is genesis)
L80/// @param _diamondCutHash The hash of the diamond cut that security council members want to approve. Needed to prevent unintentional approvals, including reorg attacks
L104require(s.diamondCutStorage.securityCouncilMemberLastApprovedProposalId[msg.sender] < currentProposalId, "ao"); // already approved this proposal
L108require(s.diamondCutStorage.proposedDiamondCutHash == _diamondCutHash, "f1"); // proposed diamond cut do not match to the approved
L112/// @param _message Information about the sent message: sender address, the message itself, tx index in the L2 block where the message was sent
L23bytes32 constant DIAMOND_STORAGE_POSITION = 0xc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131b; // keccak256("diamond.standard.diamond.storage") - 1;
L14// - l2ShardId = 0 (means that L1 -> L2 transaction was processed in a rollup shard, other shards are not available yet anyway)
L196// It should be equal to the length of the function signature + address + address + uint256 = 4 + 20 + 20 + 32 = 76 (bytes).
L270/// @param _enables The array of boolean flags, whether enable or disable the public access to the corresponding target address
L64/// @param _enables The array of boolean flags, whether enable or disable the function access to the corresponding target address
L88
Description:
Maximum suggested line length is 120 characters.