From 23a36a3b9cd2f63ba7e0658ac6c554b84291bb74 Mon Sep 17 00:00:00 2001 From: zkbenny Date: Mon, 8 Apr 2024 10:10:28 +0800 Subject: [PATCH] emit event when open range batch root --- contracts/ZkLink.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/ZkLink.sol b/contracts/ZkLink.sol index d8362a9..443be1e 100644 --- a/contracts/ZkLink.sol +++ b/contracts/ZkLink.sol @@ -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 @@ -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 {