Skip to content

Commit

Permalink
more audit cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkjester committed Aug 22, 2023
1 parent 6f51bc7 commit ac6185e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions contracts/ZkEvmV2.sol
Expand Up @@ -156,13 +156,13 @@ contract ZkEvmV2 is IZkEvmV2, Initializable, AccessControlUpgradeable, L1Message

uint256[] memory timestamps = new uint256[](_blocksData.length);
bytes32[] memory blockHashes = new bytes32[](_blocksData.length);
bytes32[] memory hashOfRootHashes;
bytes32[] memory rootHashes;

unchecked {
hashOfRootHashes = new bytes32[](_blocksData.length + 1);
rootHashes = new bytes32[](_blocksData.length + 1);
}

hashOfRootHashes[0] = _parentStateRootHash;
rootHashes[0] = _parentStateRootHash;

bytes32 hashOfTxHashes;
bytes32 hashOfMessageHashes;
Expand Down Expand Up @@ -193,7 +193,7 @@ contract ZkEvmV2 is IZkEvmV2, Initializable, AccessControlUpgradeable, L1Message
timestamps[i] = blockInfo.l2BlockTimestamp;

unchecked {
hashOfRootHashes[i + 1] = blockInfo.blockRootHash;
rootHashes[i + 1] = blockInfo.blockRootHash;
}

emit BlockFinalized(currentBlockNumberTemp, blockInfo.blockRootHash);
Expand All @@ -217,7 +217,7 @@ contract ZkEvmV2 is IZkEvmV2, Initializable, AccessControlUpgradeable, L1Message
keccak256(abi.encodePacked(blockHashes)),
firstBlockNumber,
keccak256(abi.encodePacked(timestamps)),
keccak256(abi.encodePacked(hashOfRootHashes))
keccak256(abi.encodePacked(rootHashes))
)
)
);
Expand Down
1 change: 0 additions & 1 deletion contracts/messageService/l2/L2MessageService.sol
Expand Up @@ -3,7 +3,6 @@ pragma solidity ^0.8.19;

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { CodecV2 } from "../lib/Codec.sol";
import { IMessageService } from "../../interfaces/IMessageService.sol";
import { IGenericErrors } from "../../interfaces/IGenericErrors.sol";
import { RateLimiter } from "../lib/RateLimiter.sol";
Expand Down
1 change: 1 addition & 0 deletions contracts/messageService/lib/Codec.sol
Expand Up @@ -11,6 +11,7 @@ library CodecV2 {
* @notice Decodes a collection of bytes32 (hashes) from the calldata of a transaction.
* @dev Extracts and decodes skipping the function selector (selector is expected in the input).
* @dev A check beforehand must be performed to confirm this is the correct type of transaction.
* @dev A memory manipulation strips out the function signature, do not reuse.
* @param _calldataWithSelector The calldata for the transaction.
* @return bytes32[] - array of message hashes.
*/
Expand Down

0 comments on commit ac6185e

Please sign in to comment.