File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/contracts-bedrock/test/L1 Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2565,11 +2565,13 @@ contract OptimismPortal2_DepositTransaction_Test is OptimismPortal2_TestInit {
25652565 external
25662566 {
25672567 // Prevent overflow on an upgrade context
2568- if (isUsingLockbox ()) {
2568+ // Since the value always goes through the portal
2569+ _mint = bound (_mint, 0 , type (uint256 ).max - address (optimismPortal2).balance);
2570+
2571+ if (isUsingLockbox () && address (optimismPortal2).balance > address (ethLockbox).balance) {
25692572 _mint = bound (_mint, 0 , type (uint256 ).max - address (ethLockbox).balance);
2570- } else {
2571- _mint = bound (_mint, 0 , type (uint256 ).max - address (optimismPortal2).balance);
25722573 }
2574+
25732575 if (isUsingCustomGasToken ()) {
25742576 _mint = 0 ;
25752577 }
@@ -2585,7 +2587,6 @@ contract OptimismPortal2_DepositTransaction_Test is OptimismPortal2_TestInit {
25852587
25862588 uint256 balanceBefore = address (optimismPortal2).balance;
25872589 uint256 lockboxBalanceBefore = address (ethLockbox).balance;
2588- _mint = bound (_mint, 0 , type (uint256 ).max - balanceBefore);
25892590
25902591 // EOA emulation
25912592 vm.expectEmit (address (optimismPortal2));
You can’t perform that action at this time.
0 commit comments