Skip to content

Commit ddf3614

Browse files
committed
improve error message when protocol fee is invalid
1 parent 7949345 commit ddf3614

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/EulerSwapFactory.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil, ProtocolFee {
3333
error OperatorNotInstalled();
3434
error InvalidVaultImplementation();
3535
error SliceOutOfBounds();
36+
error InvalidProtocolFee();
3637

3738
constructor(address evc, address evkFactory_, address eulerSwapImpl_, address feeOwner_)
3839
EVCUtil(evc)
@@ -52,13 +53,13 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil, ProtocolFee {
5253
GenericFactory(evkFactory).isProxy(params.vault0) && GenericFactory(evkFactory).isProxy(params.vault1),
5354
InvalidVaultImplementation()
5455
);
56+
require(
57+
params.protocolFee == protocolFee && params.protocolFeeRecipient == protocolFeeRecipient,
58+
InvalidProtocolFee()
59+
);
5560

5661
uninstall(params.eulerAccount);
5762

58-
// set protocol fee
59-
params.protocolFee = protocolFee;
60-
params.protocolFeeRecipient = protocolFeeRecipient;
61-
6263
EulerSwap pool = EulerSwap(
6364
MetaProxyDeployer.deployMetaProxy(
6465
eulerSwapImpl, abi.encode(params), keccak256(abi.encode(params.eulerAccount, salt))

0 commit comments

Comments
 (0)