From 4b60ef6bf495393cfeaafa731dfc8ddb1ea18323 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Thu, 23 May 2024 13:25:26 +0200 Subject: [PATCH] Check outbound transfer reverts when withdrawals are paused --- test-foundry/L2USDCCustomGateway.t.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test-foundry/L2USDCCustomGateway.t.sol b/test-foundry/L2USDCCustomGateway.t.sol index 82ded3ae3..adcb0c890 100644 --- a/test-foundry/L2USDCCustomGateway.t.sol +++ b/test-foundry/L2USDCCustomGateway.t.sol @@ -178,6 +178,19 @@ contract L2USDCCustomGatewayTest is L2ArbitrumGatewayTest { l2USDCGateway.outboundTransfer(l1USDC, address(101), 200, 0, 0, new bytes(0)); } + function test_outboundTransfer_revert_WithdrawalsPaused() public { + // pause withdrawals + vm.prank(AddressAliasHelper.applyL1ToL2Alias(l1Counterpart)); + l2USDCGateway.pauseWithdrawals(); + + vm.expectRevert( + abi.encodeWithSelector( + L2USDCCustomGateway.L2USDCCustomGateway_WithdrawalsPaused.selector + ) + ); + l2USDCGateway.outboundTransfer(l1USDC, receiver, 200, 0, 0, new bytes(0)); + } + function test_pauseWithdrawals() public { assertEq(l2USDCGateway.withdrawalsPaused(), false, "Invalid initial state");