@@ -4,6 +4,7 @@ pragma solidity ^0.8.27;
44import {IEulerSwapFactory, IEulerSwap} from "./interfaces/IEulerSwapFactory.sol " ;
55import {EulerSwap} from "./EulerSwap.sol " ;
66import {EVCUtil} from "ethereum-vault-connector/utils/EVCUtil.sol " ;
7+ import {GenericFactory} from "evk/GenericFactory/GenericFactory.sol " ;
78
89/// @title EulerSwapFactory contract
910/// @custom:security-contact security@euler.xyz
@@ -13,6 +14,8 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
1314 address [] public allPools;
1415 /// @dev Mapping between euler account and deployed pool that is currently set as operator
1516 mapping (address eulerAccount = > address operator ) public eulerAccountToPool;
17+ /// @dev Vaults must be deployed by this factory
18+ address public immutable evkFactory;
1619
1720 event PoolDeployed (
1821 address indexed asset0 ,
@@ -34,15 +37,22 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
3437 error Unauthorized ();
3538 error OldOperatorStillInstalled ();
3639 error OperatorNotInstalled ();
40+ error InvalidVaultImplementation ();
3741
38- constructor (address evc ) EVCUtil (evc) {}
42+ constructor (address evc , address evkFactory_ ) EVCUtil (evc) {
43+ evkFactory = evkFactory_;
44+ }
3945
4046 /// @inheritdoc IEulerSwapFactory
4147 function deployPool (IEulerSwap.Params memory params , IEulerSwap.CurveParams memory curveParams , bytes32 salt )
4248 external
4349 returns (address )
4450 {
4551 require (_msgSender () == params.eulerAccount, Unauthorized ());
52+ require (
53+ GenericFactory (evkFactory).isProxy (params.vault0) && GenericFactory (evkFactory).isProxy (params.vault1),
54+ InvalidVaultImplementation ()
55+ );
4656
4757 EulerSwap pool = new EulerSwap {salt: keccak256 (abi.encode (params.eulerAccount, salt))}(params, curveParams);
4858
0 commit comments