Skip to content

Commit 315466d

Browse files
committed
keep pool in a locked state while activating, to prevent reentrancy
- Note that the pool is unlocked while executing the Uniswap activateHook function, but this only makes one external call to the (trusted) poolManager, and all the pool's invariants are already setup at that time. - Spearbit #7
1 parent 0421543 commit 315466d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/EulerSwapManagement.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ contract EulerSwapManagement is EulerSwapBase {
6464
IEulerSwap.StaticParams memory sParams = CtxLib.getStaticParams();
6565

6666
require(s.status == 0, AlreadyActivated());
67-
s.status = 1;
67+
s.status = 2; // Keep pool locked during activation
6868

6969
// Static parameters
7070

@@ -126,6 +126,8 @@ contract EulerSwapManagement is EulerSwapBase {
126126
) {
127127
IEVC(evc).enableCollateral(sParams.eulerAccount, sParams.supplyVault1);
128128
}
129+
130+
s.status = 1; // unlock pool
129131
}
130132

131133
function setManager(address manager, bool installed) external nonReentrant {

0 commit comments

Comments
 (0)