Skip to content

Commit 295aaad

Browse files
committed
Update comment
1 parent beae757 commit 295aaad

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/v3/contracts/network/BancorNetwork.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ contract BancorNetwork is IBancorNetwork, Upgradeable, ReentrancyGuardUpgradeabl
766766
// get the pool collection that managed this pool
767767
IPoolCollection poolCollection = _poolCollection(pool);
768768

769-
// if there is no unallocated network token liquidity - it's enough to check that the pool is whitelisted. Otherwise,
769+
// if all network token liquidity is allocated - it's enough to check that the pool is whitelisted. Otherwise,
770770
// we need to check if the network token pool is able to provide network liquidity
771771
uint256 unallocatedNetworkTokenLiquidity = cachedNetworkTokenPool.unallocatedNetworkLiquidity(pool);
772772
if (unallocatedNetworkTokenLiquidity == 0) {

packages/v3/contracts/pools/PoolCollection.sol

+3-4
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,7 @@ contract PoolCollection is IPoolCollection, Owned, ReentrancyGuardUpgradeable, U
565565
rate = poolData.averageRate.rate;
566566
}
567567

568-
// if there is no available/unallocated network token liquidity - treat all the base token amount as excess and
569-
// finish
568+
// if all network token liquidity is allocated - treat all the base token amount as excess and finish
570569
if (unallocatedNetworkTokenLiquidity == 0) {
571570
depositParams.baseTokenExcessLiquidity = baseTokenAmount;
572571
depositParams.baseTokenDeltaAmount = 0;
@@ -577,8 +576,8 @@ contract PoolCollection is IPoolCollection, Owned, ReentrancyGuardUpgradeable, U
577576
// calculate the matching network token trading liquidity amount
578577
depositParams.networkTokenDeltaAmount = MathEx.mulDivF(baseTokenAmount, rate.n, rate.d);
579578

580-
// if there's not enough available/unallocated network token liquidity - we'll use as much as we can and the
581-
// remaining base token liquidity will be treated as excess
579+
// if most of network token liquidity is allocated - we'll use as much as we can and the remaining base token
580+
// liquidity will be treated as excess
582581
if (depositParams.networkTokenDeltaAmount > unallocatedNetworkTokenLiquidity) {
583582
uint256 unavailableNetworkTokenAmount = depositParams.networkTokenDeltaAmount -
584583
unallocatedNetworkTokenLiquidity;

0 commit comments

Comments
 (0)