Skip to content

Commit b086255

Browse files
test: Reverts when attempts a deployment exceeding max fee
1 parent 2c708f2 commit b086255

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/ATokenVaultFactory.t.sol

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,31 @@ contract ATokenVaultFactoryTest is Test {
489489
vm.stopPrank();
490490
}
491491

492+
function testDeployVaultExceedingMaxFeeReverts(uint256 initialDeposit, uint256 initFee) public {
493+
initialDeposit = _boundInitialDeposit(initialDeposit);
494+
initFee = bound(initFee, 1e18 + 1, type(uint256).max);
495+
496+
deal(address(dai), ALICE, initialDeposit);
497+
498+
vm.startPrank(ALICE);
499+
dai.approve(address(factory), initialDeposit);
500+
501+
ATokenVaultFactory.VaultParams memory params = ATokenVaultFactory.VaultParams({
502+
underlying: address(dai),
503+
referralCode: 0,
504+
poolAddressesProvider: IPoolAddressesProvider(address(poolAddrProvider)),
505+
owner: ALICE,
506+
initialFee: initFee,
507+
shareName: "Max Fee Vault",
508+
shareSymbol: "MFV",
509+
initialLockDeposit: initialDeposit
510+
});
511+
512+
vm.expectRevert("FEE_TOO_HIGH");
513+
factory.deployVault(params);
514+
vm.stopPrank();
515+
}
516+
492517
/*//////////////////////////////////////////////////////////////
493518
CONSTRUCTOR TESTS
494519
//////////////////////////////////////////////////////////////*/

0 commit comments

Comments
 (0)