diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol index 62b9ee3e..b40d42a8 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol @@ -66,6 +66,13 @@ contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChi childToken.approve(address(childBridge), 1000000 ether); } + function test_RevertsIf_WithdrawCalledWithZeroFee() public { + uint256 withdrawAmount = 100; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdraw(IChildERC20(address(2222222)), withdrawAmount); + } + function test_RevertsIf_WithdrawCalledWithEmptyChildToken() public { vm.expectRevert(EmptyTokenContract.selector); childBridge.withdraw{value: 1 ether}(IChildERC20(address(2222222)), 100); diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol index 4a815bfb..9ac7658b 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol @@ -48,6 +48,13 @@ contract ChildERC20BridgeWithdrawIMXUnitTest is Test, IChildERC20BridgeEvents, I ); } + function test_RevertIf_WithdrawIMXCalledWithZeroFee() public { + uint256 withdrawAmount = 300; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdrawIMX(withdrawAmount); + } + function test_RevertsIf_WithdrawIMXCalledWithInsufficientFund() public { uint256 withdrawAmount = 7 ether; diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol index 6164c86c..124d2d4c 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol @@ -66,6 +66,13 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC childToken.approve(address(childBridge), 1000000 ether); } + function test_RevertsIf_WithdrawToCalledWithZeroFee() public { + uint256 withdrawAmount = 300; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdrawTo(IChildERC20(address(2222222)), address(this), withdrawAmount); + } + function test_RevertsIf_WithdrawToCalledWithEmptyChildToken() public { vm.expectRevert(EmptyTokenContract.selector); childBridge.withdrawTo{value: 1 ether}(IChildERC20(address(2222222)), address(this), 100); diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol index daf92f12..d51f7200 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawToIMX.t.sol @@ -52,6 +52,13 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, ); } + function test_RevertsIf_withdrawIMXToCalledWithZeroFee() public { + uint256 withdrawAmount = 7 ether; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdrawIMXTo(address(this), withdrawAmount); + } + function test_RevertsIf_withdrawIMXToCalledWithInsufficientFund() public { uint256 withdrawAmount = 7 ether; @@ -59,7 +66,7 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, childBridge.withdrawIMXTo{value: withdrawAmount - 1}(address(this), withdrawAmount); } - function test_RevertIf_ZeroAmountIsProvided() public { + function test_RevertIf_withdrawIMXToZeroAmountIsProvided() public { uint256 withdrawFee = 300; vm.expectRevert(ZeroAmount.selector); diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol index b6a0a353..faa322b7 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol @@ -54,6 +54,13 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents, ); } + function test_RevertsIf_withdrawIMXCalledWithZeroFee() public { + uint256 withdrawAmount = 7 ether; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdrawIMX(withdrawAmount); + } + function test_RevertsIf_WithdrawWIMXCalledWithInsufficientFund() public { uint256 withdrawAmount = 101 ether; uint256 withdrawFee = 300; diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol index 8d115392..3f36d60e 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol @@ -54,6 +54,13 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents ); } + function test_RevertsIf_withdrawWIMXToCalledWithZeroFee() public { + uint256 withdrawAmount = 7 ether; + + vm.expectRevert(ZeroValue.selector); + childBridge.withdrawWIMXTo(address(this), withdrawAmount); + } + function test_RevertsIf_WithdrawWIMXToCalledWithInsufficientFund() public { uint256 withdrawAmount = 101 ether; uint256 withdrawFee = 300;