@@ -4,6 +4,7 @@ pragma solidity ^0.8.27;
4
4
import {IEulerSwapFactory, IEulerSwap} from "./interfaces/IEulerSwapFactory.sol " ;
5
5
import {EulerSwap} from "./EulerSwap.sol " ;
6
6
import {EVCUtil} from "ethereum-vault-connector/utils/EVCUtil.sol " ;
7
+ import {GenericFactory} from "evk/GenericFactory/GenericFactory.sol " ;
7
8
8
9
/// @title EulerSwapFactory contract
9
10
/// @custom:security-contact [email protected]
@@ -13,6 +14,8 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
13
14
address [] public allPools;
14
15
/// @dev Mapping between euler account and deployed pool that is currently set as operator
15
16
mapping (address eulerAccount = > address operator ) public eulerAccountToPool;
17
+ /// @dev Vaults must be deployed by this factory
18
+ address public immutable evkFactory;
16
19
17
20
event PoolDeployed (
18
21
address indexed asset0 ,
@@ -34,15 +37,22 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
34
37
error Unauthorized ();
35
38
error OldOperatorStillInstalled ();
36
39
error OperatorNotInstalled ();
40
+ error InvalidVaultImplementation ();
37
41
38
- constructor (address evc ) EVCUtil (evc) {}
42
+ constructor (address evc , address evkFactory_ ) EVCUtil (evc) {
43
+ evkFactory = evkFactory_;
44
+ }
39
45
40
46
/// @inheritdoc IEulerSwapFactory
41
47
function deployPool (IEulerSwap.Params memory params , IEulerSwap.CurveParams memory curveParams , bytes32 salt )
42
48
external
43
49
returns (address )
44
50
{
45
51
require (_msgSender () == params.eulerAccount, Unauthorized ());
52
+ require (
53
+ GenericFactory (evkFactory).isProxy (params.vault0) && GenericFactory (evkFactory).isProxy (params.vault1),
54
+ InvalidVaultImplementation ()
55
+ );
46
56
47
57
EulerSwap pool = new EulerSwap {salt: keccak256 (abi.encode (params.eulerAccount, salt))}(params, curveParams);
48
58
0 commit comments