@@ -345,23 +345,24 @@ contract ERC20BridgeTest is Test {
345345 function testMaliciousTokenRejection () public {
346346 // Deploy a malicious token that could try to spoof bridge functionality
347347 MockMaliciousERC20 maliciousToken = new MockMaliciousERC20 (address (bridge));
348-
349- // Verify the malicious token still tries to spoof (even though bridge() function no longer exists in real bridged tokens)
348+
349+ // Verify the malicious token still tries to spoof (even though bridge() function no longer exists in real
350+ // bridged tokens)
350351 assertEq (maliciousToken.bridge (), address (bridge), "Malicious token should spoof bridge address " );
351-
352+
352353 // Transfer some malicious tokens to alice
353354 maliciousToken.transfer (alice, 100 );
354-
355+
355356 // Try to deposit the malicious token - should fail because it's not actually a bridged token
356357 vm.startPrank (alice);
357358 maliciousToken.approve (address (bridge), 100 );
358-
359+
359360 // This should revert because the malicious token is not in the _isBridgedTokens mapping
360361 vm.expectRevert (); // TokenNotInitialized()
361362 bridge.deposit (alice, address (maliciousToken), 100 , address (0 ));
362-
363+
363364 vm.stopPrank ();
364-
365+
365366 // The malicious token is correctly rejected because bridge now uses secure mapping-based validation
366367 // rather than calling external functions that could be spoofed
367368 }
@@ -370,7 +371,7 @@ contract ERC20BridgeTest is Test {
370371 // Initialize and prove token initialization
371372 MockERC20 originalToken = new MockERC20 ("Original Token " , "ORIG " );
372373 bridge.initializeToken (address (originalToken));
373-
374+
374375 IERC20Bridge .TokenInitialization memory tokenInit = IERC20Bridge .TokenInitialization ({
375376 originalToken: address (originalToken),
376377 name: "Original Token " ,
@@ -384,14 +385,14 @@ contract ERC20BridgeTest is Test {
384385
385386 // Test originalToken tracking
386387 assertEq (bridgedToken.originalToken (), address (originalToken), "originalToken should be tracked " );
387-
388+
388389 // Test ownership (bridge is the owner)
389390 assertEq (bridgedToken.owner (), address (bridge), "Bridge should be the owner " );
390-
391+
391392 // Test that only owner (bridge) can mint
392393 vm.expectRevert (); // Should revert with OwnableUnauthorizedAccount
393394 bridgedToken.mint (alice, 100 );
394-
395+
395396 // Bridge (owner) should be able to mint
396397 vm.prank (address (bridge));
397398 bridgedToken.mint (alice, 100 );
0 commit comments