@@ -13,9 +13,12 @@ contract L2StandardBridgeBotTest is Test {
13
13
address user = 0x3977f9B1F4912a783B44aBa813dA388AC73a1428 ;
14
14
uint withdrawFee = 10000 ;
15
15
address constant LEGACY_ERC20_ETH = 0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000 ;
16
+ address constant L2_STANDARD_BRIDGE = 0x4200000000000000000000000000000000000010 ;
16
17
17
18
event WithdrawTo (address indexed from , address l2Token , address to , uint256 amount , uint32 minGasLimit , bytes extraData );
18
19
20
+ event SentMessageExtension1 (address indexed sender , uint256 value );
21
+
19
22
function setUp () public {
20
23
opbnbMainnetFork = vm.createFork ("https://opbnb-testnet-rpc.bnbchain.org " );
21
24
vm.selectFork (opbnbMainnetFork);
@@ -83,14 +86,18 @@ contract L2StandardBridgeBotTest is Test {
83
86
84
87
vm.prank (user);
85
88
uint amount = 0 ;
86
- bot.withdrawTo {value: withdrawFee + amount}(LEGACY_ERC20_ETH, user, amount, 200000 , "" );
87
- bot.withdrawTo {value: withdrawFee + amount}(LEGACY_ERC20_ETH, user, amount, 200000 , "" );
89
+ uint round = 10 ;
90
+ for (uint i = 0 ; i < round; i++ ) {
91
+ bot.withdrawTo {value: withdrawFee + amount}(LEGACY_ERC20_ETH, user, amount, 200000 , "" );
92
+ }
88
93
89
94
uint256 postBalance = address (bot).balance;
90
- assertEq (postBalance, prevBalance + withdrawFee * 2 );
95
+ assertEq (postBalance, prevBalance + withdrawFee * round );
91
96
92
97
// WithdrawFeeToL1
93
98
vm.prank (deployer);
99
+ vm.expectEmit (true , true , true , true );
100
+ emit SentMessageExtension1 (L2_STANDARD_BRIDGE, postBalance - withdrawFee);
94
101
bot.withdrawFeeToL1 (user, 0 , "" );
95
102
}
96
103
}
0 commit comments