Skip to content

Commit bf3e530

Browse files
committed
restore PoolDeployed() event on factory
1 parent 658f11a commit bf3e530

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/EulerSwapFactory.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
2020
error Unauthorized();
2121
error OperatorNotInstalled();
2222

23+
event PoolDeployed(
24+
address indexed asset0,
25+
address indexed asset1,
26+
address indexed eulerAccount,
27+
address pool,
28+
IEulerSwap.StaticParams sParams
29+
);
30+
2331
constructor(address evc, address eulerSwapImpl_) EVCUtil(evc) {
2432
eulerSwapImpl = eulerSwapImpl_;
2533
}
@@ -38,6 +46,9 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil {
3846

3947
require(evc.isAccountOperatorAuthorized(sParams.eulerAccount, address(pool)), OperatorNotInstalled());
4048

49+
(address asset0, address asset1) = pool.getAssets();
50+
emit PoolDeployed(asset0, asset1, sParams.eulerAccount, address(pool), sParams);
51+
4152
pool.activate(dParams, initialState);
4253

4354
return address(pool);

test/FactoryTest.t.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ contract FactoryTest is EulerSwapTestBase {
134134
data: abi.encodeCall(EulerSwapRegistry.registerPool, (predictedAddress))
135135
});
136136

137+
vm.expectEmit(true, true, true, true);
138+
emit EulerSwapFactory.PoolDeployed(address(assetTST), address(assetTST2), holder, predictedAddress, sParams);
139+
140+
vm.expectEmit(true, true, true, true);
141+
emit EulerSwapRegistry.PoolRegistered(
142+
address(assetTST), address(assetTST2), holder, predictedAddress, sParams, 0
143+
);
144+
137145
vm.prank(holder);
138146
evc.batch(items);
139147

@@ -387,6 +395,9 @@ contract FactoryTest is EulerSwapTestBase {
387395
// Unregister pool for Alice
388396
vm.startPrank(alice);
389397
evc.setAccountOperator(alice, alicePool, false);
398+
399+
vm.expectEmit(true, true, true, true);
400+
emit EulerSwapRegistry.PoolUnregistered(address(assetTST), address(assetTST2), alice, alicePool);
390401
eulerSwapRegistry.unregisterPool();
391402

392403
assertFalse(EulerSwap(alicePool).isInstalled());

0 commit comments

Comments
 (0)