@@ -72,7 +72,15 @@ contract ZeroXBridgeL1 is Ownable, Starknet, MerkleManager {
7272 event WhitelistEvent (address indexed token );
7373 event DewhitelistEvent (address indexed token );
7474 event DepositEvent (
75- address indexed token , AssetType assetType , uint256 amount , address indexed user , uint256 commitmentHash
75+ uint256 depositId ,
76+ address indexed token ,
77+ AssetType assetType ,
78+ uint256 amount ,
79+ address indexed user ,
80+ uint256 nonce ,
81+ uint256 commitmentHash ,
82+ bytes32 newRoot ,
83+ uint256 elementCount
7684 );
7785 event TokenRegistered (bytes32 indexed assetKey , AssetType assetType , address tokenAddress );
7886 event UserRegistered (address indexed user , uint256 starknetPubKey );
@@ -182,7 +190,7 @@ contract ZeroXBridgeL1 is Ownable, Starknet, MerkleManager {
182190 * @param user The address that will receive the bridged tokens on L2
183191 * @return commitmentHash Returns the generated commitment hash for verification on L2
184192 */
185- function depositAsset (AssetType assetType , address tokenAddress , uint256 amount , address user )
193+ function depositAsset (uint256 depositId , AssetType assetType , address tokenAddress , uint256 amount , address user )
186194 external
187195 payable
188196 returns (uint256 )
@@ -228,13 +236,16 @@ contract ZeroXBridgeL1 is Ownable, Starknet, MerkleManager {
228236 nextDepositNonce[user] = nonce + 1 ;
229237
230238 // Generate commitment hash
231- bytes32 commitmentHash = keccak256 (abi.encodePacked (userRecord[user], usdVal, nonce, block .timestamp ));
239+ bytes32 commitmentHash =
240+ keccak256 (abi.encodePacked (depositId, userRecord[user], usdVal, nonce, block .timestamp ));
232241
233242 // Append to Merkle tree
234- appendDepositHash (commitmentHash);
243+ ( bytes32 newRoot , uint256 count , uint256 elementCount ) = appendDepositHash (commitmentHash);
235244
236245 // Emit deposit event
237- emit DepositEvent (tokenAddress, assetType, usdVal, user, uint256 (commitmentHash));
246+ emit DepositEvent (
247+ depositId, tokenAddress, assetType, usdVal, user, nonce, uint256 (commitmentHash), newRoot, elementCount
248+ );
238249
239250 return uint256 (commitmentHash);
240251 }
0 commit comments