From 0392d20cf6aae1f79b7fcf036819e58fad2a3f8f Mon Sep 17 00:00:00 2001 From: Sean Casey Date: Thu, 5 Oct 2023 02:44:54 -0400 Subject: [PATCH] refactor: deconstruct imports and use interfaces for sys contracts --- .../core/fund-deployer/FundDeployer.sol | 24 ++++----- .../core/fund-deployer/IFundDeployer.sol | 12 +++++ .../core/fund/comptroller/ComptrollerLib.sol | 44 ++++++++-------- .../fund/comptroller/ComptrollerProxy.sol | 2 +- .../core/fund/comptroller/IComptroller.sol | 23 ++++++++- contracts/release/core/fund/vault/IVault.sol | 9 ++-- .../release/core/fund/vault/VaultLib.sol | 28 +++++----- .../ExternalPositionManager.sol | 17 ++++--- .../aave-v2-debt/AaveDebtPositionLib.sol | 24 +++++---- .../aave-v2-debt/AaveDebtPositionParser.sol | 9 ++-- .../aave-v2-debt/IAaveDebtPosition.sol | 2 +- .../ArbitraryLoanPositionLib.sol | 27 +++++----- .../ArbitraryLoanPositionParser.sol | 10 ++-- .../arbitrary-loan/IArbitraryLoanPosition.sol | 2 +- ...traryLoanTotalNominalDeltaOracleModule.sol | 8 +-- .../compound-debt/CompoundDebtPositionLib.sol | 21 ++++---- .../CompoundDebtPositionParser.sol | 9 ++-- .../compound-debt/ICompoundDebtPosition.sol | 2 +- .../ConvexVotingPositionDataDecoder.sol | 2 +- .../convex-voting/ConvexVotingPositionLib.sol | 21 ++++---- .../ConvexVotingPositionParser.sol | 6 +-- .../convex-voting/IConvexVotingPosition.sol | 2 +- .../liquity-debt/ILiquityDebtPosition.sol | 2 +- .../liquity-debt/LiquityDebtPositionLib.sol | 14 ++--- .../LiquityDebtPositionParser.sol | 8 +-- .../IMapleLiquidityPosition.sol | 2 +- .../MapleLiquidityPositionLib.sol | 34 +++++++------ .../MapleLiquidityPositionParser.sol | 16 +++--- .../notional-v2/INotionalV2Position.sol | 2 +- .../notional-v2/NotionalV2PositionLib.sol | 16 +++--- .../notional-v2/NotionalV2PositionParser.sol | 8 +-- .../ISolvV2BondBuyerPosition.sol | 2 +- .../SolvV2BondBuyerPositionLib.sol | 25 +++++---- .../SolvV2BondBuyerPositionParser.sol | 15 +++--- .../ISolvV2BondIssuerPosition.sol | 2 +- .../SolvV2BondIssuerPositionDataDecoder.sol | 3 +- .../SolvV2BondIssuerPositionLib.sol | 26 +++++----- .../SolvV2BondIssuerPositionParser.sol | 19 ++++--- .../IStakeWiseV3StakingPosition.sol | 2 +- .../StakeWiseV3StakingPositionDataDecoder.sol | 4 +- .../StakeWiseV3StakingPositionLib.sol | 18 ++++--- .../StakeWiseV3StakingPositionParser.sol | 10 ++-- .../ITheGraphDelegationPosition.sol | 2 +- .../TheGraphDelegationPositionLib.sol | 17 ++++--- .../TheGraphDelegationPositionParser.sol | 6 +-- .../IUniswapV3LiquidityPosition.sol | 2 +- .../UniswapV3LiquidityPositionLib.sol | 19 +++---- .../UniswapV3LiquidityPositionParser.sol | 10 ++-- .../extensions/fee-manager/FeeManager.sol | 23 +++++---- .../release/extensions/fee-manager/IFee.sol | 2 +- .../extensions/fee-manager/IFeeManager.sol | 2 + .../fee-manager/fees/EntranceRateBurnFee.sol | 3 +- .../fees/EntranceRateDirectFee.sol | 7 ++- .../fee-manager/fees/ExitRateBurnFee.sol | 3 +- .../fee-manager/fees/ExitRateDirectFee.sol | 7 ++- .../fee-manager/fees/ManagementFee.sol | 21 ++++---- .../fee-manager/fees/MinSharesSupplyFee.sol | 5 +- .../fee-manager/fees/PerformanceFee.sol | 17 ++++--- .../fees/utils/EntranceRateFeeBase.sol | 5 +- .../fees/utils/ExitRateFeeBase.sol | 5 +- .../fee-manager/fees/utils/FeeBase.sol | 3 +- .../fees/utils/UpdatableFeeRecipientBase.sol | 8 +-- .../IntegrationManager.sol | 22 ++++---- .../integrations/IIntegrationAdapter.sol | 2 +- .../integrations/adapters/AaveV2Adapter.sol | 4 +- .../integrations/adapters/AaveV3Adapter.sol | 4 +- .../AuraBalancerV2LpStakingAdapter.sol | 8 +-- .../adapters/BalancerV2LiquidityAdapter.sol | 9 ++-- .../integrations/adapters/CompoundAdapter.sol | 4 +- .../adapters/CompoundV3Adapter.sol | 11 ++-- .../adapters/ConvexCurveLpStakingAdapter.sol | 11 ++-- .../adapters/CurveExchangeAdapter.sol | 5 +- .../adapters/CurveLiquidityAdapter.sol | 8 +-- .../integrations/adapters/IdleAdapter.sol | 12 +++-- .../adapters/OneInchV5Adapter.sol | 9 ++-- .../adapters/ParaSwapV5Adapter.sol | 9 ++-- .../adapters/SynthetixAdapter.sol | 12 +++-- .../adapters/UniswapV2ExchangeAdapter.sol | 7 +-- .../adapters/UniswapV2LiquidityAdapter.sol | 7 +-- .../adapters/UniswapV3Adapter.sol | 5 +- .../adapters/YearnVaultV2Adapter.sol | 7 +-- .../integrations/adapters/ZeroExV4Adapter.sol | 10 ++-- .../integrations/utils/0.6.12/AdapterBase.sol | 10 ++-- .../0.6.12/actions/AaveV2ActionsMixin.sol | 4 +- .../0.6.12/actions/AaveV3ActionsMixin.sol | 4 +- .../0.6.12/actions/BalancerV2ActionsMixin.sol | 2 +- .../0.6.12/actions/CompoundActionsMixin.sol | 8 +-- .../0.6.12/actions/CompoundV3ActionsMixin.sol | 6 +-- .../actions/CurveExchangeActionsMixin.sol | 11 ++-- .../actions/CurveGaugeV2ActionsMixin.sol | 4 +- .../CurveGaugeV2RewardsHandlerMixin.sol | 6 +-- .../actions/CurveLiquidityActionsMixin.sol | 7 +-- .../0.6.12/actions/IdleV4ActionsMixin.sol | 4 +- .../0.6.12/actions/OneInchV5ActionsMixin.sol | 4 +- .../0.6.12/actions/ParaSwapV5ActionsMixin.sol | 4 +- .../actions/StakingWrapperActionsMixin.sol | 4 +- .../0.6.12/actions/SynthetixActionsMixin.sol | 10 ++-- .../0.6.12/actions/UniswapV2ActionsMixin.sol | 4 +- .../0.6.12/actions/UniswapV3ActionsMixin.sol | 4 +- .../actions/YearnVaultV2ActionsMixin.sol | 4 +- .../0.6.12/actions/ZeroExV4ActionsMixin.sol | 4 +- .../utils/0.6.12/bases/AaveAdapterBase.sol | 9 ++-- .../bases/BalancerV2LiquidityAdapterBase.sol | 10 ++-- .../0.6.12/bases/CompoundAdapterBase.sol | 7 +-- .../bases/CurveLiquidityAdapterBase.sol | 6 +-- .../integrations/utils/0.8.19/AdapterBase.sol | 10 ++-- .../extensions/policy-manager/IPolicy.sol | 2 +- .../policy-manager/IPolicyManager.sol | 7 +++ .../policy-manager/PolicyManager.sol | 17 ++++--- .../AllowedAdapterIncomingAssetsPolicy.sol | 4 +- .../AllowedAdaptersPerManagerPolicy.sol | 9 ++-- .../asset-managers/AllowedAdaptersPolicy.sol | 4 +- ...dExternalPositionTypesPerManagerPolicy.sol | 11 ++-- .../AllowedExternalPositionTypesPolicy.sol | 11 ++-- .../CumulativeSlippageTolerancePolicy.sol | 11 ++-- .../OnlyRemoveDustExternalPositionPolicy.sol | 9 ++-- ...OnlyUntrackDustOrPricelessAssetsPolicy.sol | 12 +++-- .../AllowedAssetsForRedemptionPolicy.sol | 4 +- .../MinAssetBalancesPostRedemptionPolicy.sol | 9 ++-- .../AllowedDepositRecipientsPolicy.sol | 4 +- .../AllowedSharesTransferRecipientsPolicy.sol | 4 +- .../MinMaxInvestmentPolicy.sol | 3 +- .../AddressListRegistryPerUserPolicyBase.sol | 8 +-- .../0.6.12/AddressListRegistryPolicyBase.sol | 8 +-- .../utils/0.6.12/DustEvaluatorMixin.sol | 2 +- .../policies/utils/0.6.12/PolicyBase.sol | 2 +- .../0.6.12/PricelessAssetBypassMixin.sol | 16 +++--- .../UintListRegistryPerUserPolicyBase.sol | 8 +-- .../extensions/utils/ExtensionBase.sol | 4 +- .../utils/PermissionedVaultActionMixin.sol | 4 +- .../gas-relayer/GasRelayPaymasterFactory.sol | 4 +- .../gas-relayer/GasRelayPaymasterLib.sol | 51 ++++++++++--------- .../gas-relayer/GasRelayRecipientMixin.sol | 4 +- .../gas-relayer/IGasRelayPaymaster.sol | 2 +- .../bases/GasRelayPaymasterLibBase2.sol | 2 +- .../AggregatedDerivativePriceFeedMixin.sol | 2 +- ...uraBalancerV2LpStakingWrapperPriceFeed.sol | 2 +- .../feeds/BalancerV2GaugeTokenPriceFeed.sol | 4 +- .../feeds/BalancerV2StablePoolPriceFeed.sol | 15 +++--- .../feeds/BalancerV2WeightedPoolPriceFeed.sol | 24 ++++----- .../derivatives/feeds/CompoundPriceFeed.sol | 8 +-- .../ConvexCurveLpStakingWrapperPriceFeed.sol | 5 +- .../derivatives/feeds/CurvePriceFeed.sol | 18 +++---- .../derivatives/feeds/IdlePriceFeed.sol | 8 +-- .../feeds/PeggedDerivativesPriceFeed.sol | 2 +- .../derivatives/feeds/RevertingPriceFeed.sol | 2 +- .../feeds/UniswapV2PoolPriceFeed.sol | 18 +++---- .../derivatives/feeds/WstethPriceFeed.sol | 4 +- .../feeds/YearnVaultV2PriceFeed.sol | 12 ++--- .../utils/PeggedDerivativesPriceFeedBase.sol | 6 +-- .../SinglePeggedDerivativePriceFeedBase.sol | 4 +- ...ingleUnderlyingDerivativeRegistryMixin.sol | 2 +- .../primitives/ChainlinkPriceFeedMixin.sol | 6 +-- .../primitives/UsdEthSimulatedAggregator.sol | 2 +- .../UniswapV2PoolTokenValueCalculator.sol | 6 +-- .../protocol-fees/IProtocolFeeTracker.sol | 4 ++ .../protocol-fees/ProtocolFeeTracker.sol | 12 ++--- .../value-interpreter/ValueInterpreter.sol | 15 +++--- .../off-chain/AssetValueCalculator.sol | 8 +-- .../release/off-chain/FundValueCalculator.sol | 39 +++++++------- .../UnpermissionedActionsWrapper.sol | 9 ++-- ...bitraryTokenPhasedSharesWrapperFactory.sol | 4 +- .../ArbitraryTokenPhasedSharesWrapperLib.sol | 31 +++++------ ...ArbitraryTokenPhasedSharesWrapperProxy.sol | 2 +- .../utils/0.6.12/FundDeployerOwnerMixin.sol | 2 +- contracts/utils/0.6.12/AssetHelpers.sol | 6 +-- contracts/utils/0.6.12/MathHelpers.sol | 2 +- .../utils/0.6.12/beacon-proxy/BeaconProxy.sol | 2 +- .../beacon-proxy/BeaconProxyFactory.sol | 4 +- .../beacon-proxy/IBeaconProxyFactory.sol | 2 +- contracts/utils/0.8.19/AssetHelpers.sol | 4 +- 171 files changed, 849 insertions(+), 694 deletions(-) diff --git a/contracts/release/core/fund-deployer/FundDeployer.sol b/contracts/release/core/fund-deployer/FundDeployer.sol index 35068c517..ff4f4a206 100644 --- a/contracts/release/core/fund-deployer/FundDeployer.sol +++ b/contracts/release/core/fund-deployer/FundDeployer.sol @@ -12,15 +12,15 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../persistent/dispatcher/IDispatcher.sol"; -import "../../../persistent/dispatcher/IMigrationHookHandler.sol"; -import "../../extensions/IExtension.sol"; -import "../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; -import "../../infrastructure/protocol-fees/IProtocolFeeTracker.sol"; -import "../fund/comptroller/ComptrollerProxy.sol"; -import "../fund/comptroller/IComptroller.sol"; -import "../fund/vault/IVault.sol"; -import "./IFundDeployer.sol"; +import {IDispatcher} from "../../../persistent/dispatcher/IDispatcher.sol"; +import {IMigrationHookHandler} from "../../../persistent/dispatcher/IMigrationHookHandler.sol"; +import {IExtension} from "../../extensions/IExtension.sol"; +import {GasRelayRecipientMixin} from "../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; +import {IProtocolFeeTracker} from "../../infrastructure/protocol-fees/IProtocolFeeTracker.sol"; +import {ComptrollerProxy} from "../fund/comptroller/ComptrollerProxy.sol"; +import {IComptroller} from "../fund/comptroller/IComptroller.sol"; +import {IVault} from "../fund/vault/IVault.sol"; +import {IFundDeployer} from "./IFundDeployer.sol"; /// @title FundDeployer Contract /// @author Enzyme Council @@ -339,7 +339,7 @@ contract FundDeployer is IFundDeployer, IMigrationHookHandler, GasRelayRecipient uint256 _sharesActionTimelock, bytes calldata _feeManagerConfigData, bytes calldata _policyManagerConfigData - ) external returns (address comptrollerProxy_) { + ) external override returns (address comptrollerProxy_) { address canonicalSender = __msgSender(); __assertIsMigrator(_vaultProxy, canonicalSender); require( @@ -433,7 +433,7 @@ contract FundDeployer is IFundDeployer, IMigrationHookHandler, GasRelayRecipient /// @notice Cancels a pending reconfiguration request /// @param _vaultProxy The VaultProxy contract for which to cancel the reconfiguration request - function cancelReconfiguration(address _vaultProxy) external onlyMigrator(_vaultProxy) { + function cancelReconfiguration(address _vaultProxy) external override onlyMigrator(_vaultProxy) { address nextComptrollerProxy = vaultProxyToReconfigurationRequest[_vaultProxy].nextComptrollerProxy; require( nextComptrollerProxy != address(0), @@ -453,7 +453,7 @@ contract FundDeployer is IFundDeployer, IMigrationHookHandler, GasRelayRecipient /// @param _vaultProxy The VaultProxy contract for which to execute the reconfiguration request /// @dev ProtocolFeeTracker.initializeForVault() does not need to be included in a reconfiguration, /// as it refers to the vault and not the new ComptrollerProxy - function executeReconfiguration(address _vaultProxy) external onlyMigrator(_vaultProxy) { + function executeReconfiguration(address _vaultProxy) external override onlyMigrator(_vaultProxy) { ReconfigurationRequest memory request = getReconfigurationRequestForVaultProxy(_vaultProxy); require( request.nextComptrollerProxy != address(0), diff --git a/contracts/release/core/fund-deployer/IFundDeployer.sol b/contracts/release/core/fund-deployer/IFundDeployer.sol index fa6619487..2730de9a4 100644 --- a/contracts/release/core/fund-deployer/IFundDeployer.sol +++ b/contracts/release/core/fund-deployer/IFundDeployer.sol @@ -14,6 +14,18 @@ pragma solidity >=0.6.0 <0.9.0; /// @title IFundDeployer Interface /// @author Enzyme Council interface IFundDeployer { + function cancelReconfiguration(address _vaultProxy) external; + + function createReconfigurationRequest( + address _vaultProxy, + address _denominationAsset, + uint256 _sharesActionTimelock, + bytes calldata _feeManagerConfigData, + bytes calldata _policyManagerConfigData + ) external returns (address comptrollerProxy_); + + function executeReconfiguration(address _vaultProxy) external; + function getOwner() external view returns (address); function hasReconfigurationRequest(address) external view returns (bool); diff --git a/contracts/release/core/fund/comptroller/ComptrollerLib.sol b/contracts/release/core/fund/comptroller/ComptrollerLib.sol index e6e6c9fad..5798e9325 100644 --- a/contracts/release/core/fund/comptroller/ComptrollerLib.sol +++ b/contracts/release/core/fund/comptroller/ComptrollerLib.sol @@ -11,23 +11,23 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../persistent/dispatcher/IDispatcher.sol"; -import "../../../../persistent/external-positions/IExternalPosition.sol"; -import "../../../../utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol"; -import "../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../extensions/IExtension.sol"; -import "../../../extensions/fee-manager/IFeeManager.sol"; -import "../../../extensions/policy-manager/IPolicyManager.sol"; -import "../../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; -import "../../../infrastructure/gas-relayer/IGasRelayPaymaster.sol"; -import "../../../infrastructure/gas-relayer/IGasRelayPaymasterDepositor.sol"; -import "../../../infrastructure/value-interpreter/IValueInterpreter.sol"; -import "../../fund-deployer/IFundDeployer.sol"; -import "../vault/IVault.sol"; -import "./IComptroller.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IDispatcher} from "../../../../persistent/dispatcher/IDispatcher.sol"; +import {IExternalPosition} from "../../../../persistent/external-positions/IExternalPosition.sol"; +import {IBeaconProxyFactory} from "../../../../utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol"; +import {AddressArrayLib} from "../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IExtension} from "../../../extensions/IExtension.sol"; +import {IFeeManager} from "../../../extensions/fee-manager/IFeeManager.sol"; +import {IPolicyManager} from "../../../extensions/policy-manager/IPolicyManager.sol"; +import {GasRelayRecipientMixin} from "../../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; +import {IGasRelayPaymaster} from "../../../infrastructure/gas-relayer/IGasRelayPaymaster.sol"; +import {IGasRelayPaymasterDepositor} from "../../../infrastructure/gas-relayer/IGasRelayPaymasterDepositor.sol"; +import {IValueInterpreter} from "../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IFundDeployer} from "../../fund-deployer/IFundDeployer.sol"; +import {IVault} from "../vault/IVault.sol"; +import {IComptroller} from "./IComptroller.sol"; /// @title ComptrollerLib Contract /// @author Enzyme Council @@ -237,6 +237,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe /// @return returnData_ The data returned by the call function vaultCallOnContract(address _contract, bytes4 _selector, bytes calldata _encodedArgs) external + override onlyOwner returns (bytes memory returnData_) { @@ -264,7 +265,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe /// @notice Buys back shares collected as protocol fee at a discounted shares price, using MLN /// @param _sharesAmount The amount of shares to buy back - function buyBackProtocolFeeShares(uint256 _sharesAmount) external { + function buyBackProtocolFeeShares(uint256 _sharesAmount) external override { address vaultProxyCopy = vaultProxy; require(IVault(vaultProxyCopy).canManageAssets(__msgSender()), "buyBackProtocolFeeShares: Unauthorized"); @@ -278,7 +279,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe /// @notice Sets whether to attempt to buyback protocol fee shares immediately when collected /// @param _nextAutoProtocolFeeSharesBuyback True if protocol fee shares should be attempted /// to be bought back immediately when collected - function setAutoProtocolFeeSharesBuyback(bool _nextAutoProtocolFeeSharesBuyback) external onlyOwner { + function setAutoProtocolFeeSharesBuyback(bool _nextAutoProtocolFeeSharesBuyback) external override onlyOwner { autoProtocolFeeSharesBuyback = _nextAutoProtocolFeeSharesBuyback; emit AutoProtocolFeeSharesBuybackSet(_nextAutoProtocolFeeSharesBuyback); @@ -599,6 +600,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe /// @return sharesReceived_ The actual amount of shares received function buyShares(uint256 _investmentAmount, uint256 _minSharesQuantity) external + override returns (uint256 sharesReceived_) { bool hasSharesActionTimelock = getSharesActionTimelock() > 0; @@ -788,7 +790,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe uint256 _sharesQuantity, address[] calldata _additionalAssets, address[] calldata _assetsToSkip - ) external locksReentrance returns (address[] memory payoutAssets_, uint256[] memory payoutAmounts_) { + ) external override locksReentrance returns (address[] memory payoutAssets_, uint256[] memory payoutAmounts_) { address canonicalSender = __msgSender(); require(_additionalAssets.isUniqueSet(), "redeemSharesInKind: _additionalAssets contains duplicates"); require(_assetsToSkip.isUniqueSet(), "redeemSharesInKind: _assetsToSkip contains duplicates"); @@ -1029,7 +1031,7 @@ contract ComptrollerLib is IComptroller, IGasRelayPaymasterDepositor, GasRelayRe } /// @notice Tops up the gas relay paymaster deposit - function depositToGasRelayPaymaster() external onlyOwner { + function depositToGasRelayPaymaster() external override onlyOwner { __depositToGasRelayPaymaster(getGasRelayPaymaster()); } diff --git a/contracts/release/core/fund/comptroller/ComptrollerProxy.sol b/contracts/release/core/fund/comptroller/ComptrollerProxy.sol index ef3f5fdf2..78bec37fa 100644 --- a/contracts/release/core/fund/comptroller/ComptrollerProxy.sol +++ b/contracts/release/core/fund/comptroller/ComptrollerProxy.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../../utils/0.6.12/NonUpgradableProxy.sol"; +import {NonUpgradableProxy} from "../../../../utils/0.6.12/NonUpgradableProxy.sol"; /// @title ComptrollerProxy Contract /// @author Enzyme Council diff --git a/contracts/release/core/fund/comptroller/IComptroller.sol b/contracts/release/core/fund/comptroller/IComptroller.sol index 4227de493..6626df8b7 100644 --- a/contracts/release/core/fund/comptroller/IComptroller.sol +++ b/contracts/release/core/fund/comptroller/IComptroller.sol @@ -11,13 +11,19 @@ pragma solidity >=0.6.0 <0.9.0; -import "../vault/IVault.sol"; +import {IVault} from "../vault/IVault.sol"; /// @title IComptroller Interface /// @author Enzyme Council interface IComptroller { function activate(bool) external; + function buyBackProtocolFeeShares(uint256 _sharesAmount) external; + + function buyShares(uint256 _investmentAmount, uint256 _minSharesQuantity) + external + returns (uint256 sharesReceived_); + function buySharesOnBehalf(address _buyer, uint256 _investmentAmount, uint256 _minSharesQuantity) external returns (uint256 sharesReceived_); @@ -28,6 +34,8 @@ interface IComptroller { function callOnExtension(address, uint256, bytes calldata) external; + function depositToGasRelayPaymaster() external; + function destructActivated(uint256, uint256) external; function destructUnactivated() external; @@ -56,7 +64,20 @@ interface IComptroller { function preTransferSharesHookFreelyTransferable(address) external view; + function redeemSharesInKind( + address _recipient, + uint256 _sharesQuantity, + address[] calldata _additionalAssets, + address[] calldata _assetsToSkip + ) external returns (address[] memory payoutAssets_, uint256[] memory payoutAmounts_); + + function setAutoProtocolFeeSharesBuyback(bool _nextAutoProtocolFeeSharesBuyback) external; + function setGasRelayPaymaster(address) external; function setVaultProxy(address) external; + + function vaultCallOnContract(address _contract, bytes4 _selector, bytes calldata _encodedArgs) + external + returns (bytes memory returnData_); } diff --git a/contracts/release/core/fund/vault/IVault.sol b/contracts/release/core/fund/vault/IVault.sol index 8db6bca08..6e3227eab 100644 --- a/contracts/release/core/fund/vault/IVault.sol +++ b/contracts/release/core/fund/vault/IVault.sol @@ -11,10 +11,11 @@ pragma solidity >=0.6.0 <0.9.0; -import "../../../../persistent/vault/interfaces/IExternalPositionVault.sol"; -import "../../../../persistent/vault/interfaces/IFreelyTransferableSharesVault.sol"; -import "../../../../persistent/vault/interfaces/IMigratableVault.sol"; -import "../../../../persistent/vault/interfaces/IVaultCore.sol"; +import {IExternalPositionVault} from "../../../../persistent/vault/interfaces/IExternalPositionVault.sol"; +import {IFreelyTransferableSharesVault} from + "../../../../persistent/vault/interfaces/IFreelyTransferableSharesVault.sol"; +import {IMigratableVault} from "../../../../persistent/vault/interfaces/IMigratableVault.sol"; +import {IVaultCore} from "../../../../persistent/vault/interfaces/IVaultCore.sol"; /// @title IVault Interface /// @author Enzyme Council diff --git a/contracts/release/core/fund/vault/VaultLib.sol b/contracts/release/core/fund/vault/VaultLib.sol index f874a7d0e..d282d769e 100644 --- a/contracts/release/core/fund/vault/VaultLib.sol +++ b/contracts/release/core/fund/vault/VaultLib.sol @@ -11,20 +11,20 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20Burnable.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../external-interfaces/IWETH.sol"; -import "../../../../persistent/dispatcher/IDispatcher.sol"; -import "../../../../persistent/external-positions/IExternalPosition.sol"; -import "../../../../persistent/protocol-fee-reserve/interfaces/IProtocolFeeReserve1.sol"; -import "../../../../persistent/vault/VaultLibBase2.sol"; -import "../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; -import "../../../infrastructure/protocol-fees/IProtocolFeeTracker.sol"; -import "../../../extensions/external-position-manager/IExternalPositionManager.sol"; -import "../comptroller/IComptroller.sol"; -import "./IVault.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {ERC20Burnable} from "openzeppelin-solc-0.6/token/ERC20/ERC20Burnable.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IWETH} from "../../../../external-interfaces/IWETH.sol"; +import {IDispatcher} from "../../../../persistent/dispatcher/IDispatcher.sol"; +import {IExternalPosition} from "../../../../persistent/external-positions/IExternalPosition.sol"; +import {IProtocolFeeReserve1} from "../../../../persistent/protocol-fee-reserve/interfaces/IProtocolFeeReserve1.sol"; +import {VaultLibBase2} from "../../../../persistent/vault/VaultLibBase2.sol"; +import {AddressArrayLib} from "../../../../utils/0.6.12/AddressArrayLib.sol"; +import {GasRelayRecipientMixin} from "../../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; +import {IProtocolFeeTracker} from "../../../infrastructure/protocol-fees/IProtocolFeeTracker.sol"; +import {IExternalPositionManager} from "../../../extensions/external-position-manager/IExternalPositionManager.sol"; +import {IComptroller} from "../comptroller/IComptroller.sol"; +import {IVault} from "./IVault.sol"; /// @title VaultLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/ExternalPositionManager.sol b/contracts/release/extensions/external-position-manager/ExternalPositionManager.sol index f18eb3e41..c9b33e9f5 100644 --- a/contracts/release/extensions/external-position-manager/ExternalPositionManager.sol +++ b/contracts/release/extensions/external-position-manager/ExternalPositionManager.sol @@ -11,14 +11,15 @@ pragma solidity 0.6.12; -import "../../../persistent/external-positions/IExternalPosition.sol"; -import "../../../persistent/external-positions/IExternalPositionFactory.sol"; -import "../../../persistent/external-positions/IExternalPositionProxy.sol"; -import "../policy-manager/IPolicyManager.sol"; -import "../utils/ExtensionBase.sol"; -import "../utils/PermissionedVaultActionMixin.sol"; -import "./external-positions/IExternalPositionParser.sol"; -import "./IExternalPositionManager.sol"; +import {IExternalPosition} from "../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPositionFactory} from "../../../persistent/external-positions/IExternalPositionFactory.sol"; +import {IExternalPositionProxy} from "../../../persistent/external-positions/IExternalPositionProxy.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; +import {IPolicyManager} from "../policy-manager/IPolicyManager.sol"; +import {ExtensionBase} from "../utils/ExtensionBase.sol"; +import {PermissionedVaultActionMixin} from "../utils/PermissionedVaultActionMixin.sol"; +import {IExternalPositionParser} from "./external-positions/IExternalPositionParser.sol"; +import {IExternalPositionManager} from "./IExternalPositionManager.sol"; /// @title ExternalPositionManager /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionLib.sol index 668139062..367c3fdce 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionLib.sol @@ -9,17 +9,19 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/IAaveV2IncentivesController.sol"; -import "../../../../../external-interfaces/IAaveV2LendingPool.sol"; -import "../../../../../external-interfaces/IAaveV2LendingPoolAddressProvider.sol"; -import "../../../../../external-interfaces/IAaveV2ProtocolDataProvider.sol"; -import "../../../../../persistent/external-positions/aave-v2-debt/AaveDebtPositionLibBase1.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "./AaveDebtPositionDataDecoder.sol"; -import "./IAaveDebtPosition.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IAaveV2IncentivesController} from "../../../../../external-interfaces/IAaveV2IncentivesController.sol"; +import {IAaveV2LendingPool} from "../../../../../external-interfaces/IAaveV2LendingPool.sol"; +import {IAaveV2LendingPoolAddressProvider} from + "../../../../../external-interfaces/IAaveV2LendingPoolAddressProvider.sol"; +import {IAaveV2ProtocolDataProvider} from "../../../../../external-interfaces/IAaveV2ProtocolDataProvider.sol"; +import {AaveDebtPositionLibBase1} from + "../../../../../persistent/external-positions/aave-v2-debt/AaveDebtPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {AaveDebtPositionDataDecoder} from "./AaveDebtPositionDataDecoder.sol"; +import {IAaveDebtPosition} from "./IAaveDebtPosition.sol"; /// @title AaveDebtPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionParser.sol index f959b3fab..f1dce88eb 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/AaveDebtPositionParser.sol @@ -9,10 +9,11 @@ file that was distributed with this source code. */ -import "../../../../infrastructure/value-interpreter/ValueInterpreter.sol"; -import "../IExternalPositionParser.sol"; -import "./AaveDebtPositionDataDecoder.sol"; -import "./IAaveDebtPosition.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IValueInterpreter} from "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {AaveDebtPositionDataDecoder} from "./AaveDebtPositionDataDecoder.sol"; +import {IAaveDebtPosition} from "./IAaveDebtPosition.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/IAaveDebtPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/IAaveDebtPosition.sol index 971d10147..b715a2423 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/IAaveDebtPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/aave-v2-debt/IAaveDebtPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionLib.sol index cb0f0bb29..f9aa20a91 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionLib.sol @@ -9,19 +9,20 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "openzeppelin-solc-0.6/utils/SafeCast.sol"; -import "../../../../../external-interfaces/IWETH.sol"; -import "../../../../../persistent/external-positions/arbitrary-loan/ArbitraryLoanPositionLibBase1.sol"; -import "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../../utils/0.6.12/MathHelpers.sol"; -import "./modules/IArbitraryLoanAccountingModule.sol"; -import "./IArbitraryLoanPosition.sol"; -import "./ArbitraryLoanPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {SafeCast} from "openzeppelin-solc-0.6/utils/SafeCast.sol"; +import {IWETH} from "../../../../../external-interfaces/IWETH.sol"; +import {ArbitraryLoanPositionLibBase1} from + "../../../../../persistent/external-positions/arbitrary-loan/ArbitraryLoanPositionLibBase1.sol"; +import {IExternalPositionProxy} from "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {MathHelpers} from "../../../../../utils/0.6.12/MathHelpers.sol"; +import {IArbitraryLoanAccountingModule} from "./modules/IArbitraryLoanAccountingModule.sol"; +import {IArbitraryLoanPosition} from "./IArbitraryLoanPosition.sol"; +import {ArbitraryLoanPositionDataDecoder} from "./ArbitraryLoanPositionDataDecoder.sol"; /// @title ArbitraryLoanPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionParser.sol index df725b36b..a21c35f19 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/ArbitraryLoanPositionParser.sol @@ -9,11 +9,11 @@ file that was distributed with this source code. */ -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../IExternalPositionParser.sol"; -import "./IArbitraryLoanPosition.sol"; -import "./ArbitraryLoanPositionDataDecoder.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {IArbitraryLoanPosition} from "./IArbitraryLoanPosition.sol"; +import {ArbitraryLoanPositionDataDecoder} from "./ArbitraryLoanPositionDataDecoder.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/IArbitraryLoanPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/IArbitraryLoanPosition.sol index bc6c71d69..16b12fab4 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/IArbitraryLoanPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/IArbitraryLoanPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/modules/ArbitraryLoanTotalNominalDeltaOracleModule.sol b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/modules/ArbitraryLoanTotalNominalDeltaOracleModule.sol index 15077e903..d1b415d15 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/modules/ArbitraryLoanTotalNominalDeltaOracleModule.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/arbitrary-loan/modules/ArbitraryLoanTotalNominalDeltaOracleModule.sol @@ -12,10 +12,10 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/math/SignedSafeMath.sol"; -import "./IArbitraryLoanAccountingModule.sol"; -import "../../../../../../persistent/arbitrary-value-oracles/IArbitraryValueOracle.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {SignedSafeMath} from "openzeppelin-solc-0.6/math/SignedSafeMath.sol"; +import {IArbitraryLoanAccountingModule} from "./IArbitraryLoanAccountingModule.sol"; +import {IArbitraryValueOracle} from "../../../../../../persistent/arbitrary-value-oracles/IArbitraryValueOracle.sol"; /// @title ArbitraryLoanTotalNominalDeltaOracleModule Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionLib.sol index 0ad4e20dc..16813057e 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionLib.sol @@ -9,16 +9,17 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/ICERC20.sol"; -import "../../../../../external-interfaces/ICEther.sol"; -import "../../../../../external-interfaces/ICompoundComptroller.sol"; -import "../../../../../external-interfaces/IWETH.sol"; -import "../../../../../persistent/external-positions/compound-debt/CompoundDebtPositionLibBase1.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "./ICompoundDebtPosition.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {ICERC20} from "../../../../../external-interfaces/ICERC20.sol"; +import {ICEther} from "../../../../../external-interfaces/ICEther.sol"; +import {ICompoundComptroller} from "../../../../../external-interfaces/ICompoundComptroller.sol"; +import {IWETH} from "../../../../../external-interfaces/IWETH.sol"; +import {CompoundDebtPositionLibBase1} from + "../../../../../persistent/external-positions/compound-debt/CompoundDebtPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {ICompoundDebtPosition} from "./ICompoundDebtPosition.sol"; /// @title CompoundDebtPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionParser.sol index 26e60c80b..649cf5263 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/CompoundDebtPositionParser.sol @@ -9,10 +9,11 @@ file that was distributed with this source code. */ -import "../../../../infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol"; -import "../../../../infrastructure/value-interpreter/ValueInterpreter.sol"; -import "../IExternalPositionParser.sol"; -import "./ICompoundDebtPosition.sol"; +import {ICERC20} from "../../../../../external-interfaces/ICERC20.sol"; +import {CompoundPriceFeed} from "../../../../infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol"; +import {IValueInterpreter} from "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {ICompoundDebtPosition} from "./ICompoundDebtPosition.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/ICompoundDebtPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/ICompoundDebtPosition.sol index f2bf33473..a74b06bf6 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/compound-debt/ICompoundDebtPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/compound-debt/ICompoundDebtPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionDataDecoder.sol b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionDataDecoder.sol index 07048b4a0..fa52b0ff4 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionDataDecoder.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionDataDecoder.sol @@ -10,7 +10,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../external-interfaces/IVotiumMultiMerkleStash.sol"; +import {IVotiumMultiMerkleStash} from "../../../../../external-interfaces/IVotiumMultiMerkleStash.sol"; /// @title ConvexVotingPositionDataDecoder Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionLib.sol index b01462e13..2bc275d04 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionLib.sol @@ -10,16 +10,17 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/IConvexBaseRewardPool.sol"; -import "../../../../../external-interfaces/IConvexCvxLockerV2.sol"; -import "../../../../../external-interfaces/IConvexVlCvxExtraRewardDistribution.sol"; -import "../../../../../external-interfaces/ISnapshotDelegateRegistry.sol"; -import "../../../../../external-interfaces/IVotiumMultiMerkleStash.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "./ConvexVotingPositionDataDecoder.sol"; -import "./IConvexVotingPosition.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IConvexBaseRewardPool} from "../../../../../external-interfaces/IConvexBaseRewardPool.sol"; +import {IConvexCvxLockerV2} from "../../../../../external-interfaces/IConvexCvxLockerV2.sol"; +import {IConvexVlCvxExtraRewardDistribution} from + "../../../../../external-interfaces/IConvexVlCvxExtraRewardDistribution.sol"; +import {ISnapshotDelegateRegistry} from "../../../../../external-interfaces/ISnapshotDelegateRegistry.sol"; +import {IVotiumMultiMerkleStash} from "../../../../../external-interfaces/IVotiumMultiMerkleStash.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ConvexVotingPositionDataDecoder} from "./ConvexVotingPositionDataDecoder.sol"; +import {IConvexVotingPosition} from "./IConvexVotingPosition.sol"; /// @title ConvexVotingPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionParser.sol index 96d84ec97..82bff878a 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/ConvexVotingPositionParser.sol @@ -9,9 +9,9 @@ file that was distributed with this source code. */ -import "../IExternalPositionParser.sol"; -import "./ConvexVotingPositionDataDecoder.sol"; -import "./IConvexVotingPosition.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {ConvexVotingPositionDataDecoder} from "./ConvexVotingPositionDataDecoder.sol"; +import {IConvexVotingPosition} from "./IConvexVotingPosition.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/IConvexVotingPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/IConvexVotingPosition.sol index 3500877af..ffde72583 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/convex-voting/IConvexVotingPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/convex-voting/IConvexVotingPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/ILiquityDebtPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/ILiquityDebtPosition.sol index c92f86344..28193cb7c 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/ILiquityDebtPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/ILiquityDebtPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionLib.sol index 8faeeab2d..a1915b285 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionLib.sol @@ -9,13 +9,13 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/ILiquityBorrowerOperations.sol"; -import "../../../../../external-interfaces/ILiquityTroveManager.sol"; -import "../../../../../external-interfaces/IWETH.sol"; -import "./ILiquityDebtPosition.sol"; -import "./LiquityDebtPositionDataDecoder.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {ILiquityBorrowerOperations} from "../../../../../external-interfaces/ILiquityBorrowerOperations.sol"; +import {ILiquityTroveManager} from "../../../../../external-interfaces/ILiquityTroveManager.sol"; +import {IWETH} from "../../../../../external-interfaces/IWETH.sol"; +import {ILiquityDebtPosition} from "./ILiquityDebtPosition.sol"; +import {LiquityDebtPositionDataDecoder} from "./LiquityDebtPositionDataDecoder.sol"; /// @title LiquityDebtPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionParser.sol index 28e72f80b..63fabe3e5 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/liquity-debt/LiquityDebtPositionParser.sol @@ -9,10 +9,10 @@ file that was distributed with this source code. */ -import "../../../../../external-interfaces/ILiquityTroveManager.sol"; -import "../IExternalPositionParser.sol"; -import "./ILiquityDebtPosition.sol"; -import "./LiquityDebtPositionDataDecoder.sol"; +import {ILiquityTroveManager} from "../../../../../external-interfaces/ILiquityTroveManager.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {ILiquityDebtPosition} from "./ILiquityDebtPosition.sol"; +import {LiquityDebtPositionDataDecoder} from "./LiquityDebtPositionDataDecoder.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/IMapleLiquidityPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/IMapleLiquidityPosition.sol index 94073bb54..f40a3b6f4 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/IMapleLiquidityPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/IMapleLiquidityPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionLib.sol index 3e39929bf..6fb2001eb 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionLib.sol @@ -9,21 +9,23 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/IMapleV1MplRewards.sol"; -import "../../../../../external-interfaces/IMapleV1Pool.sol"; -import "../../../../../external-interfaces/IMapleV2Pool.sol"; -import "../../../../../external-interfaces/IMapleV2PoolManager.sol"; -import "../../../../../external-interfaces/IMapleV2WithdrawalManager.sol"; -import "../../../../../persistent/external-positions/maple-liquidity/MapleLiquidityPositionLibBase2.sol"; -import "../../../../../persistent/external-positions/maple-liquidity/MapleV1ToV2PoolMapper.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; -import "./IMapleLiquidityPosition.sol"; -import "./MapleLiquidityPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IMapleV1MplRewards} from "../../../../../external-interfaces/IMapleV1MplRewards.sol"; +import {IMapleV1Pool} from "../../../../../external-interfaces/IMapleV1Pool.sol"; +import {IMapleV2Pool} from "../../../../../external-interfaces/IMapleV2Pool.sol"; +import {IMapleV2PoolManager} from "../../../../../external-interfaces/IMapleV2PoolManager.sol"; +import {IMapleV2WithdrawalManager} from "../../../../../external-interfaces/IMapleV2WithdrawalManager.sol"; +import {MapleLiquidityPositionLibBase2} from + "../../../../../persistent/external-positions/maple-liquidity/MapleLiquidityPositionLibBase2.sol"; +import {MapleV1ToV2PoolMapper} from + "../../../../../persistent/external-positions/maple-liquidity/MapleV1ToV2PoolMapper.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {Uint256ArrayLib} from "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; +import {IMapleLiquidityPosition} from "./IMapleLiquidityPosition.sol"; +import {MapleLiquidityPositionDataDecoder} from "./MapleLiquidityPositionDataDecoder.sol"; /// @title MapleLiquidityPositionLib Contract /// @author Enzyme Council @@ -233,7 +235,7 @@ contract MapleLiquidityPositionLib is /// @dev Helper to get total pool token v2 balance, including escrowed amount function __getTotalPoolTokenV2Balance(address _pool) private view returns (uint256 balance_) { - balance_ = IERC20(_pool).balanceOf(address(this)); + balance_ = ERC20(_pool).balanceOf(address(this)); // According to Maple's WithdrawalManager code comments, IMapleV2PoolManager.withdrawalManager // can be set to address(0) in order to pause redemptions, which would cause this to revert. diff --git a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionParser.sol index efac372bb..fc9c8834d 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/maple-liquidity/MapleLiquidityPositionParser.sol @@ -9,14 +9,14 @@ file that was distributed with this source code. */ -import "../../../../../external-interfaces/IMapleV1MplRewardsFactory.sol"; -import "../../../../../external-interfaces/IMapleV2Globals.sol"; -import "../../../../../external-interfaces/IMapleV2Pool.sol"; -import "../../../../../external-interfaces/IMapleV2PoolManager.sol"; -import "../../../../../external-interfaces/IMapleV2ProxyFactory.sol"; -import "../IExternalPositionParser.sol"; -import "./IMapleLiquidityPosition.sol"; -import "./MapleLiquidityPositionDataDecoder.sol"; +import {IMapleV1MplRewardsFactory} from "../../../../../external-interfaces/IMapleV1MplRewardsFactory.sol"; +import {IMapleV2Globals} from "../../../../../external-interfaces/IMapleV2Globals.sol"; +import {IMapleV2Pool} from "../../../../../external-interfaces/IMapleV2Pool.sol"; +import {IMapleV2PoolManager} from "../../../../../external-interfaces/IMapleV2PoolManager.sol"; +import {IMapleV2ProxyFactory} from "../../../../../external-interfaces/IMapleV2ProxyFactory.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {IMapleLiquidityPosition} from "./IMapleLiquidityPosition.sol"; +import {MapleLiquidityPositionDataDecoder} from "./MapleLiquidityPositionDataDecoder.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/INotionalV2Position.sol b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/INotionalV2Position.sol index a6cf04d0b..5a1a56e55 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/INotionalV2Position.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/INotionalV2Position.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionLib.sol index af8dce204..ddb67c9b6 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionLib.sol @@ -10,14 +10,14 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/INotionalV2Router.sol"; -import "../../../../../external-interfaces/IWETH.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "./INotionalV2Position.sol"; -import "./NotionalV2PositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {INotionalV2Router} from "../../../../../external-interfaces/INotionalV2Router.sol"; +import {IWETH} from "../../../../../external-interfaces/IWETH.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {INotionalV2Position} from "./INotionalV2Position.sol"; +import {NotionalV2PositionDataDecoder} from "./NotionalV2PositionDataDecoder.sol"; /// @title NotionalV2PositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionParser.sol index 9c3e38358..f25747643 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/notional-v2/NotionalV2PositionParser.sol @@ -12,10 +12,10 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../external-interfaces/INotionalV2Router.sol"; -import "../IExternalPositionParser.sol"; -import "./INotionalV2Position.sol"; -import "./NotionalV2PositionDataDecoder.sol"; +import {INotionalV2Router} from "../../../../../external-interfaces/INotionalV2Router.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {INotionalV2Position} from "./INotionalV2Position.sol"; +import {NotionalV2PositionDataDecoder} from "./NotionalV2PositionDataDecoder.sol"; /// @title NotionalV2PositionParser /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/ISolvV2BondBuyerPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/ISolvV2BondBuyerPosition.sol index 344debb7a..b3c20f6ff 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/ISolvV2BondBuyerPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/ISolvV2BondBuyerPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; pragma experimental ABIEncoderV2; diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLib.sol index 191b63483..31cbb00a2 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLib.sol @@ -10,17 +10,20 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; -import "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; -import "../../../../../persistent/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLibBase1.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; -import "./ISolvV2BondBuyerPosition.sol"; -import "./SolvV2BondBuyerPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {ISolvV2BondPool} from "../../../../../external-interfaces/ISolvV2BondPool.sol"; +import {ISolvV2BondVoucher} from "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; +import {ISolvV2InitialConvertibleOfferingMarket} from + "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; +import {SolvV2BondBuyerPositionLibBase1} from + "../../../../../persistent/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {Uint256ArrayLib} from "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; +import {ISolvV2BondBuyerPosition} from "./ISolvV2BondBuyerPosition.sol"; +import {SolvV2BondBuyerPositionDataDecoder} from "./SolvV2BondBuyerPositionDataDecoder.sol"; /// @title SolvV2BondBuyerPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionParser.sol index 1fe4f144f..3f953323c 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-buyer/SolvV2BondBuyerPositionParser.sol @@ -7,13 +7,14 @@ file that was distributed with this source code. */ -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../../external-interfaces/ISolvV2BondPool.sol"; -import "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; -import "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; -import "../IExternalPositionParser.sol"; -import "./ISolvV2BondBuyerPosition.sol"; -import "./SolvV2BondBuyerPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ISolvV2BondPool} from "../../../../../external-interfaces/ISolvV2BondPool.sol"; +import {ISolvV2BondVoucher} from "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; +import {ISolvV2InitialConvertibleOfferingMarket} from + "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {ISolvV2BondBuyerPosition} from "./ISolvV2BondBuyerPosition.sol"; +import {SolvV2BondBuyerPositionDataDecoder} from "./SolvV2BondBuyerPositionDataDecoder.sol"; pragma solidity 0.6.12; pragma experimental ABIEncoderV2; diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/ISolvV2BondIssuerPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/ISolvV2BondIssuerPosition.sol index a99c6ae9b..f97c1b84b 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/ISolvV2BondIssuerPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/ISolvV2BondIssuerPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; pragma experimental ABIEncoderV2; diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionDataDecoder.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionDataDecoder.sol index c46a03c16..bb5398028 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionDataDecoder.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionDataDecoder.sol @@ -10,7 +10,8 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; +import {ISolvV2InitialConvertibleOfferingMarket} from + "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; /// @title SolvV2BondIssuerPositionDataDecoder Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLib.sol index dfb629234..a63353c57 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLib.sol @@ -10,18 +10,20 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/ISolvV2BondPool.sol"; -import "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; -import "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; -import "../../../../../persistent/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLibBase1.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; -import "./ISolvV2BondIssuerPosition.sol"; -import "./SolvV2BondIssuerPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {ISolvV2BondPool} from "../../../../../external-interfaces/ISolvV2BondPool.sol"; +import {ISolvV2BondVoucher} from "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; +import {ISolvV2InitialConvertibleOfferingMarket} from + "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; +import {SolvV2BondIssuerPositionLibBase1} from + "../../../../../persistent/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../../utils/0.6.12/AssetHelpers.sol"; +import {Uint256ArrayLib} from "../../../../../utils/0.6.12/Uint256ArrayLib.sol"; +import {ISolvV2BondIssuerPosition} from "./ISolvV2BondIssuerPosition.sol"; +import {SolvV2BondIssuerPositionDataDecoder} from "./SolvV2BondIssuerPositionDataDecoder.sol"; /// @title SolvV2BondIssuerPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionParser.sol index 07f8ed171..b062299d6 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/solv-v2-bond-issuer/SolvV2BondIssuerPositionParser.sol @@ -7,14 +7,17 @@ file that was distributed with this source code. */ -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/ISolvV2BondPool.sol"; -import "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../IExternalPositionParser.sol"; -import "./ISolvV2BondIssuerPosition.sol"; -import "./SolvV2BondIssuerPositionDataDecoder.sol"; -import "./SolvV2BondIssuerPositionLib.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {ISolvV2BondPool} from "../../../../../external-interfaces/ISolvV2BondPool.sol"; +import {ISolvV2BondVoucher} from "../../../../../external-interfaces/ISolvV2BondVoucher.sol"; +import {ISolvV2InitialConvertibleOfferingMarket} from + "../../../../../external-interfaces/ISolvV2InitialConvertibleOfferingMarket.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {ISolvV2BondIssuerPosition} from "./ISolvV2BondIssuerPosition.sol"; +import {SolvV2BondIssuerPositionDataDecoder} from "./SolvV2BondIssuerPositionDataDecoder.sol"; +import {SolvV2BondIssuerPositionLib} from "./SolvV2BondIssuerPositionLib.sol"; pragma solidity 0.6.12; pragma experimental ABIEncoderV2; diff --git a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/IStakeWiseV3StakingPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/IStakeWiseV3StakingPosition.sol index f27ee01f1..c75f0a8a1 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/IStakeWiseV3StakingPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/IStakeWiseV3StakingPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionDataDecoder.sol b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionDataDecoder.sol index 730421994..4f72f624e 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionDataDecoder.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionDataDecoder.sol @@ -9,8 +9,8 @@ pragma solidity 0.8.19; -import "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; -import "./IStakeWiseV3StakingPosition.sol"; +import {IStakeWiseV3EthVault} from "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; +import {IStakeWiseV3StakingPosition} from "./IStakeWiseV3StakingPosition.sol"; /// @title StakeWiseV3StakingPositionDataDecoder Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLib.sol index a835189a9..d8a01f10d 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLib.sol @@ -9,14 +9,16 @@ pragma solidity 0.8.19; -import "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; -import "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; -import "../../../../../external-interfaces/IWETH.sol"; -import "../../../../../persistent/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLibBase1.sol"; -import "../../../../../utils/0.8.19/AddressArrayLib.sol"; -import "./IStakeWiseV3StakingPosition.sol"; -import "./StakeWiseV3StakingPositionDataDecoder.sol"; +import {ERC20} from "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; +import {Address} from "openzeppelin-solc-0.8/utils/Address.sol"; +import {IStakeWiseV3EthVault} from "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; +import {IWETH} from "../../../../../external-interfaces/IWETH.sol"; +import {StakeWiseV3StakingPositionLibBase1} from + "../../../../../persistent/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.8.19/AddressArrayLib.sol"; +import {IStakeWiseV3StakingPosition} from "./IStakeWiseV3StakingPosition.sol"; +import {StakeWiseV3StakingPositionDataDecoder} from "./StakeWiseV3StakingPositionDataDecoder.sol"; /// @title StakeWiseV3StakingPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionParser.sol index 859067b1e..be31a6782 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/stakewise-v3-staking/StakeWiseV3StakingPositionParser.sol @@ -9,11 +9,11 @@ file that was distributed with this source code. */ -import "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; -import "../../../../../external-interfaces/IStakeWiseV3VaultsRegistry.sol"; -import "../IExternalPositionParser.sol"; -import "./IStakeWiseV3StakingPosition.sol"; -import "./StakeWiseV3StakingPositionDataDecoder.sol"; +import {IStakeWiseV3EthVault} from "../../../../../external-interfaces/IStakeWiseV3EthVault.sol"; +import {IStakeWiseV3VaultsRegistry} from "../../../../../external-interfaces/IStakeWiseV3VaultsRegistry.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {IStakeWiseV3StakingPosition} from "./IStakeWiseV3StakingPosition.sol"; +import {StakeWiseV3StakingPositionDataDecoder} from "./StakeWiseV3StakingPositionDataDecoder.sol"; pragma solidity 0.8.19; diff --git a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/ITheGraphDelegationPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/ITheGraphDelegationPosition.sol index 8f4ab9208..f5e85ea06 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/ITheGraphDelegationPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/ITheGraphDelegationPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionLib.sol index 12eb78ee5..a0a29e60f 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionLib.sol @@ -9,14 +9,15 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../external-interfaces/ITheGraphStaking.sol"; -import "../../../../../persistent/external-positions/the-graph-delegation/TheGraphDelegationPositionLibBase1.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "./ITheGraphDelegationPosition.sol"; -import "./TheGraphDelegationPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {ITheGraphStaking} from "../../../../../external-interfaces/ITheGraphStaking.sol"; +import {TheGraphDelegationPositionLibBase1} from + "../../../../../persistent/external-positions/the-graph-delegation/TheGraphDelegationPositionLibBase1.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {ITheGraphDelegationPosition} from "./ITheGraphDelegationPosition.sol"; +import {TheGraphDelegationPositionDataDecoder} from "./TheGraphDelegationPositionDataDecoder.sol"; /// @title TheGraphDelegationPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionParser.sol index 9f83c553a..abd1bbf6b 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/the-graph-delegation/TheGraphDelegationPositionParser.sol @@ -7,9 +7,9 @@ file that was distributed with this source code. */ -import "../IExternalPositionParser.sol"; -import "./TheGraphDelegationPositionDataDecoder.sol"; -import "./ITheGraphDelegationPosition.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {TheGraphDelegationPositionDataDecoder} from "./TheGraphDelegationPositionDataDecoder.sol"; +import {ITheGraphDelegationPosition} from "./ITheGraphDelegationPosition.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/IUniswapV3LiquidityPosition.sol b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/IUniswapV3LiquidityPosition.sol index 921bb6483..1fbe78ee7 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/IUniswapV3LiquidityPosition.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/IUniswapV3LiquidityPosition.sol @@ -7,7 +7,7 @@ file that was distributed with this source code. */ -import "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; pragma solidity >=0.6.0 <0.9.0; diff --git a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLib.sol b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLib.sol index df6d9dc4a..ea3a9ddb6 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLib.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLib.sol @@ -10,15 +10,16 @@ pragma solidity 0.7.6; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.7/math/SafeMath.sol"; -import "openzeppelin-solc-0.7/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.7/token/ERC20/SafeERC20.sol"; -import "uniswap-v3-periphery/interfaces/INonfungiblePositionManager.sol"; -import "uniswap-v3-periphery/libraries/PositionValue.sol"; -import "../../../../../persistent/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLibBase1.sol"; -import "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; -import "./IUniswapV3LiquidityPosition.sol"; -import "./UniswapV3LiquidityPositionDataDecoder.sol"; +import {SafeMath} from "openzeppelin-solc-0.7/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.7/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.7/token/ERC20/SafeERC20.sol"; +import {INonfungiblePositionManager} from "uniswap-v3-periphery/interfaces/INonfungiblePositionManager.sol"; +import {PositionValue} from "uniswap-v3-periphery/libraries/PositionValue.sol"; +import {UniswapV3LiquidityPositionLibBase1} from + "../../../../../persistent/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionLibBase1.sol"; +import {IValueInterpreter} from "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IUniswapV3LiquidityPosition} from "./IUniswapV3LiquidityPosition.sol"; +import {UniswapV3LiquidityPositionDataDecoder} from "./UniswapV3LiquidityPositionDataDecoder.sol"; /// @title UniswapV3LiquidityPositionLib Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionParser.sol b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionParser.sol index ba99e38dc..8a9e8ec56 100644 --- a/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionParser.sol +++ b/contracts/release/extensions/external-position-manager/external-positions/uniswap-v3-liquidity/UniswapV3LiquidityPositionParser.sol @@ -9,11 +9,11 @@ file that was distributed with this source code. */ -import "openzeppelin-solc-0.7/token/ERC721/ERC721.sol"; -import "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; -import "../IExternalPositionParser.sol"; -import "./IUniswapV3LiquidityPosition.sol"; -import "./UniswapV3LiquidityPositionDataDecoder.sol"; +import {ERC721} from "openzeppelin-solc-0.7/token/ERC721/ERC721.sol"; +import {IValueInterpreter} from "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IExternalPositionParser} from "../IExternalPositionParser.sol"; +import {IUniswapV3LiquidityPosition} from "./IUniswapV3LiquidityPosition.sol"; +import {UniswapV3LiquidityPositionDataDecoder} from "./UniswapV3LiquidityPositionDataDecoder.sol"; pragma solidity 0.7.6; diff --git a/contracts/release/extensions/fee-manager/FeeManager.sol b/contracts/release/extensions/fee-manager/FeeManager.sol index 637f8e5a9..ca799e2e7 100644 --- a/contracts/release/extensions/fee-manager/FeeManager.sol +++ b/contracts/release/extensions/fee-manager/FeeManager.sol @@ -12,14 +12,14 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../core/fund/comptroller/IComptroller.sol"; -import "../../core/fund/vault/IVault.sol"; -import "../utils/ExtensionBase.sol"; -import "../utils/PermissionedVaultActionMixin.sol"; -import "./IFee.sol"; -import "./IFeeManager.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {AddressArrayLib} from "../../../utils/0.6.12/AddressArrayLib.sol"; +import {IComptroller} from "../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; +import {ExtensionBase} from "../utils/ExtensionBase.sol"; +import {PermissionedVaultActionMixin} from "../utils/PermissionedVaultActionMixin.sol"; +import {IFee} from "./IFee.sol"; +import {IFeeManager} from "./IFeeManager.sol"; /// @title FeeManager Contract /// @author Enzyme Council @@ -326,7 +326,12 @@ contract FeeManager is IFeeManager, ExtensionBase, PermissionedVaultActionMixin /// @notice Get a list of enabled fees for a given fund /// @param _comptrollerProxy The ComptrollerProxy of the fund /// @return enabledFees_ An array of enabled fee addresses - function getEnabledFeesForFund(address _comptrollerProxy) public view returns (address[] memory enabledFees_) { + function getEnabledFeesForFund(address _comptrollerProxy) + public + view + override + returns (address[] memory enabledFees_) + { return comptrollerProxyToFees[_comptrollerProxy]; } diff --git a/contracts/release/extensions/fee-manager/IFee.sol b/contracts/release/extensions/fee-manager/IFee.sol index aee6db05a..7341ee7d7 100644 --- a/contracts/release/extensions/fee-manager/IFee.sol +++ b/contracts/release/extensions/fee-manager/IFee.sol @@ -11,7 +11,7 @@ pragma solidity >=0.6.0 <0.9.0; -import "./IFeeManager.sol"; +import {IFeeManager} from "./IFeeManager.sol"; /// @title Fee Interface /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/IFeeManager.sol b/contracts/release/extensions/fee-manager/IFeeManager.sol index b5c80832e..4c3570ed8 100644 --- a/contracts/release/extensions/fee-manager/IFeeManager.sol +++ b/contracts/release/extensions/fee-manager/IFeeManager.sol @@ -32,5 +32,7 @@ interface IFeeManager { BurnSharesOutstanding } + function getEnabledFeesForFund(address _comptrollerProxy) external view returns (address[] memory enabledFees_); + function invokeHook(FeeHook, bytes calldata, uint256) external; } diff --git a/contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol b/contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol index acae73d32..3529cfb36 100644 --- a/contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol +++ b/contracts/release/extensions/fee-manager/fees/EntranceRateBurnFee.sol @@ -11,7 +11,8 @@ pragma solidity 0.6.12; -import "./utils/EntranceRateFeeBase.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {EntranceRateFeeBase} from "./utils/EntranceRateFeeBase.sol"; /// @title EntranceRateBurnFee Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/EntranceRateDirectFee.sol b/contracts/release/extensions/fee-manager/fees/EntranceRateDirectFee.sol index 5d4498fc2..c22d5abe6 100644 --- a/contracts/release/extensions/fee-manager/fees/EntranceRateDirectFee.sol +++ b/contracts/release/extensions/fee-manager/fees/EntranceRateDirectFee.sol @@ -11,8 +11,11 @@ pragma solidity 0.6.12; -import "./utils/EntranceRateFeeBase.sol"; -import "./utils/UpdatableFeeRecipientBase.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {EntranceRateFeeBase} from "./utils/EntranceRateFeeBase.sol"; +import {FeeBase} from "./utils/FeeBase.sol"; +import {SettableFeeRecipientBase} from "./utils/SettableFeeRecipientBase.sol"; +import {UpdatableFeeRecipientBase} from "./utils/UpdatableFeeRecipientBase.sol"; /// @title EntranceRateDirectFee Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/ExitRateBurnFee.sol b/contracts/release/extensions/fee-manager/fees/ExitRateBurnFee.sol index 8f1bb744e..1cd169767 100644 --- a/contracts/release/extensions/fee-manager/fees/ExitRateBurnFee.sol +++ b/contracts/release/extensions/fee-manager/fees/ExitRateBurnFee.sol @@ -11,7 +11,8 @@ pragma solidity 0.6.12; -import "./utils/ExitRateFeeBase.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {ExitRateFeeBase} from "./utils/ExitRateFeeBase.sol"; /// @title ExitRateBurnFee Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/ExitRateDirectFee.sol b/contracts/release/extensions/fee-manager/fees/ExitRateDirectFee.sol index c1a9e27db..c63cb0798 100644 --- a/contracts/release/extensions/fee-manager/fees/ExitRateDirectFee.sol +++ b/contracts/release/extensions/fee-manager/fees/ExitRateDirectFee.sol @@ -11,8 +11,11 @@ pragma solidity 0.6.12; -import "./utils/ExitRateFeeBase.sol"; -import "./utils/UpdatableFeeRecipientBase.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {ExitRateFeeBase} from "./utils/ExitRateFeeBase.sol"; +import {FeeBase} from "./utils/FeeBase.sol"; +import {SettableFeeRecipientBase} from "./utils/SettableFeeRecipientBase.sol"; +import {UpdatableFeeRecipientBase} from "./utils/UpdatableFeeRecipientBase.sol"; /// @title ExitRateDirectFee Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/ManagementFee.sol b/contracts/release/extensions/fee-manager/fees/ManagementFee.sol index c867804cd..70b504440 100644 --- a/contracts/release/extensions/fee-manager/fees/ManagementFee.sol +++ b/contracts/release/extensions/fee-manager/fees/ManagementFee.sol @@ -12,11 +12,14 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../utils/0.6.12/MakerDaoMath.sol"; -import "../../../core/fund/vault/VaultLib.sol"; -import "./utils/FeeBase.sol"; -import "./utils/UpdatableFeeRecipientBase.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {MakerDaoMath} from "../../../../utils/0.6.12/MakerDaoMath.sol"; +import {IVault} from "../../../core/fund/vault/IVault.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {FeeBase} from "./utils/FeeBase.sol"; +import {SettableFeeRecipientBase} from "./utils/SettableFeeRecipientBase.sol"; +import {UpdatableFeeRecipientBase} from "./utils/UpdatableFeeRecipientBase.sol"; /// @title ManagementFee Contract /// @author Enzyme Council @@ -50,7 +53,7 @@ contract ManagementFee is FeeBase, UpdatableFeeRecipientBase, MakerDaoMath { /// @param _vaultProxy The VaultProxy of the fund function activateForFund(address _comptrollerProxy, address _vaultProxy) external override onlyFeeManager { // It is only necessary to set `lastSettled` for a migrated fund - if (VaultLib(payable(_vaultProxy)).totalSupply() > 0) { + if (ERC20(_vaultProxy).totalSupply() > 0) { comptrollerProxyToFeeInfo[_comptrollerProxy].lastSettled = uint128(block.timestamp); emit ActivatedForMigratedFund(_comptrollerProxy); @@ -99,13 +102,13 @@ contract ManagementFee is FeeBase, UpdatableFeeRecipientBase, MakerDaoMath { } // If there are shares issued for the fund, calculate the shares due - VaultLib vaultProxyContract = VaultLib(payable(_vaultProxy)); - uint256 sharesSupply = vaultProxyContract.totalSupply(); + ERC20 sharesToken = ERC20(_vaultProxy); + uint256 sharesSupply = sharesToken.totalSupply(); if (sharesSupply > 0) { // This assumes that all shares in the VaultProxy are shares outstanding, // which is fine for this release. Even if they are not, they are still shares that // are only claimable by the fund owner. - uint256 netSharesSupply = sharesSupply.sub(vaultProxyContract.balanceOf(_vaultProxy)); + uint256 netSharesSupply = sharesSupply.sub(sharesToken.balanceOf(_vaultProxy)); if (netSharesSupply > 0) { sharesDue_ = netSharesSupply.mul( __rpow(feeInfo.scaledPerSecondRate, secondsSinceSettlement, RATE_SCALE_BASE).sub(RATE_SCALE_BASE) diff --git a/contracts/release/extensions/fee-manager/fees/MinSharesSupplyFee.sol b/contracts/release/extensions/fee-manager/fees/MinSharesSupplyFee.sol index 213f48bd8..80e5432f0 100644 --- a/contracts/release/extensions/fee-manager/fees/MinSharesSupplyFee.sol +++ b/contracts/release/extensions/fee-manager/fees/MinSharesSupplyFee.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "./utils/FeeBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {FeeBase} from "./utils/FeeBase.sol"; /// @title MinSharesSupplyFee Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/PerformanceFee.sol b/contracts/release/extensions/fee-manager/fees/PerformanceFee.sol index 21e551693..df9af2fb4 100644 --- a/contracts/release/extensions/fee-manager/fees/PerformanceFee.sol +++ b/contracts/release/extensions/fee-manager/fees/PerformanceFee.sol @@ -12,12 +12,13 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../FeeManager.sol"; -import "./utils/FeeBase.sol"; -import "./utils/UpdatableFeeRecipientBase.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IComptroller} from "../../../core/fund/comptroller/IComptroller.sol"; +import {IFeeManager} from "../IFeeManager.sol"; +import {FeeBase} from "./utils/FeeBase.sol"; +import {SettableFeeRecipientBase} from "./utils/SettableFeeRecipientBase.sol"; +import {UpdatableFeeRecipientBase} from "./utils/UpdatableFeeRecipientBase.sol"; /// @title PerformanceFee Contract /// @author Enzyme Council @@ -55,7 +56,7 @@ contract PerformanceFee is FeeBase, UpdatableFeeRecipientBase { function activateForFund(address _comptrollerProxy, address) external override onlyFeeManager { FeeInfo storage feeInfo = comptrollerProxyToFeeInfo[_comptrollerProxy]; - uint256 grossSharePrice = ComptrollerLib(_comptrollerProxy).calcGrossShareValue(); + uint256 grossSharePrice = IComptroller(_comptrollerProxy).calcGrossShareValue(); feeInfo.highWaterMark = grossSharePrice; @@ -185,7 +186,7 @@ contract PerformanceFee is FeeBase, UpdatableFeeRecipientBase { returns (uint256 grossShareValue_) { if (_sharesSupply == 0) { - return 10 ** uint256(ERC20(ComptrollerLib(_comptrollerProxy).getDenominationAsset()).decimals()); + return 10 ** uint256(ERC20(IComptroller(_comptrollerProxy).getDenominationAsset()).decimals()); } return _gav.mul(SHARE_UNIT).div(_sharesSupply); diff --git a/contracts/release/extensions/fee-manager/fees/utils/EntranceRateFeeBase.sol b/contracts/release/extensions/fee-manager/fees/utils/EntranceRateFeeBase.sol index ee38af6a7..a79c97399 100644 --- a/contracts/release/extensions/fee-manager/fees/utils/EntranceRateFeeBase.sol +++ b/contracts/release/extensions/fee-manager/fees/utils/EntranceRateFeeBase.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "./FeeBase.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IFeeManager} from "../../IFeeManager.sol"; +import {FeeBase} from "./FeeBase.sol"; /// @title EntranceRateFeeBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/utils/ExitRateFeeBase.sol b/contracts/release/extensions/fee-manager/fees/utils/ExitRateFeeBase.sol index 9c903edd1..fdec996f7 100644 --- a/contracts/release/extensions/fee-manager/fees/utils/ExitRateFeeBase.sol +++ b/contracts/release/extensions/fee-manager/fees/utils/ExitRateFeeBase.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "./FeeBase.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IFeeManager} from "../../IFeeManager.sol"; +import {FeeBase} from "./FeeBase.sol"; /// @title ExitRateFeeBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/utils/FeeBase.sol b/contracts/release/extensions/fee-manager/fees/utils/FeeBase.sol index cad727585..33387abe8 100644 --- a/contracts/release/extensions/fee-manager/fees/utils/FeeBase.sol +++ b/contracts/release/extensions/fee-manager/fees/utils/FeeBase.sol @@ -11,7 +11,8 @@ pragma solidity 0.6.12; -import "../../IFee.sol"; +import {IFeeManager} from "../../IFeeManager.sol"; +import {IFee} from "../../IFee.sol"; /// @title FeeBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/fee-manager/fees/utils/UpdatableFeeRecipientBase.sol b/contracts/release/extensions/fee-manager/fees/utils/UpdatableFeeRecipientBase.sol index fdda7a22e..3b18978da 100644 --- a/contracts/release/extensions/fee-manager/fees/utils/UpdatableFeeRecipientBase.sol +++ b/contracts/release/extensions/fee-manager/fees/utils/UpdatableFeeRecipientBase.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../core/fund/vault/VaultLib.sol"; -import "./SettableFeeRecipientBase.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../../core/fund/vault/IVault.sol"; +import {SettableFeeRecipientBase} from "./SettableFeeRecipientBase.sol"; /// @title UpdatableFeeRecipientBase Contract /// @author Enzyme Council @@ -24,7 +24,7 @@ abstract contract UpdatableFeeRecipientBase is SettableFeeRecipientBase { /// @param _recipient The fee recipient function setRecipientForFund(address _comptrollerProxy, address _recipient) external { require( - msg.sender == VaultLib(payable(ComptrollerLib(_comptrollerProxy).getVaultProxy())).getOwner(), + msg.sender == IVault(IComptroller(_comptrollerProxy).getVaultProxy()).getOwner(), "__setRecipientForFund: Only vault owner callable" ); diff --git a/contracts/release/extensions/integration-manager/IntegrationManager.sol b/contracts/release/extensions/integration-manager/IntegrationManager.sol index 58114a486..0fdcadbf3 100644 --- a/contracts/release/extensions/integration-manager/IntegrationManager.sol +++ b/contracts/release/extensions/integration-manager/IntegrationManager.sol @@ -11,17 +11,17 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../utils/0.6.12/AssetHelpers.sol"; -import "../../core/fund/vault/IVault.sol"; -import "../../infrastructure/value-interpreter/IValueInterpreter.sol"; -import "../policy-manager/IPolicyManager.sol"; -import "../utils/ExtensionBase.sol"; -import "../utils/PermissionedVaultActionMixin.sol"; -import "./integrations/IIntegrationAdapter.sol"; -import "./IIntegrationManager.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {AddressArrayLib} from "../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../utils/0.6.12/AssetHelpers.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; +import {IValueInterpreter} from "../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IPolicyManager} from "../policy-manager/IPolicyManager.sol"; +import {ExtensionBase} from "../utils/ExtensionBase.sol"; +import {PermissionedVaultActionMixin} from "../utils/PermissionedVaultActionMixin.sol"; +import {IIntegrationAdapter} from "./integrations/IIntegrationAdapter.sol"; +import {IIntegrationManager} from "./IIntegrationManager.sol"; /// @title IntegrationManager /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/IIntegrationAdapter.sol b/contracts/release/extensions/integration-manager/integrations/IIntegrationAdapter.sol index 0fc1b7139..89ae5fe36 100644 --- a/contracts/release/extensions/integration-manager/integrations/IIntegrationAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/IIntegrationAdapter.sol @@ -11,7 +11,7 @@ pragma solidity >=0.6.0 <0.9.0; -import "../IIntegrationManager.sol"; +import {IIntegrationManager} from "../IIntegrationManager.sol"; /// @title Integration Adapter interface /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/AaveV2Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/AaveV2Adapter.sol index 75970f086..379264f97 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/AaveV2Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/AaveV2Adapter.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../utils/0.6.12/actions/AaveV2ActionsMixin.sol"; -import "../utils/0.6.12/bases/AaveAdapterBase.sol"; +import {AaveV2ActionsMixin} from "../utils/0.6.12/actions/AaveV2ActionsMixin.sol"; +import {AaveAdapterBase} from "../utils/0.6.12/bases/AaveAdapterBase.sol"; /// @title AaveV2Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/AaveV3Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/AaveV3Adapter.sol index ec2ff5bbc..cffa6ea82 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/AaveV3Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/AaveV3Adapter.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../utils/0.6.12/actions/AaveV3ActionsMixin.sol"; -import "../utils/0.6.12/bases/AaveAdapterBase.sol"; +import {AaveV3ActionsMixin} from "../utils/0.6.12/actions/AaveV3ActionsMixin.sol"; +import {AaveAdapterBase} from "../utils/0.6.12/bases/AaveAdapterBase.sol"; /// @title AaveV3Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/AuraBalancerV2LpStakingAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/AuraBalancerV2LpStakingAdapter.sol index 85b951f75..840be3ec5 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/AuraBalancerV2LpStakingAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/AuraBalancerV2LpStakingAdapter.sol @@ -2,9 +2,11 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../infrastructure/staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; -import "../utils/0.6.12/actions/StakingWrapperActionsMixin.sol"; -import "../utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol"; +import {IConvexCurveLpStakingWrapperFactory} from + "../../../../infrastructure/staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {StakingWrapperActionsMixin} from "../utils/0.6.12/actions/StakingWrapperActionsMixin.sol"; +import {BalancerV2LiquidityAdapterBase} from "../utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol"; /// @title AuraBalancerV2LpStakingAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/BalancerV2LiquidityAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/BalancerV2LiquidityAdapter.sol index eb7a01f4d..6cd40f7c8 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/BalancerV2LiquidityAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/BalancerV2LiquidityAdapter.sol @@ -10,9 +10,12 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../external-interfaces/IBalancerV2LiquidityGauge.sol"; -import "../utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol"; -import "../utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IBalancerV2LiquidityGauge} from "../../../../../external-interfaces/IBalancerV2LiquidityGauge.sol"; +import {IBalancerV2Vault} from "../../../../../external-interfaces/IBalancerV2Vault.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {CurveGaugeV2RewardsHandlerMixin} from "../utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol"; +import {BalancerV2LiquidityAdapterBase} from "../utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol"; /// @title BalancerV2LiquidityAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/CompoundAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/CompoundAdapter.sol index e4bddf4f2..1dcde6c25 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/CompoundAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/CompoundAdapter.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../external-interfaces/ICompoundComptroller.sol"; -import "../utils/0.6.12/bases/CompoundAdapterBase.sol"; +import {ICompoundComptroller} from "../../../../../external-interfaces/ICompoundComptroller.sol"; +import {CompoundAdapterBase} from "../utils/0.6.12/bases/CompoundAdapterBase.sol"; /// @title CompoundAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/CompoundV3Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/CompoundV3Adapter.sol index 2a5f97342..bc9268ab0 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/CompoundV3Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/CompoundV3Adapter.sol @@ -12,12 +12,13 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/token/ERC20/IERC20.sol"; -import +import {IERC20} from "openzeppelin-solc-0.6/token/ERC20/IERC20.sol"; +import {AddOnlyAddressListOwnerConsumerMixin} from "../../../../../persistent/address-list-registry/address-list-owners/utils/0.6.12/AddOnlyAddressListOwnerConsumerMixin.sol"; -import "../../../../../external-interfaces/ICompoundV3Configurator.sol"; -import "../utils/0.6.12/actions/CompoundV3ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ICompoundV3Configurator} from "../../../../../external-interfaces/ICompoundV3Configurator.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {CompoundV3ActionsMixin} from "../utils/0.6.12/actions/CompoundV3ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title CompoundV3Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/ConvexCurveLpStakingAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/ConvexCurveLpStakingAdapter.sol index bf44f902d..2eece6be9 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/ConvexCurveLpStakingAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/ConvexCurveLpStakingAdapter.sol @@ -1,10 +1,13 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; -import "../../../../infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol"; -import "../../../../infrastructure/staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; -import "../utils/0.6.12/actions/StakingWrapperActionsMixin.sol"; -import "../utils/0.6.12/bases/CurveLiquidityAdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {CurvePriceFeed} from "../../../../infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol"; +import {IConvexCurveLpStakingWrapperFactory} from + "../../../../infrastructure/staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {StakingWrapperActionsMixin} from "../utils/0.6.12/actions/StakingWrapperActionsMixin.sol"; +import {CurveLiquidityAdapterBase} from "../utils/0.6.12/bases/CurveLiquidityAdapterBase.sol"; /// @title ConvexCurveLpStakingAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/CurveExchangeAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/CurveExchangeAdapter.sol index 711a0c77b..358c3d1a3 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/CurveExchangeAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/CurveExchangeAdapter.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "../utils/0.6.12/actions/CurveExchangeActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {CurveExchangeActionsMixin} from "../utils/0.6.12/actions/CurveExchangeActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title CurveExchangeAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/CurveLiquidityAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/CurveLiquidityAdapter.sol index b24f925c7..aed97f764 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/CurveLiquidityAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/CurveLiquidityAdapter.sol @@ -1,9 +1,11 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; -import "../../../../infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol"; -import "../utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol"; -import "../utils/0.6.12/bases/CurveLiquidityAdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {CurvePriceFeed} from "../../../../infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {CurveGaugeV2RewardsHandlerMixin} from "../utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol"; +import {CurveLiquidityAdapterBase} from "../utils/0.6.12/bases/CurveLiquidityAdapterBase.sol"; /// @title CurveLiquidityAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/IdleAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/IdleAdapter.sol index 5a90b6263..5292638f3 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/IdleAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/IdleAdapter.sol @@ -11,11 +11,13 @@ pragma solidity 0.6.12; -import "../../../../../external-interfaces/IIdleTokenV4.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol"; -import "../utils/0.6.12/actions/IdleV4ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IIdleTokenV4} from "../../../../../external-interfaces/IIdleTokenV4.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IdlePriceFeed} from "../../../../infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {IdleV4ActionsMixin} from "../utils/0.6.12/actions/IdleV4ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title IdleAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/OneInchV5Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/OneInchV5Adapter.sol index a46a34d68..5b3f16f45 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/OneInchV5Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/OneInchV5Adapter.sol @@ -12,9 +12,12 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../utils/0.6.12/actions/OneInchV5ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IOneInchV5AggregationRouter} from "../../../../../external-interfaces/IOneInchV5AggregationRouter.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {OneInchV5ActionsMixin} from "../utils/0.6.12/actions/OneInchV5ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title OneInchV5Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/ParaSwapV5Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/ParaSwapV5Adapter.sol index 5a4c970d5..f8170fb07 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/ParaSwapV5Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/ParaSwapV5Adapter.sol @@ -12,9 +12,12 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IParaSwapV5AugustusSwapper} from "../../../../../external-interfaces/IParaSwapV5AugustusSwapper.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {ParaSwapV5ActionsMixin} from "../utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title ParaSwapV5Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/SynthetixAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/SynthetixAdapter.sol index faf363cd8..6c40423db 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/SynthetixAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/SynthetixAdapter.sol @@ -11,9 +11,11 @@ pragma solidity 0.6.12; -import "../../../../infrastructure/value-interpreter/ValueInterpreter.sol"; -import "../utils/0.6.12/actions/SynthetixActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IValueInterpreter} from "../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {SynthetixActionsMixin} from "../utils/0.6.12/actions/SynthetixActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title SynthetixAdapter Contract /// @author Enzyme Council @@ -21,7 +23,7 @@ import "../utils/0.6.12/AdapterBase.sol"; /// @dev This adapter currently only provides mechanisms for exiting an already-held synth position into sUSD contract SynthetixAdapter is AdapterBase, SynthetixActionsMixin { address private immutable SUSD_TOKEN; - ValueInterpreter private immutable VALUE_INTERPRETER_CONTRACT; + IValueInterpreter private immutable VALUE_INTERPRETER_CONTRACT; constructor( address _integrationManager, @@ -37,7 +39,7 @@ contract SynthetixAdapter is AdapterBase, SynthetixActionsMixin { SynthetixActionsMixin(_originator, _synthetixRedeemer, _synthetix, _trackingCode) { SUSD_TOKEN = _susd; - VALUE_INTERPRETER_CONTRACT = ValueInterpreter(_valueInterpreter); + VALUE_INTERPRETER_CONTRACT = IValueInterpreter(_valueInterpreter); } /// @notice Redeems an array of deprecated synths for their last underlying sUSD values diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2ExchangeAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2ExchangeAdapter.sol index ca4024013..860ecd64c 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2ExchangeAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2ExchangeAdapter.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../utils/0.6.12/actions/UniswapV2ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {UniswapV2ActionsMixin} from "../utils/0.6.12/actions/UniswapV2ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title UniswapV2ExchangeAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2LiquidityAdapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2LiquidityAdapter.sol index 7caeaa02f..359023f36 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2LiquidityAdapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV2LiquidityAdapter.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "../../../../../external-interfaces/IUniswapV2Factory.sol"; -import "../utils/0.6.12/actions/UniswapV2ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {IUniswapV2Factory} from "../../../../../external-interfaces/IUniswapV2Factory.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {UniswapV2ActionsMixin} from "../utils/0.6.12/actions/UniswapV2ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title UniswapV2LiquidityAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV3Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV3Adapter.sol index 2c425085a..5116c3227 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV3Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/UniswapV3Adapter.sol @@ -12,8 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/actions/UniswapV3ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {UniswapV3ActionsMixin} from "../utils/0.6.12/actions/UniswapV3ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title UniswapV3SwapAdapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/YearnVaultV2Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/YearnVaultV2Adapter.sol index 735ed486d..96d2dd833 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/YearnVaultV2Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/YearnVaultV2Adapter.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "../../../../infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol"; -import "../utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {YearnVaultV2PriceFeed} from "../../../../infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {YearnVaultV2ActionsMixin} from "../utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title YearnVaultV2Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/adapters/ZeroExV4Adapter.sol b/contracts/release/extensions/integration-manager/integrations/adapters/ZeroExV4Adapter.sol index fc6d4e332..533aaa7ed 100644 --- a/contracts/release/extensions/integration-manager/integrations/adapters/ZeroExV4Adapter.sol +++ b/contracts/release/extensions/integration-manager/integrations/adapters/ZeroExV4Adapter.sol @@ -12,10 +12,12 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; -import "../../../../../utils/0.6.12/MathHelpers.sol"; -import "../utils/0.6.12/actions/ZeroExV4ActionsMixin.sol"; -import "../utils/0.6.12/AdapterBase.sol"; +import {IZeroExV4} from "../../../../../external-interfaces/IZeroExV4.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {MathHelpers} from "../../../../../utils/0.6.12/MathHelpers.sol"; +import {IIntegrationManager} from "../../IIntegrationManager.sol"; +import {ZeroExV4ActionsMixin} from "../utils/0.6.12/actions/ZeroExV4ActionsMixin.sol"; +import {AdapterBase} from "../utils/0.6.12/AdapterBase.sol"; /// @title ZeroExV4Adapter Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/AdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/AdapterBase.sol index a3a935bd9..e577c3879 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/AdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/AdapterBase.sol @@ -11,11 +11,11 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../IIntegrationAdapter.sol"; -import "./../IntegrationSelectors.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {AssetHelpers} from "../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IIntegrationAdapter} from "../../IIntegrationAdapter.sol"; +import {IntegrationSelectors} from "./../IntegrationSelectors.sol"; /// @title AdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV2ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV2ActionsMixin.sol index 0224a58db..0211645c4 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV2ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV2ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IAaveV2LendingPool.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IAaveV2LendingPool} from "../../../../../../../external-interfaces/IAaveV2LendingPool.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title AaveV2ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV3ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV3ActionsMixin.sol index ac597e889..88f8a1f78 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV3ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/AaveV3ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IAaveV3Pool.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IAaveV3Pool} from "../../../../../../../external-interfaces/IAaveV3Pool.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title AaveV3ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/BalancerV2ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/BalancerV2ActionsMixin.sol index 3707a9e1f..9d284545c 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/BalancerV2ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/BalancerV2ActionsMixin.sol @@ -9,7 +9,7 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IBalancerV2Vault.sol"; +import {IBalancerV2Vault} from "../../../../../../../external-interfaces/IBalancerV2Vault.sol"; /// @title BalancerV2ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundActionsMixin.sol index 6bc7d394d..7dc3c9132 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundActionsMixin.sol @@ -11,10 +11,10 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICERC20.sol"; -import "../../../../../../../external-interfaces/ICEther.sol"; -import "../../../../../../../external-interfaces/IWETH.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ICERC20} from "../../../../../../../external-interfaces/ICERC20.sol"; +import {ICEther} from "../../../../../../../external-interfaces/ICEther.sol"; +import {IWETH} from "../../../../../../../external-interfaces/IWETH.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title CompoundActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundV3ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundV3ActionsMixin.sol index aa4213d2b..7063910b4 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundV3ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CompoundV3ActionsMixin.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICompoundV3Comet.sol"; -import "../../../../../../../external-interfaces/ICompoundV3CometRewards.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ICompoundV3Comet} from "../../../../../../../external-interfaces/ICompoundV3Comet.sol"; +import {ICompoundV3CometRewards} from "../../../../../../../external-interfaces/ICompoundV3CometRewards.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title CompoundV3ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveExchangeActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveExchangeActionsMixin.sol index 07b1c1e01..16cc0c704 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveExchangeActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveExchangeActionsMixin.sol @@ -11,11 +11,12 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICurveAddressProvider.sol"; -import "../../../../../../../external-interfaces/ICurveSwapsERC20.sol"; -import "../../../../../../../external-interfaces/ICurveSwapsEther.sol"; -import "../../../../../../../external-interfaces/IWETH.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {ICurveAddressProvider} from "../../../../../../../external-interfaces/ICurveAddressProvider.sol"; +import {ICurveSwapsERC20} from "../../../../../../../external-interfaces/ICurveSwapsERC20.sol"; +import {ICurveSwapsEther} from "../../../../../../../external-interfaces/ICurveSwapsEther.sol"; +import {IWETH} from "../../../../../../../external-interfaces/IWETH.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title CurveExchangeActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2ActionsMixin.sol index 8ee3ebd3a..f9cb89481 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICurveLiquidityGaugeV2.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ICurveLiquidityGaugeV2} from "../../../../../../../external-interfaces/ICurveLiquidityGaugeV2.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title CurveGaugeV2ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol index 9a53aa998..e0bbef33e 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveGaugeV2RewardsHandlerMixin.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICurveMinter.sol"; -import "../../../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "./CurveGaugeV2ActionsMixin.sol"; +import {ICurveMinter} from "../../../../../../../external-interfaces/ICurveMinter.sol"; +import {AddressArrayLib} from "../../../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {CurveGaugeV2ActionsMixin} from "./CurveGaugeV2ActionsMixin.sol"; /// @title CurveGaugeV2RewardsHandlerMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveLiquidityActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveLiquidityActionsMixin.sol index 35f92e0bc..63eb78cf5 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveLiquidityActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/CurveLiquidityActionsMixin.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/utils/Strings.sol"; -import "../../../../../../../external-interfaces/IWETH.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {Strings} from "openzeppelin-solc-0.6/utils/Strings.sol"; +import {IWETH} from "../../../../../../../external-interfaces/IWETH.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title CurveLiquidityActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/IdleV4ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/IdleV4ActionsMixin.sol index 60cc31c94..e62a5a93a 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/IdleV4ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/IdleV4ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IIdleTokenV4.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IIdleTokenV4} from "../../../../../../../external-interfaces/IIdleTokenV4.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title IdleV4ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/OneInchV5ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/OneInchV5ActionsMixin.sol index bddd471c7..1b32270dc 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/OneInchV5ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/OneInchV5ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IOneInchV5AggregationRouter.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IOneInchV5AggregationRouter} from "../../../../../../../external-interfaces/IOneInchV5AggregationRouter.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title OneInchV5ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol index ff860cff2..7f809e623 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ParaSwapV5ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IParaSwapV5AugustusSwapper.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IParaSwapV5AugustusSwapper} from "../../../../../../../external-interfaces/IParaSwapV5AugustusSwapper.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title ParaSwapV5ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/StakingWrapperActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/StakingWrapperActionsMixin.sol index 22f5ca1bb..e3c317e59 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/StakingWrapperActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/StakingWrapperActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../../../infrastructure/staking-wrappers/IStakingWrapper.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IStakingWrapper} from "../../../../../../infrastructure/staking-wrappers/IStakingWrapper.sol"; /// @title StakingWrapperActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/SynthetixActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/SynthetixActionsMixin.sol index dafcb8bed..2ad7b62cb 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/SynthetixActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/SynthetixActionsMixin.sol @@ -11,11 +11,11 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ISynthetix.sol"; -import "../../../../../../../external-interfaces/ISynthetixProxyERC20.sol"; -import "../../../../../../../external-interfaces/ISynthetixRedeemer.sol"; -import "../../../../../../../external-interfaces/ISynthetixSynth.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {ISynthetix} from "../../../../../../../external-interfaces/ISynthetix.sol"; +import {ISynthetixProxyERC20} from "../../../../../../../external-interfaces/ISynthetixProxyERC20.sol"; +import {ISynthetixRedeemer} from "../../../../../../../external-interfaces/ISynthetixRedeemer.sol"; +import {ISynthetixSynth} from "../../../../../../../external-interfaces/ISynthetixSynth.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title SynthetixActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV2ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV2ActionsMixin.sol index 26265ed03..f44a1af40 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV2ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV2ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IUniswapV2Router2.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IUniswapV2Router2} from "../../../../../../../external-interfaces/IUniswapV2Router2.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title UniswapV2ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV3ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV3ActionsMixin.sol index 895964990..80c3b45c6 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV3ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/UniswapV3ActionsMixin.sol @@ -12,8 +12,8 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../../../external-interfaces/IUniswapV3SwapRouter.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IUniswapV3SwapRouter} from "../../../../../../../external-interfaces/IUniswapV3SwapRouter.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title UniswapV3ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol index 87768e61c..273bfdfed 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/YearnVaultV2ActionsMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/IYearnVaultV2.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IYearnVaultV2} from "../../../../../../../external-interfaces/IYearnVaultV2.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title YearnVaultV2ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ZeroExV4ActionsMixin.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ZeroExV4ActionsMixin.sol index 944cc9e93..05e041638 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ZeroExV4ActionsMixin.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/actions/ZeroExV4ActionsMixin.sol @@ -12,8 +12,8 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../../../external-interfaces/IZeroExV4.sol"; -import "../../../../../../../utils/0.6.12/AssetHelpers.sol"; +import {IZeroExV4} from "../../../../../../../external-interfaces/IZeroExV4.sol"; +import {AssetHelpers} from "../../../../../../../utils/0.6.12/AssetHelpers.sol"; /// @title ZeroExV4ActionsMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/AaveAdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/AaveAdapterBase.sol index debe7a741..25b1eb6e5 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/AaveAdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/AaveAdapterBase.sol @@ -11,11 +11,12 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {AddOnlyAddressListOwnerConsumerMixin} from "../../../../../../../persistent/address-list-registry/address-list-owners/utils/0.6.12/AddOnlyAddressListOwnerConsumerMixin.sol"; -import "../../../../../../../external-interfaces/IAaveAToken.sol"; -import "../AdapterBase.sol"; +import {IAaveAToken} from "../../../../../../../external-interfaces/IAaveAToken.sol"; +import {IIntegrationManager} from "../../../../IIntegrationManager.sol"; +import {AdapterBase} from "../AdapterBase.sol"; /// @title AaveAdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol index 5502ca11a..89ba0f409 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/BalancerV2LiquidityAdapterBase.sol @@ -10,10 +10,12 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../../../../external-interfaces/IBalancerV2Vault.sol"; -import "../../../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../actions/BalancerV2ActionsMixin.sol"; -import "../AdapterBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IBalancerV2Vault} from "../../../../../../../external-interfaces/IBalancerV2Vault.sol"; +import {AddressArrayLib} from "../../../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {IIntegrationManager} from "../../../../IIntegrationManager.sol"; +import {BalancerV2ActionsMixin} from "../actions/BalancerV2ActionsMixin.sol"; +import {AdapterBase} from "../AdapterBase.sol"; /// @title BalancerV2LiquidityAdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CompoundAdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CompoundAdapterBase.sol index 8ba780239..2d4a5b528 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CompoundAdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CompoundAdapterBase.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "../../../../../../infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol"; -import "../actions/CompoundActionsMixin.sol"; -import "../AdapterBase.sol"; +import {CompoundPriceFeed} from "../../../../../../infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol"; +import {IIntegrationManager} from "../../../../IIntegrationManager.sol"; +import {CompoundActionsMixin} from "../actions/CompoundActionsMixin.sol"; +import {AdapterBase} from "../AdapterBase.sol"; /// @title CompoundAdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CurveLiquidityAdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CurveLiquidityAdapterBase.sol index 91104159e..0b35e75c6 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CurveLiquidityAdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.6.12/bases/CurveLiquidityAdapterBase.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; -import "../../../../../../../external-interfaces/ICurveLiquidityPool.sol"; -import "../actions/CurveLiquidityActionsMixin.sol"; -import "../AdapterBase.sol"; +import {ICurveLiquidityPool} from "../../../../../../../external-interfaces/ICurveLiquidityPool.sol"; +import {CurveLiquidityActionsMixin} from "../actions/CurveLiquidityActionsMixin.sol"; +import {AdapterBase} from "../AdapterBase.sol"; /// @title CurveLiquidityAdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/integration-manager/integrations/utils/0.8.19/AdapterBase.sol b/contracts/release/extensions/integration-manager/integrations/utils/0.8.19/AdapterBase.sol index 88dce5886..f6912432d 100644 --- a/contracts/release/extensions/integration-manager/integrations/utils/0.8.19/AdapterBase.sol +++ b/contracts/release/extensions/integration-manager/integrations/utils/0.8.19/AdapterBase.sol @@ -11,11 +11,11 @@ pragma solidity 0.8.19; -import "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; -import "../../../../../../utils/0.8.19/AssetHelpers.sol"; -import "../../IIntegrationAdapter.sol"; -import "../IntegrationSelectors.sol"; +import {ERC20} from "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; +import {AssetHelpers} from "../../../../../../utils/0.8.19/AssetHelpers.sol"; +import {IIntegrationAdapter} from "../../IIntegrationAdapter.sol"; +import {IntegrationSelectors} from "../IntegrationSelectors.sol"; /// @title AdapterBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/IPolicy.sol b/contracts/release/extensions/policy-manager/IPolicy.sol index 71549477b..ea0d00d55 100644 --- a/contracts/release/extensions/policy-manager/IPolicy.sol +++ b/contracts/release/extensions/policy-manager/IPolicy.sol @@ -11,7 +11,7 @@ pragma solidity >=0.6.0 <0.9.0; -import "./IPolicyManager.sol"; +import {IPolicyManager} from "./IPolicyManager.sol"; /// @title Policy Interface /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/IPolicyManager.sol b/contracts/release/extensions/policy-manager/IPolicyManager.sol index cdc84b16b..49e3fa260 100644 --- a/contracts/release/extensions/policy-manager/IPolicyManager.sol +++ b/contracts/release/extensions/policy-manager/IPolicyManager.sol @@ -32,5 +32,12 @@ interface IPolicyManager { ReactivateExternalPosition } + function disablePolicyForFund(address _comptrollerProxy, address _policy) external; + + function enablePolicyForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData) external; + + function updatePolicySettingsForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData) + external; + function validatePolicies(address, PolicyHook, bytes calldata) external; } diff --git a/contracts/release/extensions/policy-manager/PolicyManager.sol b/contracts/release/extensions/policy-manager/PolicyManager.sol index 199943fb0..e34edcbf6 100644 --- a/contracts/release/extensions/policy-manager/PolicyManager.sol +++ b/contracts/release/extensions/policy-manager/PolicyManager.sol @@ -12,13 +12,13 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../core/fund/comptroller/IComptroller.sol"; -import "../../core/fund/vault/IVault.sol"; -import "../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; -import "../utils/ExtensionBase.sol"; -import "./IPolicy.sol"; -import "./IPolicyManager.sol"; +import {AddressArrayLib} from "../../../utils/0.6.12/AddressArrayLib.sol"; +import {IComptroller} from "../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; +import {GasRelayRecipientMixin} from "../../infrastructure/gas-relayer/GasRelayRecipientMixin.sol"; +import {ExtensionBase} from "../utils/ExtensionBase.sol"; +import {IPolicy} from "./IPolicy.sol"; +import {IPolicyManager} from "./IPolicyManager.sol"; /// @title PolicyManager Contract /// @author Enzyme Council @@ -80,6 +80,7 @@ contract PolicyManager is IPolicyManager, ExtensionBase, GasRelayRecipientMixin /// removed hook values. function disablePolicyForFund(address _comptrollerProxy, address _policy) external + override onlyFundOwner(_comptrollerProxy) { require(IPolicy(_policy).canDisable(), "disablePolicyForFund: _policy cannot be disabled"); @@ -103,6 +104,7 @@ contract PolicyManager is IPolicyManager, ExtensionBase, GasRelayRecipientMixin /// policy's job to determine how to merge that config with the _settingsData param in this function. function enablePolicyForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData) external + override onlyFundOwner(_comptrollerProxy) { PolicyHook[] memory implementedHooks = IPolicy(_policy).implementedHooks(); @@ -155,6 +157,7 @@ contract PolicyManager is IPolicyManager, ExtensionBase, GasRelayRecipientMixin /// @param _settingsData The encoded settings data with which to update the policy config function updatePolicySettingsForFund(address _comptrollerProxy, address _policy, bytes calldata _settingsData) external + override onlyFundOwner(_comptrollerProxy) { IPolicy(_policy).updateFundSettings(_comptrollerProxy, _settingsData); diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdapterIncomingAssetsPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdapterIncomingAssetsPolicy.sol index e97ec8d4c..482a1ebfc 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdapterIncomingAssetsPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdapterIncomingAssetsPolicy.sol @@ -12,7 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPolicyBase} from "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; /// @title AllowedAdapterIncomingAssetsPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPerManagerPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPerManagerPolicy.sol index 06e413717..05b7385ab 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPerManagerPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPerManagerPolicy.sol @@ -12,9 +12,10 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../core/fund/vault/VaultLib.sol"; -import "../utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../../core/fund/vault/IVault.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPerUserPolicyBase} from "../utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol"; /// @title AllowedAdaptersPerManagerPolicy Contract /// @author Enzyme Council @@ -89,7 +90,7 @@ contract AllowedAdaptersPerManagerPolicy is AddressListRegistryPerUserPolicyBase view returns (bool isValid_) { - if (_caller == VaultLib(payable(ComptrollerLib(_comptrollerProxy).getVaultProxy())).getOwner()) { + if (_caller == IVault(IComptroller(_comptrollerProxy).getVaultProxy()).getOwner()) { // fund owner passes rule by default return true; } diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPolicy.sol index 09bd98a45..de4af5a52 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedAdaptersPolicy.sol @@ -12,7 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPolicyBase} from "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; /// @title AllowedAdaptersPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPerManagerPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPerManagerPolicy.sol index 571ec3abc..4f02a1bc7 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPerManagerPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPerManagerPolicy.sol @@ -12,10 +12,11 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../core/fund/vault/VaultLib.sol"; -import "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; -import "../utils/0.6.12/UintListRegistryPerUserPolicyBase.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../../core/fund/vault/IVault.sol"; +import {IExternalPositionProxy} from "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {UintListRegistryPerUserPolicyBase} from "../utils/0.6.12/UintListRegistryPerUserPolicyBase.sol"; /// @title AllowedExternalPositionTypesPerManagerPolicy Contract /// @author Enzyme Council @@ -111,7 +112,7 @@ contract AllowedExternalPositionTypesPerManagerPolicy is UintListRegistryPerUser view returns (bool isValid_) { - if (_caller == VaultLib(payable(ComptrollerLib(_comptrollerProxy).getVaultProxy())).getOwner()) { + if (_caller == IVault(IComptroller(_comptrollerProxy).getVaultProxy()).getOwner()) { // fund owner passes rule by default return true; } diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPolicy.sol index 36d5f5eb7..e11d35472 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/AllowedExternalPositionTypesPolicy.sol @@ -11,10 +11,11 @@ pragma solidity 0.6.12; -import "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../core/fund/vault/VaultLib.sol"; -import "../utils/0.6.12/PolicyBase.sol"; +import {IExternalPositionProxy} from "../../../../../persistent/external-positions/IExternalPositionProxy.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../../core/fund/vault/IVault.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; /// @title AllowedExternalPositionTypesPolicy Contract /// @author Enzyme Council @@ -32,7 +33,7 @@ contract AllowedExternalPositionTypesPolicy is PolicyBase { /// @param _comptrollerProxy The fund's ComptrollerProxy address function activateForFund(address _comptrollerProxy) external override onlyPolicyManager { address[] memory activeExternalPositions = - VaultLib(payable(ComptrollerLib(_comptrollerProxy).getVaultProxy())).getActiveExternalPositions(); + IVault(IComptroller(_comptrollerProxy).getVaultProxy()).getActiveExternalPositions(); for (uint256 i; i < activeExternalPositions.length; i++) { require( externalPositionTypeIsAllowedForFund( diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/CumulativeSlippageTolerancePolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/CumulativeSlippageTolerancePolicy.sol index 9f5ab3c9b..58710b1df 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/CumulativeSlippageTolerancePolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/CumulativeSlippageTolerancePolicy.sol @@ -12,12 +12,11 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../infrastructure/value-interpreter/ValueInterpreter.sol"; -import "../utils/0.6.12/PolicyBase.sol"; -import "../utils/0.6.12/PricelessAssetBypassMixin.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; +import {PricelessAssetBypassMixin} from "../utils/0.6.12/PricelessAssetBypassMixin.sol"; /// @title CumulativeSlippageTolerancePolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyRemoveDustExternalPositionPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyRemoveDustExternalPositionPolicy.sol index 054171ad9..f7c17cbde 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyRemoveDustExternalPositionPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyRemoveDustExternalPositionPolicy.sol @@ -11,10 +11,11 @@ pragma solidity 0.6.12; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../utils/0.6.12/DustEvaluatorMixin.sol"; -import "../utils/0.6.12/PolicyBase.sol"; -import "../utils/0.6.12/PricelessAssetBypassMixin.sol"; +import {IExternalPosition} from "../../../../../persistent/external-positions/IExternalPosition.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {DustEvaluatorMixin} from "../utils/0.6.12/DustEvaluatorMixin.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; +import {PricelessAssetBypassMixin} from "../utils/0.6.12/PricelessAssetBypassMixin.sol"; /// @title OnlyRemoveDustExternalPositionPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyUntrackDustOrPricelessAssetsPolicy.sol b/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyUntrackDustOrPricelessAssetsPolicy.sol index 28e483cc0..3f01cb4f8 100644 --- a/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyUntrackDustOrPricelessAssetsPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/asset-managers/OnlyUntrackDustOrPricelessAssetsPolicy.sol @@ -11,10 +11,12 @@ pragma solidity 0.6.12; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../utils/0.6.12/DustEvaluatorMixin.sol"; -import "../utils/0.6.12/PolicyBase.sol"; -import "../utils/0.6.12/PricelessAssetBypassMixin.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {DustEvaluatorMixin} from "../utils/0.6.12/DustEvaluatorMixin.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; +import {PricelessAssetBypassMixin} from "../utils/0.6.12/PricelessAssetBypassMixin.sol"; /// @title OnlyUntrackDustOrPricelessAssetsPolicy Contract /// @author Enzyme Council @@ -76,7 +78,7 @@ contract OnlyUntrackDustOrPricelessAssetsPolicy is PolicyBase, DustEvaluatorMixi { (, address[] memory assets) = __decodeRemoveTrackedAssetsValidationData(_encodedArgs); - address vaultProxy = ComptrollerLib(_comptrollerProxy).getVaultProxy(); + address vaultProxy = IComptroller(_comptrollerProxy).getVaultProxy(); for (uint256 i; i < assets.length; i++) { uint256 amount = ERC20(assets[i]).balanceOf(vaultProxy); uint256 valueInWeth = __calcValueExcludingBypassablePricelessAsset( diff --git a/contracts/release/extensions/policy-manager/policies/current-shareholders/AllowedAssetsForRedemptionPolicy.sol b/contracts/release/extensions/policy-manager/policies/current-shareholders/AllowedAssetsForRedemptionPolicy.sol index 1c9db52dd..f68f8721c 100644 --- a/contracts/release/extensions/policy-manager/policies/current-shareholders/AllowedAssetsForRedemptionPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/current-shareholders/AllowedAssetsForRedemptionPolicy.sol @@ -12,7 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPolicyBase} from "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; /// @title AllowedAssetsForRedemptionPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/current-shareholders/MinAssetBalancesPostRedemptionPolicy.sol b/contracts/release/extensions/policy-manager/policies/current-shareholders/MinAssetBalancesPostRedemptionPolicy.sol index c0c558e0d..b9c675817 100644 --- a/contracts/release/extensions/policy-manager/policies/current-shareholders/MinAssetBalancesPostRedemptionPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/current-shareholders/MinAssetBalancesPostRedemptionPolicy.sol @@ -11,9 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../utils/0.6.12/PolicyBase.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IComptroller} from "../../../../core/fund/comptroller/IComptroller.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; /// @title MinAssetBalancesPostRedemptionPolicy Contract /// @author Enzyme Council @@ -78,7 +79,7 @@ contract MinAssetBalancesPostRedemptionPolicy is PolicyBase { { (,,, address[] memory assets,,) = __decodeRedeemSharesForSpecificAssetsValidationData(_encodedArgs); - address vaultProxy = ComptrollerLib(_comptrollerProxy).getVaultProxy(); + address vaultProxy = IComptroller(_comptrollerProxy).getVaultProxy(); for (uint256 i; i < assets.length; i++) { if (ERC20(assets[i]).balanceOf(vaultProxy) < getMinAssetBalanceForFund(_comptrollerProxy, assets[i])) { return false; diff --git a/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedDepositRecipientsPolicy.sol b/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedDepositRecipientsPolicy.sol index 13978bd31..cf0e4c430 100644 --- a/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedDepositRecipientsPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedDepositRecipientsPolicy.sol @@ -12,7 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPolicyBase} from "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; /// @title AllowedDepositRecipientsPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedSharesTransferRecipientsPolicy.sol b/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedSharesTransferRecipientsPolicy.sol index f11805d89..767bf456f 100644 --- a/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedSharesTransferRecipientsPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/new-shareholders/AllowedSharesTransferRecipientsPolicy.sol @@ -12,7 +12,9 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {AddressListRegistryPolicyBase} from "../utils/0.6.12/AddressListRegistryPolicyBase.sol"; /// @title AllowedSharesTransferRecipientsPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/new-shareholders/MinMaxInvestmentPolicy.sol b/contracts/release/extensions/policy-manager/policies/new-shareholders/MinMaxInvestmentPolicy.sol index 976627151..7f6d7a712 100644 --- a/contracts/release/extensions/policy-manager/policies/new-shareholders/MinMaxInvestmentPolicy.sol +++ b/contracts/release/extensions/policy-manager/policies/new-shareholders/MinMaxInvestmentPolicy.sol @@ -12,7 +12,8 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "../utils/0.6.12/PolicyBase.sol"; +import {IPolicyManager} from "../../IPolicyManager.sol"; +import {PolicyBase} from "../utils/0.6.12/PolicyBase.sol"; /// @title MinMaxInvestmentPolicy Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol index 299d86a04..533c3cfcc 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPerUserPolicyBase.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "../../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; -import "../../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "./PolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IComptroller} from "../../../../../core/fund/comptroller/IComptroller.sol"; +import {PolicyBase} from "./PolicyBase.sol"; /// @title AddressListRegistryPerUserPolicyBase Contract /// @author Enzyme Council @@ -118,7 +118,7 @@ abstract contract AddressListRegistryPerUserPolicyBase is PolicyBase { // Create and add any new lists if (newListsData.length > 0) { - address vaultProxy = ComptrollerLib(_comptrollerProxy).getVaultProxy(); + address vaultProxy = IComptroller(_comptrollerProxy).getVaultProxy(); for (uint256 i; i < newListsData.length; i++) { uint256 nextListIdsIndex = existingListIds.length + i; nextListIds[nextListIdsIndex] = __createAddressListFromData(vaultProxy, newListsData[i]); diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPolicyBase.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPolicyBase.sol index b96dc326b..096d1444e 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPolicyBase.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/AddressListRegistryPolicyBase.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "../../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; -import "../../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "./PolicyBase.sol"; +import {IAddressListRegistry} from "../../../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IComptroller} from "../../../../../core/fund/comptroller/IComptroller.sol"; +import {PolicyBase} from "./PolicyBase.sol"; /// @title AddressListRegistryPolicyBase Contract /// @author Enzyme Council @@ -88,7 +88,7 @@ abstract contract AddressListRegistryPolicyBase is PolicyBase { // Create and add any new lists if (newListsData.length > 0) { - address vaultProxy = ComptrollerLib(_comptrollerProxy).getVaultProxy(); + address vaultProxy = IComptroller(_comptrollerProxy).getVaultProxy(); for (uint256 i; i < newListsData.length; i++) { uint256 nextListIdsIndex = existingListIds.length + i; nextListIds[nextListIdsIndex] = __createAddressListFromData(vaultProxy, newListsData[i]); diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/DustEvaluatorMixin.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/DustEvaluatorMixin.sol index 14447eb56..2ac3a6d5f 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/DustEvaluatorMixin.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/DustEvaluatorMixin.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {FundDeployerOwnerMixin} from "../../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; /// @title DustEvaluatorMixin Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PolicyBase.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PolicyBase.sol index 916fb442e..feafd7b9e 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PolicyBase.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PolicyBase.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../IPolicy.sol"; +import {IPolicy} from "../../../IPolicy.sol"; /// @title PolicyBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PricelessAssetBypassMixin.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PricelessAssetBypassMixin.sol index e280e31bf..4c18b33ef 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PricelessAssetBypassMixin.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/PricelessAssetBypassMixin.sol @@ -11,10 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../../../core/fund/vault/VaultLib.sol"; -import "../../../../../infrastructure/value-interpreter/ValueInterpreter.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IComptroller} from "../../../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../../../core/fund/vault/IVault.sol"; +import {IValueInterpreter} from "../../../../../infrastructure/value-interpreter/IValueInterpreter.sol"; /// @title PricelessAssetBypassMixin Contract /// @author Enzyme Council @@ -49,13 +49,13 @@ abstract contract PricelessAssetBypassMixin { /// It also means that the originator must be the owner. function startAssetBypassTimelock(address _asset) external { // No need to validate whether the VaultProxy is an Enzyme contract - address comptrollerProxy = VaultLib(msg.sender).getAccessor(); + address comptrollerProxy = IVault(msg.sender).getAccessor(); require( - msg.sender == ComptrollerLib(comptrollerProxy).getVaultProxy(), + msg.sender == IComptroller(comptrollerProxy).getVaultProxy(), "startAssetBypassTimelock: Sender is not the VaultProxy of the associated ComptrollerProxy" ); - try ValueInterpreter(getPricelessAssetBypassValueInterpreter()).calcCanonicalAssetValue( + try IValueInterpreter(getPricelessAssetBypassValueInterpreter()).calcCanonicalAssetValue( _asset, 1, // Any value >0 will attempt to retrieve a rate getPricelessAssetBypassWethToken() // Any valid asset would do @@ -111,7 +111,7 @@ abstract contract PricelessAssetBypassMixin { uint256 _baseAssetAmount, address _quoteAsset ) internal returns (uint256 value_) { - try ValueInterpreter(getPricelessAssetBypassValueInterpreter()).calcCanonicalAssetValue( + try IValueInterpreter(getPricelessAssetBypassValueInterpreter()).calcCanonicalAssetValue( _baseAsset, _baseAssetAmount, _quoteAsset ) returns (uint256 result) { return result; diff --git a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/UintListRegistryPerUserPolicyBase.sol b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/UintListRegistryPerUserPolicyBase.sol index b3900ef36..cbfa68fd6 100644 --- a/contracts/release/extensions/policy-manager/policies/utils/0.6.12/UintListRegistryPerUserPolicyBase.sol +++ b/contracts/release/extensions/policy-manager/policies/utils/0.6.12/UintListRegistryPerUserPolicyBase.sol @@ -9,9 +9,9 @@ pragma solidity 0.6.12; -import "../../../../../../persistent/uint-list-registry/IUintListRegistry.sol"; -import "../../../../../core/fund/comptroller/ComptrollerLib.sol"; -import "./PolicyBase.sol"; +import {IUintListRegistry} from "../../../../../../persistent/uint-list-registry/IUintListRegistry.sol"; +import {IComptroller} from "../../../../../core/fund/comptroller/IComptroller.sol"; +import {PolicyBase} from "./PolicyBase.sol"; /// @title UintListRegistryPerUserPolicyBase Contract /// @author Enzyme Council @@ -116,7 +116,7 @@ abstract contract UintListRegistryPerUserPolicyBase is PolicyBase { // Create and add any new lists if (newListsData.length > 0) { - address vaultProxy = ComptrollerLib(_comptrollerProxy).getVaultProxy(); + address vaultProxy = IComptroller(_comptrollerProxy).getVaultProxy(); for (uint256 i; i < newListsData.length; i++) { uint256 nextListIdsIndex = existingListIds.length + i; nextListIds[nextListIdsIndex] = __createUintListFromData(vaultProxy, newListsData[i]); diff --git a/contracts/release/extensions/utils/ExtensionBase.sol b/contracts/release/extensions/utils/ExtensionBase.sol index 8ea679b29..eb933ff54 100644 --- a/contracts/release/extensions/utils/ExtensionBase.sol +++ b/contracts/release/extensions/utils/ExtensionBase.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../IExtension.sol"; +import {FundDeployerOwnerMixin} from "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IExtension} from "../IExtension.sol"; /// @title ExtensionBase Contract /// @author Enzyme Council diff --git a/contracts/release/extensions/utils/PermissionedVaultActionMixin.sol b/contracts/release/extensions/utils/PermissionedVaultActionMixin.sol index f58ed580b..f10150159 100644 --- a/contracts/release/extensions/utils/PermissionedVaultActionMixin.sol +++ b/contracts/release/extensions/utils/PermissionedVaultActionMixin.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../core/fund/comptroller/IComptroller.sol"; -import "../../core/fund/vault/IVault.sol"; +import {IComptroller} from "../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; /// @title PermissionedVaultActionMixin Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterFactory.sol b/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterFactory.sol index fd3939efb..0ed161da9 100644 --- a/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterFactory.sol +++ b/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterFactory.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../persistent/dispatcher/IDispatcher.sol"; -import "../../../utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol"; +import {IDispatcher} from "../../../persistent/dispatcher/IDispatcher.sol"; +import {BeaconProxyFactory} from "../../../utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol"; /// @title GasRelayPaymasterFactory Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterLib.sol b/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterLib.sol index d4be670f4..39980544d 100644 --- a/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterLib.sol +++ b/contracts/release/infrastructure/gas-relayer/GasRelayPaymasterLib.sol @@ -12,18 +12,19 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/utils/Address.sol"; -import "../../../external-interfaces/IGsnRelayHub.sol"; -import "../../../external-interfaces/IGsnTypes.sol"; -import "../../../external-interfaces/IWETH.sol"; -import "../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../core/fund/vault/IVault.sol"; -import "../../core/fund-deployer/FundDeployer.sol"; -import "../../extensions/policy-manager/PolicyManager.sol"; -import "./bases/GasRelayPaymasterLibBase2.sol"; -import "./IGasRelayPaymaster.sol"; -import "./IGasRelayPaymasterDepositor.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {Address} from "openzeppelin-solc-0.6/utils/Address.sol"; +import {IGsnPaymaster} from "../../../external-interfaces/IGsnPaymaster.sol"; +import {IGsnRelayHub} from "../../../external-interfaces/IGsnRelayHub.sol"; +import {IGsnTypes} from "../../../external-interfaces/IGsnTypes.sol"; +import {IWETH} from "../../../external-interfaces/IWETH.sol"; +import {IComptroller} from "../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../core/fund/vault/IVault.sol"; +import {IFundDeployer} from "../../core/fund-deployer/IFundDeployer.sol"; +import {IPolicyManager} from "../../extensions/policy-manager/IPolicyManager.sol"; +import {GasRelayPaymasterLibBase2} from "./bases/GasRelayPaymasterLibBase2.sol"; +import {IGasRelayPaymaster} from "./IGasRelayPaymaster.sol"; +import {IGasRelayPaymasterDepositor} from "./IGasRelayPaymasterDepositor.sol"; /// @title GasRelayPaymasterLib Contract /// @author Enzyme Council @@ -215,27 +216,27 @@ contract GasRelayPaymasterLib is IGasRelayPaymaster, GasRelayPaymasterLibBase2 { address parentComptroller = __getComptrollerForVault(_vaultProxy); if (_contract == parentComptroller) { if ( - _selector == ComptrollerLib.callOnExtension.selector - || _selector == ComptrollerLib.vaultCallOnContract.selector - || _selector == ComptrollerLib.buyBackProtocolFeeShares.selector - || _selector == ComptrollerLib.depositToGasRelayPaymaster.selector - || _selector == ComptrollerLib.setAutoProtocolFeeSharesBuyback.selector + _selector == IComptroller.callOnExtension.selector + || _selector == IComptroller.vaultCallOnContract.selector + || _selector == IComptroller.buyBackProtocolFeeShares.selector + || _selector == IComptroller.depositToGasRelayPaymaster.selector + || _selector == IComptroller.setAutoProtocolFeeSharesBuyback.selector ) { return true; } - } else if (_contract == ComptrollerLib(parentComptroller).getPolicyManager()) { + } else if (_contract == IComptroller(parentComptroller).getPolicyManager()) { if ( - _selector == PolicyManager.updatePolicySettingsForFund.selector - || _selector == PolicyManager.enablePolicyForFund.selector - || _selector == PolicyManager.disablePolicyForFund.selector + _selector == IPolicyManager.updatePolicySettingsForFund.selector + || _selector == IPolicyManager.enablePolicyForFund.selector + || _selector == IPolicyManager.disablePolicyForFund.selector ) { return __parseTxDataFirstParameterAsAddress(_txData) == getParentComptroller(); } - } else if (_contract == ComptrollerLib(parentComptroller).getFundDeployer()) { + } else if (_contract == IComptroller(parentComptroller).getFundDeployer()) { if ( - _selector == FundDeployer.createReconfigurationRequest.selector - || _selector == FundDeployer.executeReconfiguration.selector - || _selector == FundDeployer.cancelReconfiguration.selector + _selector == IFundDeployer.createReconfigurationRequest.selector + || _selector == IFundDeployer.executeReconfiguration.selector + || _selector == IFundDeployer.cancelReconfiguration.selector ) { return __parseTxDataFirstParameterAsAddress(_txData) == getParentVault(); } diff --git a/contracts/release/infrastructure/gas-relayer/GasRelayRecipientMixin.sol b/contracts/release/infrastructure/gas-relayer/GasRelayRecipientMixin.sol index 2a08994e8..6e13a6e30 100644 --- a/contracts/release/infrastructure/gas-relayer/GasRelayRecipientMixin.sol +++ b/contracts/release/infrastructure/gas-relayer/GasRelayRecipientMixin.sol @@ -9,8 +9,8 @@ file that was distributed with this source code. */ -import "../../../utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol"; -import "./IGasRelayPaymaster.sol"; +import {IBeaconProxyFactory} from "../../../utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol"; +import {IGasRelayPaymaster} from "./IGasRelayPaymaster.sol"; pragma solidity 0.6.12; diff --git a/contracts/release/infrastructure/gas-relayer/IGasRelayPaymaster.sol b/contracts/release/infrastructure/gas-relayer/IGasRelayPaymaster.sol index d7bd2b34b..63e0dfc84 100644 --- a/contracts/release/infrastructure/gas-relayer/IGasRelayPaymaster.sol +++ b/contracts/release/infrastructure/gas-relayer/IGasRelayPaymaster.sol @@ -12,7 +12,7 @@ pragma solidity >=0.6.0 <0.9.0; pragma experimental ABIEncoderV2; -import "../../../external-interfaces/IGsnPaymaster.sol"; +import {IGsnPaymaster} from "../../../external-interfaces/IGsnPaymaster.sol"; /// @title IGasRelayPaymaster Interface /// @author Enzyme Council diff --git a/contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol b/contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol index 95b08dd36..477b4c041 100644 --- a/contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol +++ b/contracts/release/infrastructure/gas-relayer/bases/GasRelayPaymasterLibBase2.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "./GasRelayPaymasterLibBase1.sol"; +import {GasRelayPaymasterLibBase1} from "./GasRelayPaymasterLibBase1.sol"; /// @title GasRelayPaymasterLibBase2 Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol b/contracts/release/infrastructure/price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol index 2f95bfe6a..b6b49ec7b 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "./IDerivativePriceFeed.sol"; +import {IDerivativePriceFeed} from "./IDerivativePriceFeed.sol"; /// @title AggregatedDerivativePriceFeedMixin Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/AuraBalancerV2LpStakingWrapperPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/AuraBalancerV2LpStakingWrapperPriceFeed.sol index 64befc5b3..d85c70a98 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/AuraBalancerV2LpStakingWrapperPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/AuraBalancerV2LpStakingWrapperPriceFeed.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "./ConvexCurveLpStakingWrapperPriceFeed.sol"; +import {ConvexCurveLpStakingWrapperPriceFeed} from "./ConvexCurveLpStakingWrapperPriceFeed.sol"; /// @title AuraBalancerV2LpStakingWrapperPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2GaugeTokenPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2GaugeTokenPriceFeed.sol index d5cc1bdfc..a0f009139 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2GaugeTokenPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2GaugeTokenPriceFeed.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../external-interfaces/IBalancerV2LiquidityGauge.sol"; -import "../IDerivativePriceFeed.sol"; +import {IBalancerV2LiquidityGauge} from "../../../../../external-interfaces/IBalancerV2LiquidityGauge.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title BalancerV2GaugeTokenPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2StablePoolPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2StablePoolPriceFeed.sol index 1cc31ba94..b6df4ecdf 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2StablePoolPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2StablePoolPriceFeed.sol @@ -10,13 +10,14 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/IBalancerV2PoolFactory.sol"; -import "../../../../../external-interfaces/IBalancerV2StablePool.sol"; -import "../../../../../external-interfaces/IBalancerV2Vault.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../IDerivativePriceFeed.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IBalancerV2PoolFactory} from "../../../../../external-interfaces/IBalancerV2PoolFactory.sol"; +import {IBalancerV2StablePool} from "../../../../../external-interfaces/IBalancerV2StablePool.sol"; +import {IBalancerV2Vault} from "../../../../../external-interfaces/IBalancerV2Vault.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {FundDeployerOwnerMixin} from "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title BalancerV2StablePoolPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2WeightedPoolPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2WeightedPoolPriceFeed.sol index 6611628f9..04d4c5a12 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2WeightedPoolPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/BalancerV2WeightedPoolPriceFeed.sol @@ -10,16 +10,16 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/IBalancerV2WeightedPool.sol"; -import "../../../../../external-interfaces/IBalancerV2PoolFactory.sol"; -import "../../../../../external-interfaces/IBalancerV2Vault.sol"; -import "../../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../../utils/0.6.12/BalancerV2LogExpMath.sol"; -import "../../../../../utils/0.6.12/BalancerV2FixedPoint.sol"; -import "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../../../value-interpreter/ValueInterpreter.sol"; -import "../IDerivativePriceFeed.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IBalancerV2WeightedPool} from "../../../../../external-interfaces/IBalancerV2WeightedPool.sol"; +import {IBalancerV2PoolFactory} from "../../../../../external-interfaces/IBalancerV2PoolFactory.sol"; +import {IBalancerV2Vault} from "../../../../../external-interfaces/IBalancerV2Vault.sol"; +import {AddressArrayLib} from "../../../../../utils/0.6.12/AddressArrayLib.sol"; +import {BalancerV2LogExpMath} from "../../../../../utils/0.6.12/BalancerV2LogExpMath.sol"; +import {BalancerV2FixedPoint} from "../../../../../utils/0.6.12/BalancerV2FixedPoint.sol"; +import {FundDeployerOwnerMixin} from "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IValueInterpreter} from "../../../value-interpreter/IValueInterpreter.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title BalancerV2WeightedPoolPriceFeed Contract /// @author Enzyme Council @@ -37,7 +37,7 @@ contract BalancerV2WeightedPoolPriceFeed is IDerivativePriceFeed, FundDeployerOw IBalancerV2Vault private immutable BALANCER_VAULT_CONTRACT; address private immutable INTERMEDIARY_ASSET; - ValueInterpreter private immutable VALUE_INTERPRETER_CONTRACT; + IValueInterpreter private immutable VALUE_INTERPRETER_CONTRACT; address[] private poolFactories; @@ -50,7 +50,7 @@ contract BalancerV2WeightedPoolPriceFeed is IDerivativePriceFeed, FundDeployerOw ) public FundDeployerOwnerMixin(_fundDeployer) { BALANCER_VAULT_CONTRACT = IBalancerV2Vault(_balancerVault); INTERMEDIARY_ASSET = _intermediaryAsset; - VALUE_INTERPRETER_CONTRACT = ValueInterpreter(_valueInterpreter); + VALUE_INTERPRETER_CONTRACT = IValueInterpreter(_valueInterpreter); __addPoolFactories(_poolFactories); } diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol index 6b4d4b0fe..506d9a418 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/CompoundPriceFeed.sol @@ -11,10 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../../external-interfaces/ICERC20.sol"; -import "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../IDerivativePriceFeed.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ICERC20} from "../../../../../external-interfaces/ICERC20.sol"; +import {FundDeployerOwnerMixin} from "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title CompoundPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/ConvexCurveLpStakingWrapperPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/ConvexCurveLpStakingWrapperPriceFeed.sol index e6121288a..062e18dd1 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/ConvexCurveLpStakingWrapperPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/ConvexCurveLpStakingWrapperPriceFeed.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "../../../staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; -import "../IDerivativePriceFeed.sol"; +import {IConvexCurveLpStakingWrapperFactory} from + "../../../staking-wrappers/convex-curve-lp/IConvexCurveLpStakingWrapperFactory.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title ConvexCurveLpStakingWrapperPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol index 1486314b6..97efbefbc 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/CurvePriceFeed.sol @@ -12,15 +12,15 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/ICurveAddressProvider.sol"; -import "../../../../../external-interfaces/ICurveLiquidityPool.sol"; -import "../../../../../external-interfaces/ICurvePoolOwner.sol"; -import "../../../../../external-interfaces/ICurveRegistryMain.sol"; -import "../../../../../external-interfaces/ICurveRegistryMetapoolFactory.sol"; -import "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../IDerivativePriceFeed.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {ICurveAddressProvider} from "../../../../../external-interfaces/ICurveAddressProvider.sol"; +import {ICurveLiquidityPool} from "../../../../../external-interfaces/ICurveLiquidityPool.sol"; +import {ICurvePoolOwner} from "../../../../../external-interfaces/ICurvePoolOwner.sol"; +import {ICurveRegistryMain} from "../../../../../external-interfaces/ICurveRegistryMain.sol"; +import {ICurveRegistryMetapoolFactory} from "../../../../../external-interfaces/ICurveRegistryMetapoolFactory.sol"; +import {FundDeployerOwnerMixin} from "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title CurvePriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol index f771b3468..9219d1bcb 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/IdlePriceFeed.sol @@ -11,10 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../../external-interfaces/IIdleTokenV4.sol"; -import "../IDerivativePriceFeed.sol"; -import "./utils/SingleUnderlyingDerivativeRegistryMixin.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IIdleTokenV4} from "../../../../../external-interfaces/IIdleTokenV4.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; +import {SingleUnderlyingDerivativeRegistryMixin} from "./utils/SingleUnderlyingDerivativeRegistryMixin.sol"; /// @title IdlePriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/PeggedDerivativesPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/PeggedDerivativesPriceFeed.sol index bdd8ebb71..8c629ac86 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/PeggedDerivativesPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/PeggedDerivativesPriceFeed.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "./utils/PeggedDerivativesPriceFeedBase.sol"; +import {PeggedDerivativesPriceFeedBase} from "./utils/PeggedDerivativesPriceFeedBase.sol"; /// @title PeggedDerivativesPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/RevertingPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/RevertingPriceFeed.sol index 1a4f18f18..d4494a8ef 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/RevertingPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/RevertingPriceFeed.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../IDerivativePriceFeed.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title RevertingPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/UniswapV2PoolPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/UniswapV2PoolPriceFeed.sol index 3317f2418..d11cdd447 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/UniswapV2PoolPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/UniswapV2PoolPriceFeed.sol @@ -12,13 +12,13 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/IUniswapV2Pair.sol"; -import "../../../../../utils/0.6.12/MathHelpers.sol"; -import "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../../../value-interpreter/ValueInterpreter.sol"; -import "../../utils/UniswapV2PoolTokenValueCalculator.sol"; -import "../IDerivativePriceFeed.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IUniswapV2Pair} from "../../../../../external-interfaces/IUniswapV2Pair.sol"; +import {MathHelpers} from "../../../../../utils/0.6.12/MathHelpers.sol"; +import {FundDeployerOwnerMixin} from "../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IValueInterpreter} from "../../../value-interpreter/IValueInterpreter.sol"; +import {UniswapV2PoolTokenValueCalculator} from "../../utils/UniswapV2PoolTokenValueCalculator.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title UniswapV2PoolPriceFeed Contract /// @author Enzyme Council @@ -105,11 +105,11 @@ contract UniswapV2PoolPriceFeed is if (IValueInterpreter(VALUE_INTERPRETER).isSupportedPrimitiveAsset(_token0)) { token1RateAmount_ = 10 ** _token1Decimals; token0RateAmount_ = - ValueInterpreter(VALUE_INTERPRETER).calcCanonicalAssetValue(_token1, token1RateAmount_, _token0); + IValueInterpreter(VALUE_INTERPRETER).calcCanonicalAssetValue(_token1, token1RateAmount_, _token0); } else { token0RateAmount_ = 10 ** _token0Decimals; token1RateAmount_ = - ValueInterpreter(VALUE_INTERPRETER).calcCanonicalAssetValue(_token0, token0RateAmount_, _token1); + IValueInterpreter(VALUE_INTERPRETER).calcCanonicalAssetValue(_token0, token0RateAmount_, _token1); } return (token0RateAmount_, token1RateAmount_); diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/WstethPriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/WstethPriceFeed.sol index 26a6ce99a..a646d86c5 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/WstethPriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/WstethPriceFeed.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "../../../../../external-interfaces/ILidoSteth.sol"; -import "../IDerivativePriceFeed.sol"; +import {ILidoSteth} from "../../../../../external-interfaces/ILidoSteth.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; /// @title WstethPriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol index 47b532bf9..d55a8ec9c 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/YearnVaultV2PriceFeed.sol @@ -11,12 +11,12 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../../external-interfaces/IYearnVaultV2.sol"; -import "../../../../../external-interfaces/IYearnVaultV2Registry.sol"; -import "../IDerivativePriceFeed.sol"; -import "./utils/SingleUnderlyingDerivativeRegistryMixin.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IYearnVaultV2} from "../../../../../external-interfaces/IYearnVaultV2.sol"; +import {IYearnVaultV2Registry} from "../../../../../external-interfaces/IYearnVaultV2Registry.sol"; +import {IDerivativePriceFeed} from "../IDerivativePriceFeed.sol"; +import {SingleUnderlyingDerivativeRegistryMixin} from "./utils/SingleUnderlyingDerivativeRegistryMixin.sol"; /// @title YearnVaultV2PriceFeed Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/PeggedDerivativesPriceFeedBase.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/PeggedDerivativesPriceFeedBase.sol index 62a5bd58f..a1594fd72 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/PeggedDerivativesPriceFeedBase.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/PeggedDerivativesPriceFeedBase.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../IDerivativePriceFeed.sol"; -import "./SingleUnderlyingDerivativeRegistryMixin.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IDerivativePriceFeed} from "../../IDerivativePriceFeed.sol"; +import {SingleUnderlyingDerivativeRegistryMixin} from "./SingleUnderlyingDerivativeRegistryMixin.sol"; /// @title PeggedDerivativesPriceFeedBase Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SinglePeggedDerivativePriceFeedBase.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SinglePeggedDerivativePriceFeedBase.sol index 2905d4f68..5eeb36732 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SinglePeggedDerivativePriceFeedBase.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SinglePeggedDerivativePriceFeedBase.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../IDerivativePriceFeed.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IDerivativePriceFeed} from "../../IDerivativePriceFeed.sol"; /// @title SinglePeggedDerivativePriceFeedBase Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SingleUnderlyingDerivativeRegistryMixin.sol b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SingleUnderlyingDerivativeRegistryMixin.sol index 0f3a05b87..74acd52df 100644 --- a/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SingleUnderlyingDerivativeRegistryMixin.sol +++ b/contracts/release/infrastructure/price-feeds/derivatives/feeds/utils/SingleUnderlyingDerivativeRegistryMixin.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {FundDeployerOwnerMixin} from "../../../../../utils/0.6.12/FundDeployerOwnerMixin.sol"; /// @title SingleUnderlyingDerivativeRegistryMixin Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/primitives/ChainlinkPriceFeedMixin.sol b/contracts/release/infrastructure/price-feeds/primitives/ChainlinkPriceFeedMixin.sol index d21a0aea2..63bf362c9 100644 --- a/contracts/release/infrastructure/price-feeds/primitives/ChainlinkPriceFeedMixin.sol +++ b/contracts/release/infrastructure/price-feeds/primitives/ChainlinkPriceFeedMixin.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../../../external-interfaces/IChainlinkAggregator.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {IChainlinkAggregator} from "../../../../external-interfaces/IChainlinkAggregator.sol"; /// @title ChainlinkPriceFeedMixin Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/primitives/UsdEthSimulatedAggregator.sol b/contracts/release/infrastructure/price-feeds/primitives/UsdEthSimulatedAggregator.sol index f0786e437..2243f6f28 100644 --- a/contracts/release/infrastructure/price-feeds/primitives/UsdEthSimulatedAggregator.sol +++ b/contracts/release/infrastructure/price-feeds/primitives/UsdEthSimulatedAggregator.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../../external-interfaces/IChainlinkAggregator.sol"; +import {IChainlinkAggregator} from "../../../../external-interfaces/IChainlinkAggregator.sol"; /// @title UsdEthSimulatedAggregator Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/price-feeds/utils/UniswapV2PoolTokenValueCalculator.sol b/contracts/release/infrastructure/price-feeds/utils/UniswapV2PoolTokenValueCalculator.sol index 37e83a149..d91c4a30e 100644 --- a/contracts/release/infrastructure/price-feeds/utils/UniswapV2PoolTokenValueCalculator.sol +++ b/contracts/release/infrastructure/price-feeds/utils/UniswapV2PoolTokenValueCalculator.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../../external-interfaces/IUniswapV2Factory.sol"; -import "../../../../external-interfaces/IUniswapV2Pair.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {IUniswapV2Factory} from "../../../../external-interfaces/IUniswapV2Factory.sol"; +import {IUniswapV2Pair} from "../../../../external-interfaces/IUniswapV2Pair.sol"; /// @title UniswapV2PoolTokenValueCalculator Contract /// @author Enzyme Council diff --git a/contracts/release/infrastructure/protocol-fees/IProtocolFeeTracker.sol b/contracts/release/infrastructure/protocol-fees/IProtocolFeeTracker.sol index 8b89192d4..035c7d84a 100644 --- a/contracts/release/infrastructure/protocol-fees/IProtocolFeeTracker.sol +++ b/contracts/release/infrastructure/protocol-fees/IProtocolFeeTracker.sol @@ -14,6 +14,10 @@ pragma solidity >=0.6.0 <0.9.0; /// @title IProtocolFeeTracker Interface /// @author Enzyme Council interface IProtocolFeeTracker { + function getFeeBpsForVault(address _vaultProxy) external view returns (uint256 feeBps_); + + function getLastPaidForVault(address _vaultProxy) external view returns (uint256 lastPaid_); + function initializeForVault(address) external; function payFee() external returns (uint256); diff --git a/contracts/release/infrastructure/protocol-fees/ProtocolFeeTracker.sol b/contracts/release/infrastructure/protocol-fees/ProtocolFeeTracker.sol index a853ce18b..631c2b671 100644 --- a/contracts/release/infrastructure/protocol-fees/ProtocolFeeTracker.sol +++ b/contracts/release/infrastructure/protocol-fees/ProtocolFeeTracker.sol @@ -11,10 +11,10 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "./IProtocolFeeTracker.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {FundDeployerOwnerMixin} from "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {IProtocolFeeTracker} from "./IProtocolFeeTracker.sol"; /// @title ProtocolFeeTracker Contract /// @author Enzyme Council @@ -92,7 +92,7 @@ contract ProtocolFeeTracker is IProtocolFeeTracker, FundDeployerOwnerMixin { /// @notice Gets the protocol fee rate (in bps) for a given VaultProxy /// @param _vaultProxy The VaultProxy /// @return feeBps_ The protocol fee (in bps) - function getFeeBpsForVault(address _vaultProxy) public view returns (uint256 feeBps_) { + function getFeeBpsForVault(address _vaultProxy) public view override returns (uint256 feeBps_) { feeBps_ = getFeeBpsOverrideForVault(_vaultProxy); if (feeBps_ == 0) { @@ -192,7 +192,7 @@ contract ProtocolFeeTracker is IProtocolFeeTracker, FundDeployerOwnerMixin { /// @notice Gets the lastPaid value for the given VaultProxy /// @param _vaultProxy The VaultProxy /// @return lastPaid_ The lastPaid value - function getLastPaidForVault(address _vaultProxy) public view returns (uint256 lastPaid_) { + function getLastPaidForVault(address _vaultProxy) public view override returns (uint256 lastPaid_) { return vaultProxyToLastPaid[_vaultProxy]; } } diff --git a/contracts/release/infrastructure/value-interpreter/ValueInterpreter.sol b/contracts/release/infrastructure/value-interpreter/ValueInterpreter.sol index 126826e71..c26a94f82 100644 --- a/contracts/release/infrastructure/value-interpreter/ValueInterpreter.sol +++ b/contracts/release/infrastructure/value-interpreter/ValueInterpreter.sol @@ -12,13 +12,14 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../../utils/0.6.12/MathHelpers.sol"; -import "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; -import "../price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol"; -import "../price-feeds/derivatives/IDerivativePriceFeed.sol"; -import "../price-feeds/primitives/ChainlinkPriceFeedMixin.sol"; -import "./IValueInterpreter.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {MathHelpers} from "../../../utils/0.6.12/MathHelpers.sol"; +import {FundDeployerOwnerMixin} from "../../utils/0.6.12/FundDeployerOwnerMixin.sol"; +import {AggregatedDerivativePriceFeedMixin} from "../price-feeds/derivatives/AggregatedDerivativePriceFeedMixin.sol"; +import {IDerivativePriceFeed} from "../price-feeds/derivatives/IDerivativePriceFeed.sol"; +import {ChainlinkPriceFeedMixin} from "../price-feeds/primitives/ChainlinkPriceFeedMixin.sol"; +import {IValueInterpreter} from "./IValueInterpreter.sol"; /// @title ValueInterpreter Contract /// @author Enzyme Council diff --git a/contracts/release/off-chain/AssetValueCalculator.sol b/contracts/release/off-chain/AssetValueCalculator.sol index d7652279c..8106de3b5 100644 --- a/contracts/release/off-chain/AssetValueCalculator.sol +++ b/contracts/release/off-chain/AssetValueCalculator.sol @@ -9,9 +9,9 @@ pragma solidity 0.6.12; -import "@openzeppelin/contracts/math/SafeMath.sol"; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "../infrastructure/value-interpreter/ValueInterpreter.sol"; +import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {IValueInterpreter} from "../infrastructure/value-interpreter/IValueInterpreter.sol"; /// @title AssetValueCalculator Contract /// @author Enzyme Council @@ -41,7 +41,7 @@ contract AssetValueCalculator { timestamp_ = block.timestamp; uint256 amount = 10 ** uint256(ERC20(_baseAsset).decimals()); - try ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue(_baseAsset, amount, _quoteAsset) returns ( + try IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue(_baseAsset, amount, _quoteAsset) returns ( uint256 value ) { value_ = value; diff --git a/contracts/release/off-chain/FundValueCalculator.sol b/contracts/release/off-chain/FundValueCalculator.sol index 9aacb60ea..f10287a6d 100644 --- a/contracts/release/off-chain/FundValueCalculator.sol +++ b/contracts/release/off-chain/FundValueCalculator.sol @@ -11,13 +11,14 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "../../persistent/off-chain/fund-value-calculator/IFundValueCalculator.sol"; -import "../core/fund/comptroller/ComptrollerLib.sol"; -import "../core/fund/vault/VaultLib.sol"; -import "../extensions/fee-manager/FeeManager.sol"; -import "../infrastructure/protocol-fees/ProtocolFeeTracker.sol"; -import "../infrastructure/value-interpreter/ValueInterpreter.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import {IFundValueCalculator} from "../../persistent/off-chain/fund-value-calculator/IFundValueCalculator.sol"; +import {IComptroller} from "../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../core/fund/vault/IVault.sol"; +import {IFeeManager} from "../extensions/fee-manager/IFeeManager.sol"; +import {IProtocolFeeTracker} from "../infrastructure/protocol-fees/IProtocolFeeTracker.sol"; +import {IValueInterpreter} from "../infrastructure/value-interpreter/IValueInterpreter.sol"; /// @title FundValueCalculator Contract /// @author Enzyme Council @@ -55,7 +56,7 @@ contract FundValueCalculator is IFundValueCalculator { function calcGavInAsset(address _vaultProxy, address _quoteAsset) external override returns (uint256 gav_) { (address denominationAsset, uint256 valueInDenominationAsset) = calcGav(_vaultProxy); - return ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( + return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAsset, valueInDenominationAsset, _quoteAsset ); } @@ -71,7 +72,7 @@ contract FundValueCalculator is IFundValueCalculator { { (address denominationAsset, uint256 valueInDenominationAsset) = calcGrossShareValue(_vaultProxy); - return ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( + return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAsset, valueInDenominationAsset, _quoteAsset ); } @@ -83,7 +84,7 @@ contract FundValueCalculator is IFundValueCalculator { function calcNavInAsset(address _vaultProxy, address _quoteAsset) external override returns (uint256 nav_) { (address denominationAsset, uint256 valueInDenominationAsset) = calcNav(_vaultProxy); - return ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( + return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAsset, valueInDenominationAsset, _quoteAsset ); } @@ -99,7 +100,7 @@ contract FundValueCalculator is IFundValueCalculator { { (address denominationAsset, uint256 valueInDenominationAsset) = calcNetShareValue(_vaultProxy); - return ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( + return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAsset, valueInDenominationAsset, _quoteAsset ); } @@ -117,7 +118,7 @@ contract FundValueCalculator is IFundValueCalculator { (address denominationAsset, uint256 valueInDenominationAsset) = calcNetValueForSharesHolder(_vaultProxy, _sharesHolder); - return ValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( + return IValueInterpreter(getValueInterpreter()).calcCanonicalAssetValue( denominationAsset, valueInDenominationAsset, _quoteAsset ); } @@ -129,7 +130,7 @@ contract FundValueCalculator is IFundValueCalculator { /// @return denominationAsset_ The denomination asset of the fund /// @return gav_ The GAV quoted in the denomination asset function calcGav(address _vaultProxy) public override returns (address denominationAsset_, uint256 gav_) { - ComptrollerLib comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); + IComptroller comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); return (comptrollerProxyContract.getDenominationAsset(), comptrollerProxyContract.calcGav()); } @@ -143,7 +144,7 @@ contract FundValueCalculator is IFundValueCalculator { override returns (address denominationAsset_, uint256 grossShareValue_) { - ComptrollerLib comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); + IComptroller comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); return (comptrollerProxyContract.getDenominationAsset(), comptrollerProxyContract.calcGrossShareValue()); } @@ -175,7 +176,7 @@ contract FundValueCalculator is IFundValueCalculator { override returns (address denominationAsset_, uint256 netShareValue_) { - ComptrollerLib comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); + IComptroller comptrollerProxyContract = __getComptrollerProxyForVault(_vaultProxy); // Settle Continuous fees comptrollerProxyContract.callOnExtension(getFeeManager(), 0, ""); @@ -221,7 +222,7 @@ contract FundValueCalculator is IFundValueCalculator { /// Includes the 50% buyback discount. function calcProtocolFeeDueForFund(address _vaultProxy) public view returns (uint256 sharesDue_) { // 1. Calc seconds since last payment - uint256 lastPaid = ProtocolFeeTracker(getProtocolFeeTracker()).getLastPaidForVault(_vaultProxy); + uint256 lastPaid = IProtocolFeeTracker(getProtocolFeeTracker()).getLastPaidForVault(_vaultProxy); if (lastPaid >= block.timestamp || lastPaid == 0) { return 0; } @@ -232,7 +233,7 @@ contract FundValueCalculator is IFundValueCalculator { uint256 sharesSupply = ERC20(_vaultProxy).totalSupply(); uint256 rawSharesDue = sharesSupply.mul( - ProtocolFeeTracker(getProtocolFeeTracker()).getFeeBpsForVault(_vaultProxy) + IProtocolFeeTracker(getProtocolFeeTracker()).getFeeBpsForVault(_vaultProxy) ).mul(secondsDue).div(SECONDS_IN_YEAR).div(MAX_BPS); uint256 supplyNetRawSharesDue = sharesSupply.sub(rawSharesDue); @@ -262,9 +263,9 @@ contract FundValueCalculator is IFundValueCalculator { function __getComptrollerProxyForVault(address _vaultProxy) private view - returns (ComptrollerLib comptrollerProxyContract_) + returns (IComptroller comptrollerProxyContract_) { - return ComptrollerLib(VaultLib(payable(_vaultProxy)).getAccessor()); + return IComptroller(IVault(_vaultProxy).getAccessor()); } /////////////////// diff --git a/contracts/release/peripheral/UnpermissionedActionsWrapper.sol b/contracts/release/peripheral/UnpermissionedActionsWrapper.sol index 86013d5bf..9c311c0f0 100644 --- a/contracts/release/peripheral/UnpermissionedActionsWrapper.sol +++ b/contracts/release/peripheral/UnpermissionedActionsWrapper.sol @@ -11,8 +11,9 @@ pragma solidity 0.6.12; -import "../core/fund/comptroller/ComptrollerLib.sol"; -import "../extensions/fee-manager/FeeManager.sol"; +import {IComptroller} from "../core/fund/comptroller/IComptroller.sol"; +import {IFeeManager} from "../extensions/fee-manager/IFeeManager.sol"; +import {IFee} from "../extensions/fee-manager/IFee.sol"; /// @title UnpermissionedActionsWrapper Contract /// @author Enzyme Council @@ -32,7 +33,7 @@ contract UnpermissionedActionsWrapper { view returns (address[] memory continuousFees_) { - FeeManager feeManagerContract = FeeManager(getFeeManager()); + IFeeManager feeManagerContract = IFeeManager(getFeeManager()); address[] memory fees = feeManagerContract.getEnabledFeesForFund(_comptrollerProxy); @@ -75,7 +76,7 @@ contract UnpermissionedActionsWrapper { address _comptrollerProxy, address[] calldata _fees ) external { - ComptrollerLib comptrollerProxyContract = ComptrollerLib(_comptrollerProxy); + IComptroller comptrollerProxyContract = IComptroller(_comptrollerProxy); comptrollerProxyContract.callOnExtension(getFeeManager(), 0, ""); comptrollerProxyContract.callOnExtension(getFeeManager(), 1, abi.encode(_fees)); diff --git a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperFactory.sol b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperFactory.sol index 43a191053..536f210ad 100644 --- a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperFactory.sol +++ b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperFactory.sol @@ -9,8 +9,8 @@ pragma solidity 0.6.12; -import "./ArbitraryTokenPhasedSharesWrapperLib.sol"; -import "./ArbitraryTokenPhasedSharesWrapperProxy.sol"; +import {ArbitraryTokenPhasedSharesWrapperLib} from "./ArbitraryTokenPhasedSharesWrapperLib.sol"; +import {ArbitraryTokenPhasedSharesWrapperProxy} from "./ArbitraryTokenPhasedSharesWrapperProxy.sol"; /// @title ArbitraryTokenPhasedSharesWrapperFactory Contract /// @author Enzyme Council diff --git a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperLib.sol b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperLib.sol index 14b67747c..e7f1c6a74 100644 --- a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperLib.sol +++ b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperLib.sol @@ -11,15 +11,16 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; -import "../../../../persistent/address-list-registry/AddressListRegistry.sol"; -import "../../../../persistent/dispatcher/IDispatcher.sol"; -import "../../../../utils/0.6.12/AddressArrayLib.sol"; -import "../../../../utils/0.6.12/AssetHelpers.sol"; -import "../../../../utils/0.6.12/MathHelpers.sol"; -import "../../../core/fund/comptroller/ComptrollerLib.sol"; -import "../../../core/fund/vault/VaultLib.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {IAddressListRegistry} from "../../../../persistent/address-list-registry/IAddressListRegistry.sol"; +import {IDispatcher} from "../../../../persistent/dispatcher/IDispatcher.sol"; +import {IExternalPosition} from "../../../../persistent/external-positions/IExternalPosition.sol"; +import {AddressArrayLib} from "../../../../utils/0.6.12/AddressArrayLib.sol"; +import {AssetHelpers} from "../../../../utils/0.6.12/AssetHelpers.sol"; +import {MathHelpers} from "../../../../utils/0.6.12/MathHelpers.sol"; +import {IComptroller} from "../../../core/fund/comptroller/IComptroller.sol"; +import {IVault} from "../../../core/fund/vault/IVault.sol"; /// @title ArbitraryTokenPhasedSharesWrapperLib Contract /// @author Enzyme Council @@ -78,7 +79,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper uint256 private constant MAX_BPS = 10000; uint256 private constant SECONDS_IN_YEAR = 31557600; // 60*60*24*365.25 - AddressListRegistry private immutable ADDRESS_LIST_REGISTRY_CONTRACT; + IAddressListRegistry private immutable ADDRESS_LIST_REGISTRY_CONTRACT; IDispatcher private immutable DISPATCHER_CONTRACT; address private immutable FUND_DEPLOYER_V4; address private immutable INITIALIZER; @@ -134,7 +135,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper uint256 _protocolFeeBps, address _initializer ) public ERC20("Wrapped Enzyme Shares Lib", "wENZF-lib") { - ADDRESS_LIST_REGISTRY_CONTRACT = AddressListRegistry(_addressListRegistry); + ADDRESS_LIST_REGISTRY_CONTRACT = IAddressListRegistry(_addressListRegistry); DISPATCHER_CONTRACT = IDispatcher(_dispatcher); FUND_DEPLOYER_V4 = _fundDeployerV4; INITIALIZER = _initializer; @@ -218,7 +219,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper /// @dev Helper to get the owner, who is the same as the VaultProxy owner function __getOwnerOfVaultProxy(address _vaultProxy) private view returns (address owner_) { - return VaultLib(payable(_vaultProxy)).getOwner(); + return IVault(_vaultProxy).getOwner(); } /// @dev Helper to set the allowed depositors listId @@ -407,7 +408,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper require(getState() == State.Deposit, "enterLockedState: Invalid state"); // Buy shares from the fund, using whatever amount of the denomination asset is in the current contract - ComptrollerLib comptrollerProxyContract = ComptrollerLib(VaultLib(payable(vaultProxyMem)).getAccessor()); + IComptroller comptrollerProxyContract = IComptroller(IVault(vaultProxyMem).getAccessor()); ERC20 denominationAssetContract = ERC20(comptrollerProxyContract.getDenominationAsset()); uint256 investmentAmount = denominationAssetContract.balanceOf(address(this)); @@ -442,7 +443,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper // Validate that there are no active external positions that contain value. // Allows a fund to keep an external position active, so long as it has been emptied. - address[] memory externalPositions = VaultLib(payable(vaultProxyMem)).getActiveExternalPositions(); + address[] memory externalPositions = IVault(vaultProxyMem).getActiveExternalPositions(); for (uint256 i; i < externalPositions.length; i++) { (, uint256[] memory managedAssetAmounts) = IExternalPosition(externalPositions[i]).getManagedAssets(); for (uint256 j; j < managedAssetAmounts.length; j++) { @@ -451,7 +452,7 @@ contract ArbitraryTokenPhasedSharesWrapperLib is ERC20, AssetHelpers, MathHelper } // Redeem all fund shares, receiving an in-kind distribution of vault holdings - ComptrollerLib comptrollerProxyContract = ComptrollerLib(VaultLib(payable(getVaultProxy())).getAccessor()); + IComptroller comptrollerProxyContract = IComptroller(IVault(getVaultProxy()).getAccessor()); // Always includes the deposit token as an "additional asset" to claim, // in case it is untracked in the vault address[] memory additionalAssetsToClaim = _untrackedAssetsToClaim.addUniqueItem(getDepositToken()); diff --git a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperProxy.sol b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperProxy.sol index 44aa8969b..5724b43d8 100644 --- a/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperProxy.sol +++ b/contracts/release/peripheral/shares-wrappers/arbitrary-token-phased/ArbitraryTokenPhasedSharesWrapperProxy.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../../../utils/0.6.12/NonUpgradableProxy.sol"; +import {NonUpgradableProxy} from "../../../../utils/0.6.12/NonUpgradableProxy.sol"; /// @title ArbitraryTokenPhasedSharesWrapperProxy Contract /// @author Enzyme Council diff --git a/contracts/release/utils/0.6.12/FundDeployerOwnerMixin.sol b/contracts/release/utils/0.6.12/FundDeployerOwnerMixin.sol index 72c8cc22c..35b2ef49e 100644 --- a/contracts/release/utils/0.6.12/FundDeployerOwnerMixin.sol +++ b/contracts/release/utils/0.6.12/FundDeployerOwnerMixin.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "../../core/fund-deployer/IFundDeployer.sol"; +import {IFundDeployer} from "../../core/fund-deployer/IFundDeployer.sol"; /// @title FundDeployerOwnerMixin Contract /// @author Enzyme Council diff --git a/contracts/utils/0.6.12/AssetHelpers.sol b/contracts/utils/0.6.12/AssetHelpers.sol index 1f511054e..b68ff5ddf 100644 --- a/contracts/utils/0.6.12/AssetHelpers.sol +++ b/contracts/utils/0.6.12/AssetHelpers.sol @@ -11,9 +11,9 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; -import "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {ERC20} from "openzeppelin-solc-0.6/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.6/token/ERC20/SafeERC20.sol"; /// @title AssetHelpers Contract /// @author Enzyme Council diff --git a/contracts/utils/0.6.12/MathHelpers.sol b/contracts/utils/0.6.12/MathHelpers.sol index 625360dbb..8426719e4 100644 --- a/contracts/utils/0.6.12/MathHelpers.sol +++ b/contracts/utils/0.6.12/MathHelpers.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "openzeppelin-solc-0.6/math/SafeMath.sol"; +import {SafeMath} from "openzeppelin-solc-0.6/math/SafeMath.sol"; /// @title MathHelpers Contract /// @author Enzyme Council diff --git a/contracts/utils/0.6.12/beacon-proxy/BeaconProxy.sol b/contracts/utils/0.6.12/beacon-proxy/BeaconProxy.sol index 019357442..9b06071d2 100644 --- a/contracts/utils/0.6.12/beacon-proxy/BeaconProxy.sol +++ b/contracts/utils/0.6.12/beacon-proxy/BeaconProxy.sol @@ -11,7 +11,7 @@ pragma solidity 0.6.12; -import "./IBeacon.sol"; +import {IBeacon} from "./IBeacon.sol"; /// @title BeaconProxy Contract /// @author Enzyme Council diff --git a/contracts/utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol b/contracts/utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol index 33eae0766..3dd7b6e5f 100644 --- a/contracts/utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol +++ b/contracts/utils/0.6.12/beacon-proxy/BeaconProxyFactory.sol @@ -11,8 +11,8 @@ pragma solidity 0.6.12; -import "./BeaconProxy.sol"; -import "./IBeaconProxyFactory.sol"; +import {BeaconProxy} from "./BeaconProxy.sol"; +import {IBeaconProxyFactory} from "./IBeaconProxyFactory.sol"; /// @title BeaconProxyFactory Contract /// @author Enzyme Council diff --git a/contracts/utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol b/contracts/utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol index e003388c4..f598b9093 100644 --- a/contracts/utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol +++ b/contracts/utils/0.6.12/beacon-proxy/IBeaconProxyFactory.sol @@ -9,7 +9,7 @@ file that was distributed with this source code. */ -import "./IBeacon.sol"; +import {IBeacon} from "./IBeacon.sol"; pragma solidity 0.6.12; diff --git a/contracts/utils/0.8.19/AssetHelpers.sol b/contracts/utils/0.8.19/AssetHelpers.sol index 896cf2c54..e9dbee15e 100644 --- a/contracts/utils/0.8.19/AssetHelpers.sol +++ b/contracts/utils/0.8.19/AssetHelpers.sol @@ -11,8 +11,8 @@ pragma solidity 0.8.19; -import "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; -import "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; +import {ERC20} from "openzeppelin-solc-0.8/token/ERC20/ERC20.sol"; +import {SafeERC20} from "openzeppelin-solc-0.8/token/ERC20/utils/SafeERC20.sol"; /// @title AssetHelpers Contract /// @author Enzyme Council