@@ -42,6 +42,10 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
42
42
43
43
uint32 private constant DEFAULT_TRADING_FEE_PPM = 2000 ; // 0.2%
44
44
45
+ // trading enabling/disabling reasons
46
+ uint8 private constant TRADING_ENABLED_BY_OWNER = 0 ;
47
+ uint8 private constant TRADING_ENABLED_BY_MINIMUM_LIQUIDITY = 1 ;
48
+
45
49
// withdrawal-related input data
46
50
struct PoolWithdrawalParams {
47
51
uint256 networkTokenAvgTradingLiquidity;
@@ -101,15 +105,10 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
101
105
*/
102
106
event TradingFeePPMUpdated (IReserveToken indexed pool , uint32 prevFeePPM , uint32 newFeePPM );
103
107
104
- enum TradingEnablingReason {
105
- Owner,
106
- MinmumLiquidity
107
- }
108
-
109
108
/**
110
109
* @dev triggered when trading in a specific pool is enabled/disabled
111
110
*/
112
- event TradingEnabled (IReserveToken indexed pool , bool newStatus , TradingEnablingReason reason );
111
+ event TradingEnabled (IReserveToken indexed pool , bool newStatus , uint8 reason );
113
112
114
113
/**
115
114
* @dev triggered when depositing to a specific pool is enabled/disabled
@@ -262,7 +261,7 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
262
261
263
262
// although the owner-controlled flag is set to true, we want to emphasize that the trading in a newly created
264
263
// pool is disabled
265
- emit TradingEnabled ({ pool: reserveToken, newStatus: false , reason: TradingEnablingReason.Owner });
264
+ emit TradingEnabled ({ pool: reserveToken, newStatus: false , reason: TRADING_ENABLED_BY_OWNER });
266
265
267
266
emit TradingFeePPMUpdated ({ pool: reserveToken, prevFeePPM: 0 , newFeePPM: newPool.tradingFeePPM });
268
267
emit DepositingEnabled ({ pool: reserveToken, newStatus: newPool.depositingEnabled });
@@ -349,7 +348,7 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
349
348
350
349
poolData.tradingEnabled = status;
351
350
352
- emit TradingEnabled ({ pool: pool, newStatus: status, reason: TradingEnablingReason.Owner });
351
+ emit TradingEnabled ({ pool: pool, newStatus: status, reason: TRADING_ENABLED_BY_OWNER });
353
352
}
354
353
355
354
/**
@@ -462,7 +461,7 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
462
461
poolData.liquidity.networkTokenTradingLiquidity.add (depositParams.baseTokenDeltaAmount) >=
463
462
minLiquidityForTrading
464
463
) {
465
- emit TradingEnabled ({ pool: pool, newStatus: true , reason: TradingEnablingReason.MinmumLiquidity });
464
+ emit TradingEnabled ({ pool: pool, newStatus: true , reason: TRADING_ENABLED_BY_MINIMUM_LIQUIDITY });
466
465
}
467
466
}
468
467
@@ -695,7 +694,7 @@ contract PoolCollection is IPoolCollection, OwnedUpgradeable, ReentrancyGuardUpg
695
694
emit TradingEnabled ({
696
695
pool: pool,
697
696
newStatus: newEnabled,
698
- reason: TradingEnablingReason.MinmumLiquidity
697
+ reason: TRADING_ENABLED_BY_MINIMUM_LIQUIDITY
699
698
});
700
699
}
701
700
}
0 commit comments