Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great Pool Migration (prep) #1954

Merged
merged 4 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/pool-linear/contracts/LinearPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import "@balancer-labs/v2-interfaces/contracts/pool-utils/IRateProvider.sol";
import "@balancer-labs/v2-interfaces/contracts/pool-linear/ILinearPool.sol";
import "@balancer-labs/v2-interfaces/contracts/vault/IGeneralPool.sol";

import "@balancer-labs/v2-pool-utils/contracts/BasePool.sol";
import "@balancer-labs/v2-pool-utils/contracts/LegacyBasePool.sol";
import "@balancer-labs/v2-pool-utils/contracts/rates/PriceRateCache.sol";

import "@balancer-labs/v2-solidity-utils/contracts/helpers/ERC20Helpers.sol";
Expand All @@ -38,8 +38,8 @@ import "./LinearMath.sol";
* The Pool will register three tokens in the Vault however: the two assets and the BPT itself,
* so that BPT can be exchanged (effectively joining and exiting) via swaps.
*
* Despite inheriting from BasePool, much of the basic behavior changes. This Pool does not support regular joins and
* exits, as the initial BPT supply is 'preminted' during initialization. No further BPT can be minted, and BPT can
* Despite inheriting from LegacyBasePool, much of the basic behavior changes. This Pool does not support regular joins
* and exits, as the initial BPT supply is 'preminted' during initialization. No further BPT can be minted, and BPT can
* only be burned if governance enables Recovery Mode and LPs use it to exit proportionally.
*
* Unlike most other Pools, this one does not attempt to create revenue by charging fees: value is derived by holding
Expand All @@ -51,7 +51,7 @@ import "./LinearMath.sol";
* The net revenue via fees is expected to be zero: all collected fees are used to pay for this 'rebalancing'.
* Accordingly, this Pool does not pay any protocol fees.
*/
abstract contract LinearPool is ILinearPool, IGeneralPool, IRateProvider, BasePool {
abstract contract LinearPool is ILinearPool, IGeneralPool, IRateProvider, LegacyBasePool {
using WordCodec for bytes32;
using FixedPoint for uint256;
using PriceRateCache for bytes32;
Expand Down Expand Up @@ -86,8 +86,8 @@ abstract contract LinearPool is ILinearPool, IGeneralPool, IRateProvider, BasePo
uint256 private immutable _scalingFactorMainToken;
uint256 private immutable _scalingFactorWrappedToken;

// The lower and upper targets are in BasePool's misc data field, which has 192 bits available (as it shares the
// same storage slot as the swap fee percentage and recovery mode flag, which together take up 64 bits).
// The lower and upper targets are in LegacyBasePool's misc data field, which has 192 bits available (as it shares
// the same storage slot as the swap fee percentage and recovery mode flag, which together take up 64 bits).
// We use 64 of these 192 for the targets (32 for each).
//
// The targets are already scaled by the main token's scaling factor (which makes the token behave as if it had 18
Expand Down Expand Up @@ -124,7 +124,7 @@ abstract contract LinearPool is ILinearPool, IGeneralPool, IRateProvider, BasePo
uint256 bufferPeriodDuration,
address owner
)
BasePool(
LegacyBasePool(
vault,
IVault.PoolSpecialization.GENERAL,
name,
Expand Down
4 changes: 2 additions & 2 deletions pkg/pool-stable/contracts/ComposableStablePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract ComposableStablePool is
}

constructor(NewPoolParams memory params)
BasePool(
LegacyBasePool(
params.vault,
IVault.PoolSpecialization.GENERAL,
params.name,
Expand Down Expand Up @@ -1136,7 +1136,7 @@ contract ComposableStablePool is
override(
// Our inheritance pattern creates a small diamond that requires explicitly listing the parents here.
// Each parent calls the `super` version, so linearization ensures all implementations are called.
BasePool,
LegacyBasePool,
ComposableStablePoolProtocolFees,
StablePoolAmplification,
ComposableStablePoolRates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ abstract contract ComposableStablePoolProtocolFees is
override(
// Our inheritance pattern creates a small diamond that requires explicitly listing the parents here.
// Each parent calls the `super` version, so linearization ensures all implementations are called.
BasePool,
LegacyBasePool,
BasePoolAuthorization,
ComposableStablePoolRates
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/pool-stable/contracts/ComposableStablePoolStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import "@balancer-labs/v2-interfaces/contracts/solidity-utils/helpers/BalancerEr
import "@balancer-labs/v2-interfaces/contracts/solidity-utils/openzeppelin/IERC20.sol";
import "@balancer-labs/v2-interfaces/contracts/pool-utils/IRateProvider.sol";

import "@balancer-labs/v2-pool-utils/contracts/BasePool.sol";
import "@balancer-labs/v2-pool-utils/contracts/LegacyBasePool.sol";

import "./StableMath.sol";

abstract contract ComposableStablePoolStorage is BasePool {
abstract contract ComposableStablePoolStorage is LegacyBasePool {
using FixedPoint for uint256;
using WordCodec for bytes32;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ contract MockComposableStablePoolProtocolFees is ComposableStablePoolProtocolFee
protocolFeeProvider,
ProviderFeeIDs({ swap: ProtocolFeeType.SWAP, yield: ProtocolFeeType.YIELD, aum: ProtocolFeeType.AUM })
)
BasePool(
LegacyBasePool(
vault,
IVault.PoolSpecialization.GENERAL,
"MockStablePoolStorage",
"MOCK_BPT",
_insertSorted(tokens, IERC20(this)),
new address[](tokens.length + 1),
1e12, // BasePool._MIN_SWAP_FEE_PERCENTAGE
1e12, // LegacyBasePool._MIN_SWAP_FEE_PERCENTAGE
0,
0,
address(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ contract MockComposableStablePoolRates is ComposableStablePoolRates {
ComposableStablePoolStorage(
StorageParams(_insertSorted(tokens, IERC20(this)), tokenRateProviders, exemptFromYieldProtocolFeeFlags)
)
BasePool(
LegacyBasePool(
vault,
IVault.PoolSpecialization.GENERAL,
"MockStablePoolStorage",
"MOCK_BPT",
_insertSorted(tokens, IERC20(this)),
new address[](tokens.length + 1),
1e12, // BasePool._MIN_SWAP_FEE_PERCENTAGE
1e12, // LegacyBasePool._MIN_SWAP_FEE_PERCENTAGE
0,
0,
owner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ contract MockComposableStablePoolStorage is ComposableStablePoolStorage {
exemptFromYieldProtocolFeeFlags: exemptFromYieldProtocolFeeFlags
})
)
BasePool(
LegacyBasePool(
vault,
IVault.PoolSpecialization.GENERAL,
"MockComposableStablePoolStorage",
"MOCK_BPT",
_insertSorted(tokens, IERC20(this)),
new address[](tokens.length + 1),
1e12, // BasePool._MIN_SWAP_FEE_PERCENTAGE
1e12, // LegacyBasePool._MIN_SWAP_FEE_PERCENTAGE
0,
0,
address(0)
Expand Down
12 changes: 6 additions & 6 deletions pkg/pool-utils/contracts/BaseGeneralPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ pragma experimental ABIEncoderV2;

import "@balancer-labs/v2-interfaces/contracts/vault/IGeneralPool.sol";

import "./BasePool.sol";
import "./LegacyBasePool.sol";

/**
* @dev Extension of `BasePool`, adding a handler for `IGeneralPool.onSwap`.
* @dev Extension of `LegacyBasePool`, adding a handler for `IGeneralPool.onSwap`.
*
* Derived contracts must call `BasePool`'s constructor, and implement `_onSwapGivenIn` and `_onSwapGivenOut` along with
* `BasePool`'s virtual functions. Inheriting from this contract lets derived contracts choose the General
* specialization setting.
* Derived contracts must call `LegacyBasePool`'s constructor, and implement `_onSwapGivenIn` and `_onSwapGivenOut`
* along with `LegacyBasePool`'s virtual functions. Inheriting from this contract lets derived contracts choose the
* General specialization setting.
*/
abstract contract BaseGeneralPool is IGeneralPool, BasePool {
abstract contract BaseGeneralPool is IGeneralPool, LegacyBasePool {
// Swap Hooks

function onSwap(
Expand Down
12 changes: 6 additions & 6 deletions pkg/pool-utils/contracts/BaseMinimalSwapInfoPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ pragma experimental ABIEncoderV2;

import "@balancer-labs/v2-interfaces/contracts/vault/IMinimalSwapInfoPool.sol";

import "./BasePool.sol";
import "./LegacyBasePool.sol";

/**
* @dev Extension of `BasePool`, adding a handler for `IMinimalSwapInfoPool.onSwap`.
* @dev Extension of `LegacyBasePool`, adding a handler for `IMinimalSwapInfoPool.onSwap`.
*
* Derived contracts must call `BasePool`'s constructor, and implement `_onSwapGivenIn` and `_onSwapGivenOut` along with
* `BasePool`'s virtual functions. Inheriting from this contract lets derived contracts choose the Two Token or Minimal
* Swap Info specialization settings.
* Derived contracts must call `LegacyBasePool`'s constructor, and implement `_onSwapGivenIn` and `_onSwapGivenOut`
* along with `LegacyBasePool`'s virtual functions. Inheriting from this contract lets derived contracts choose the
* Two Token or Minimal Swap Info specialization settings.
*/
abstract contract BaseMinimalSwapInfoPool is IMinimalSwapInfoPool, BasePool {
abstract contract BaseMinimalSwapInfoPool is IMinimalSwapInfoPool, LegacyBasePool {
// Swap Hooks

function onSwap(
Expand Down
Loading