Skip to content

Commit

Permalink
emit event when open range batch root
Browse files Browse the repository at this point in the history
  • Loading branch information
zkbenny committed Apr 8, 2024
1 parent 1225410 commit 23a36a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/ZkLink.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ contract ZkLink is
bytes32 rangeBatchRootHash,
uint256 forwardEthAmount
);
/// @notice Emitted when open range batch root hash.
event OpenRangeBatchRoot(uint256 fromBatchNumber, uint256 toBatchNumber);
/// @notice Emitted when receive l2 tx hash from primary chain.
event SyncL2TxHash(bytes32 l2TxHash, bytes32 primaryChainL2TxHash);
/// @notice Emitted when validator withdraw forward fee
Expand Down Expand Up @@ -506,9 +508,11 @@ contract ZkLink is
}
}
require(_rangeBatchRootHash == rangeBatchRootHash, "Incorrect root hash");
delete rangBatchRootHashes[range];
if (_toBatchNumber > totalBatchesExecuted) {
totalBatchesExecuted = _toBatchNumber;
}
emit OpenRangeBatchRoot(_fromBatchNumber, _toBatchNumber);
}

function syncL2TxHash(bytes32 _l2TxHash, bytes32 _primaryChainL2TxHash) external onlyGateway {
Expand Down

0 comments on commit 23a36a3

Please sign in to comment.