File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 9
9
* ConstantSum: incorporate price multipliers in quote methods
10
10
* natspec
11
11
* permit2 instead of regular approval: measure gas savings
12
- * in constructor, check the two vaults have the correct EVC() return value
13
- * maybe even that they were created by the EVK factory?
14
12
? a really small swap could fail because deposit() results in 0 shares, which EVK fails on. call convertToShares() first? Seems like overkill
15
13
? pause guardian
16
14
? how should aggregators find instances
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
27
27
error BadFee ();
28
28
error InsufficientReserves ();
29
29
error InsufficientCash ();
30
+ error DifferentEVC ();
30
31
31
32
modifier nonReentrant () {
32
33
require (locked == 0 , Locked ());
@@ -48,6 +49,10 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
48
49
constructor (BaseParams memory params ) EVCUtil (params.evc) {
49
50
require (params.fee < 1e18 , BadFee ());
50
51
52
+ address vault0Evc = IEVault (params.vault0).EVC ();
53
+ require (vault0Evc == IEVault (params.vault1).EVC (), DifferentEVC ());
54
+ require (vault0Evc == params.evc, DifferentEVC ());
55
+
51
56
vault0 = params.vault0;
52
57
vault1 = params.vault1;
53
58
asset0 = IEVault (vault0).asset ();
You can’t perform that action at this time.
0 commit comments