@enzymefinance/testutils 4.0.0-next.2 → 4.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/declarations/src/assertions.d.ts +2 -2
- package/dist/declarations/src/deployment.d.ts +172 -68
- package/dist/declarations/src/gasRelayer.d.ts +14 -12
- package/dist/declarations/src/helpers.d.ts +5 -4
- package/dist/declarations/src/scaffolding/assets.d.ts +4 -4
- package/dist/declarations/src/scaffolding/chainlink.d.ts +2 -2
- package/dist/declarations/src/scaffolding/common.d.ts +1 -1
- package/dist/declarations/src/scaffolding/core.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +8 -6
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +16 -12
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +100 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +33 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +101 -84
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +6 -6
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +3 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +17 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +23 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +29 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +15 -12
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +9 -9
- package/dist/declarations/src/scaffolding/setup.d.ts +11 -9
- package/dist/declarations/src/scaffolding/shares.d.ts +4 -4
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +11 -2
- package/dist/declarations/src/whales.d.ts +24 -19
- package/dist/enzymefinance-testutils.browser.cjs.js +1541 -673
- package/dist/enzymefinance-testutils.browser.esm.js +1502 -655
- package/dist/enzymefinance-testutils.cjs.dev.js +1541 -673
- package/dist/enzymefinance-testutils.cjs.prod.js +1541 -673
- package/dist/enzymefinance-testutils.esm.js +1502 -655
- package/package.json +6 -6
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +221 -120
- package/src/gasRelayer.ts +17 -18
- package/src/helpers.ts +6 -4
- package/src/scaffolding/assets.ts +7 -6
- package/src/scaffolding/chainlink.ts +2 -2
- package/src/scaffolding/common.ts +1 -1
- package/src/scaffolding/core.ts +4 -8
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +14 -9
- package/src/scaffolding/extensions/external-positions/compound.ts +28 -29
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +32 -36
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +284 -0
- package/src/scaffolding/extensions/fees.ts +1 -1
- package/src/scaffolding/extensions/integrations/aave.ts +6 -8
- package/src/scaffolding/extensions/integrations/compound.ts +171 -11
- package/src/scaffolding/extensions/integrations/curve.ts +303 -255
- package/src/scaffolding/extensions/integrations/idle.ts +9 -11
- package/src/scaffolding/extensions/integrations/index.ts +3 -0
- package/src/scaffolding/extensions/integrations/mock.ts +11 -13
- package/src/scaffolding/extensions/integrations/olympusV2.ts +71 -0
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +16 -11
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +73 -0
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +117 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +45 -31
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +22 -19
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +9 -10
- package/src/scaffolding/extensions/integrations/yearn.ts +9 -11
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +9 -7
- package/src/scaffolding/extensions/policies.ts +2 -1
- package/src/scaffolding/setup.ts +27 -13
- package/src/scaffolding/shares.ts +5 -4
- package/src/scaffolding/vaultCalls.ts +32 -2
- package/src/types.d.ts +1 -0
- package/src/whales.ts +36 -18
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator';
|
|
2
2
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
3
|
-
import {
|
|
3
|
+
import { AaveAdapter, AavePriceFeed, AddressListRegistry, AllowedAdapterIncomingAssetsPolicy, AllowedAdaptersPolicy, AllowedAssetsForRedemptionPolicy, AllowedDepositRecipientsPolicy, AllowedExternalPositionTypesPolicy, AllowedSharesTransferRecipientsPolicy, CompoundAdapter, CompoundDebtPositionLib, CompoundDebtPositionParser, CompoundPriceFeed, ComptrollerLib, ConvexCurveLpStakingAdapter, ConvexCurveLpStakingWrapperFactory, ConvexCurveLpStakingWrapperPriceFeed, CumulativeSlippageTolerancePolicy, CurveExchangeAdapter, CurveLiquidityAaveAdapter, CurveLiquidityAdapter, CurveLiquiditySethAdapter, CurveLiquidityStethAdapter, CurvePriceFeed, DepositWrapper, Dispatcher, EntranceRateBurnFee, EntranceRateDirectFee, ExitRateBurnFee, ExitRateDirectFee, ExternalPositionFactory, ExternalPositionManager, FeeManager, FundDeployer, FundValueCalculator, FundValueCalculatorRouter, FundValueCalculatorUsdWrapper, FuseAdapter, FusePriceFeed, GasRelayPaymasterFactory, IdleAdapter, IdlePriceFeed, IntegrationManager, LidoStethPriceFeed, ManagementFee, MinAssetBalancesPostRedemptionPolicy, MinMaxInvestmentPolicy, OlympusV2Adapter, OnlyRemoveDustExternalPositionPolicy, OnlyUntrackDustOrPricelessAssetsPolicy, ParaSwapV4Adapter, ParaSwapV5Adapter, PerformanceFee, PolicyManager, PoolTogetherV4Adapter, PoolTogetherV4PriceFeed, ProtocolFeeReserveLib, ProtocolFeeTracker, RevertingPriceFeed, StakehoundEthPriceFeed, SynthetixAdapter, UniswapV2ExchangeAdapter, UniswapV2LiquidityAdapter, UniswapV2PoolPriceFeed, UniswapV3Adapter, UnpermissionedActionsWrapper, ValueInterpreter, VaultLib, YearnVaultV2Adapter, YearnVaultV2PriceFeed, ZeroExV2Adapter, IntegrationManagerActionId, addTrackedAssetsToVaultArgs, removeTrackedAssetsFromVaultArgs, StandardToken, callOnExternalPositionArgs, ExternalPositionManagerActionId, IExternalPositionProxy, encodeArgs, externalPositionReactivateArgs, externalPositionRemoveArgs, compoundExternalPositionActionArgs, CompoundDebtPositionActionId, ExternalPositionType, MockGenericExternalPositionParser, MockGenericExternalPositionLib, mockGenericExternalPositionActionArgs, MockGenericExternalPositionActionId, uniswapV3LiquidityPositionAddLiquidityArgs, UniswapV3LiquidityPositionActionId, uniswapV3LiquidityPositionCollectArgs, UniswapV3LiquidityPositionLib, uniswapV3LiquidityPositionMintArgs, uniswapV3LiquidityPositionPurgeArgs, uniswapV3LiquidityPositionRemoveLiquidityArgs, feeManagerConfigArgs, FeeSettlementType, FeeHook, IFee, aaveLendArgs, callOnIntegrationArgs, lendSelector, aaveRedeemArgs, redeemSelector, compoundClaimRewardsArgs, claimRewardsSelector, compoundArgs, curveTakeOrderArgs, takeOrderSelector, curveClaimRewardsArgs, curveLendArgs, curveLendAndStakeArgs, lendAndStakeSelector, curveRedeemArgs, curveStakeArgs, stakeSelector, curveUnstakeArgs, unstakeSelector, curveUnstakeAndRedeemArgs, unstakeAndRedeemSelector, curveAaveLendArgs, curveAaveLendAndStakeArgs, curveAaveRedeemArgs, curveAaveStakeArgs, curveAaveUnstakeAndRedeemArgs, curveAaveUnstakeArgs, curveSethLendArgs, curveSethLendAndStakeArgs, curveSethRedeemArgs, curveSethStakeArgs, curveSethUnstakeAndRedeemArgs, curveSethUnstakeArgs, curveStethLendArgs, curveStethLendAndStakeArgs, curveStethRedeemArgs, curveStethStakeArgs, curveStethUnstakeAndRedeemArgs, curveStethUnstakeArgs, idleClaimRewardsArgs, idleLendArgs, idleRedeemArgs, sighash, olympusV2StakeArgs, olympusV2UnstakeArgs, paraSwapV4TakeOrderArgs, paraSwapV5TakeOrderArgs, poolTogetherV4LendArgs, poolTogetherV4RedeemArgs, poolTogetherV4ClaimRewardsArgs, synthetixAssignExchangeDelegateSelector, synthetixRedeemArgs, synthetixTakeOrderArgs, uniswapV2LendArgs, uniswapV2RedeemArgs, uniswapV2TakeOrderArgs, uniswapV3TakeOrderArgs, yearnVaultV2LendArgs, yearnVaultV2RedeemArgs, zeroExV2TakeOrderArgs, policyManagerConfigArgs, PolicyHook, IPolicy, encodeFunctionData, ComptrollerProxy, VaultProxy, GasRelayPaymasterLib, addressListRegistryCreateListSelector, curveMinterMintSelector, curveMinterMintManySelector, curveMinterToggleApproveMintSelector, IGsnRelayHub, createSignedRelayRequest, isTypedDataSigner } from '@enzymefinance/protocol';
|
|
4
4
|
import { utils, constants, BigNumber } from 'ethers';
|
|
5
5
|
import { extractEvent, contract, resolveAddress, randomAddress } from '@enzymefinance/ethers';
|
|
6
|
-
import { ExternalPositionManagerActionId as ExternalPositionManagerActionId$1, encodeArgs as encodeArgs$1, MockGenericExternalPositionParser, MockGenericExternalPositionLib, VaultLib as VaultLib$1, mockGenericExternalPositionActionArgs, MockGenericExternalPositionActionId } from '@enzymefinance/protocol/src';
|
|
7
6
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
7
|
+
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
|
9
9
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
10
10
|
|
|
@@ -104,77 +104,84 @@ function _deployProtocolFixture() {
|
|
|
104
104
|
config = fixture['Config'].linkedData; // prettier-ignore
|
|
105
105
|
|
|
106
106
|
deployment = {
|
|
107
|
-
|
|
108
|
-
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
|
109
|
-
fundDeployer: new FundDeployer(fixture['FundDeployer'].address, deployer),
|
|
110
|
-
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
|
107
|
+
aaveAdapter: new AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
|
111
108
|
aavePriceFeed: new AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
|
109
|
+
addressListRegistry: new AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
|
110
|
+
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
|
111
|
+
allowedAdaptersPolicy: new AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
|
112
|
+
allowedAssetsForRedemptionPolicy: new AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
|
113
|
+
allowedDepositRecipientsPolicy: new AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
|
114
|
+
allowedExternalPositionTypesPolicy: new AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
|
115
|
+
allowedSharesTransferRecipientsPolicy: new AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
|
116
|
+
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
|
112
117
|
compoundDebtPositionLib: new CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
|
113
118
|
compoundDebtPositionParser: new CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
|
114
119
|
compoundPriceFeed: new CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
|
122
|
-
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
|
123
|
-
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
|
124
|
-
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
|
125
|
-
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
|
126
|
-
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
|
120
|
+
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
|
121
|
+
convexCurveLpStakingAdapter: new ConvexCurveLpStakingAdapter(fixture['ConvexCurveLpStakingAdapter'].address, deployer),
|
|
122
|
+
convexCurveLpStakingWrapperFactory: new ConvexCurveLpStakingWrapperFactory(fixture['ConvexCurveLpStakingWrapperFactory'].address, deployer),
|
|
123
|
+
convexCurveLpStakingWrapperPriceFeed: new ConvexCurveLpStakingWrapperPriceFeed(fixture['ConvexCurveLpStakingWrapperPriceFeed'].address, deployer),
|
|
124
|
+
cumulativeSlippageTolerancePolicy: new CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
|
125
|
+
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
|
127
126
|
curveLiquidityAaveAdapter: new CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
|
128
|
-
|
|
127
|
+
curveLiquidityAdapter: new CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
|
129
128
|
curveLiquiditySethAdapter: new CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
|
130
129
|
curveLiquidityStethAdapter: new CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
|
135
|
-
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
|
136
|
-
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer),
|
|
137
|
-
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
|
138
|
-
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
|
139
|
-
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
|
140
|
-
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
|
141
|
-
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
|
142
|
-
feeManager: new FeeManager(fixture['FeeManager'].address, deployer),
|
|
143
|
-
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
|
130
|
+
curvePriceFeed: new CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
|
131
|
+
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
|
132
|
+
dispatcher: new Dispatcher(fixture['Dispatcher'].address, deployer),
|
|
144
133
|
entranceRateBurnFee: new EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
|
145
134
|
entranceRateDirectFee: new EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
|
146
135
|
exitRateBurnFee: new ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
|
147
136
|
exitRateDirectFee: new ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
|
137
|
+
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
|
138
|
+
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
|
139
|
+
feeManager: new FeeManager(fixture['FeeManager'].address, deployer),
|
|
140
|
+
fundDeployer: new FundDeployer(fixture['FundDeployer'].address, deployer),
|
|
141
|
+
fundValueCalculator: new FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
|
142
|
+
fundValueCalculatorRouter: new FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
|
143
|
+
fundValueCalculatorUsdWrapper: new FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
|
144
|
+
fuseAdapter: new FuseAdapter(fixture['FuseAdapter'].address, deployer),
|
|
145
|
+
fusePriceFeed: new FusePriceFeed(fixture['FusePriceFeed'].address, deployer),
|
|
146
|
+
gasRelayPaymasterFactory: new GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
|
147
|
+
idleAdapter: new IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
|
148
|
+
idlePriceFeed: new IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
|
149
|
+
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
|
150
|
+
lidoStethPriceFeed: new LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
|
148
151
|
managementFee: new ManagementFee(fixture['ManagementFee'].address, deployer),
|
|
149
|
-
|
|
150
|
-
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
|
151
|
-
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
|
152
|
-
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
|
152
|
+
minAssetBalancesPostRedemptionPolicy: new MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
|
153
153
|
minMaxInvestmentPolicy: new MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
olympusV2Adapter: new OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
|
155
|
+
onlyRemoveDustExternalPositionPolicy: new OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
|
156
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
|
157
|
+
paraSwapV4Adapter: new ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
|
158
|
+
paraSwapV5Adapter: new ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
|
159
|
+
performanceFee: new PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
|
160
|
+
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
|
161
|
+
poolTogetherV4Adapter: new PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
|
162
|
+
poolTogetherV4PriceFeed: new PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
|
157
163
|
protocolFeeReserveLib: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
|
158
164
|
protocolFeeReserveProxy: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
|
159
165
|
protocolFeeTracker: new ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
|
167
|
+
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
|
168
|
+
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
|
169
|
+
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
|
170
|
+
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
|
171
|
+
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
|
172
|
+
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
|
173
|
+
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
|
174
|
+
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
|
175
|
+
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
|
176
|
+
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
|
177
|
+
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
|
178
|
+
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
|
172
179
|
};
|
|
173
180
|
return _context3.abrupt("return", {
|
|
174
|
-
deployer: deployer,
|
|
175
|
-
deployment: deployment,
|
|
176
181
|
accounts: accounts,
|
|
177
|
-
config: config
|
|
182
|
+
config: config,
|
|
183
|
+
deployer: deployer,
|
|
184
|
+
deployment: deployment
|
|
178
185
|
});
|
|
179
186
|
|
|
180
187
|
case 12:
|
|
@@ -187,30 +194,6 @@ function _deployProtocolFixture() {
|
|
|
187
194
|
return _deployProtocolFixture.apply(this, arguments);
|
|
188
195
|
}
|
|
189
196
|
|
|
190
|
-
// TODO: Remove this.
|
|
191
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
192
|
-
function defaultTestDeployment(_x2) {
|
|
193
|
-
return _defaultTestDeployment.apply(this, arguments);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function _defaultTestDeployment() {
|
|
197
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_) {
|
|
198
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
199
|
-
while (1) {
|
|
200
|
-
switch (_context4.prev = _context4.next) {
|
|
201
|
-
case 0:
|
|
202
|
-
throw new Error('Removed');
|
|
203
|
-
|
|
204
|
-
case 1:
|
|
205
|
-
case "end":
|
|
206
|
-
return _context4.stop();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}, _callee4);
|
|
210
|
-
}));
|
|
211
|
-
return _defaultTestDeployment.apply(this, arguments);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
197
|
function addTrackedAssetsToVault(_ref) {
|
|
215
198
|
var signer = _ref.signer,
|
|
216
199
|
comptrollerProxy = _ref.comptrollerProxy,
|
|
@@ -243,12 +226,12 @@ function _addNewAssetsToFund() {
|
|
|
243
226
|
switch (_context.prev = _context.next) {
|
|
244
227
|
case 0:
|
|
245
228
|
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, assets = _ref.assets, _ref$amounts = _ref.amounts, amounts = _ref$amounts === void 0 ? new Array(assets.length).fill(1) : _ref$amounts;
|
|
246
|
-
// First, add tracked assets
|
|
229
|
+
// First, add tracked assets
|
|
247
230
|
receipt = addTrackedAssetsToVault({
|
|
248
|
-
|
|
231
|
+
assets: assets,
|
|
249
232
|
comptrollerProxy: comptrollerProxy,
|
|
250
233
|
integrationManager: integrationManager,
|
|
251
|
-
|
|
234
|
+
signer: signer
|
|
252
235
|
}); // Then seed the vault with balances as necessary
|
|
253
236
|
|
|
254
237
|
_context.next = 4;
|
|
@@ -400,13 +383,13 @@ function createFundDeployer(_x) {
|
|
|
400
383
|
|
|
401
384
|
function _createFundDeployer() {
|
|
402
385
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
403
|
-
var deployer,
|
|
386
|
+
var deployer, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
|
404
387
|
|
|
405
388
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
406
389
|
while (1) {
|
|
407
390
|
switch (_context.prev = _context.next) {
|
|
408
391
|
case 0:
|
|
409
|
-
deployer = _ref.deployer,
|
|
392
|
+
deployer = _ref.deployer, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
|
410
393
|
_context.next = 3;
|
|
411
394
|
return vaultLib.getMlnToken();
|
|
412
395
|
|
|
@@ -457,7 +440,7 @@ function _createFundDeployer() {
|
|
|
457
440
|
case 31:
|
|
458
441
|
nextIntegrationManager = _context.sent;
|
|
459
442
|
_context.next = 34;
|
|
460
|
-
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager,
|
|
443
|
+
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, gasRelayPaymasterFactory, mlnToken, wethToken);
|
|
461
444
|
|
|
462
445
|
case 34:
|
|
463
446
|
nextComptrollerLib = _context.sent;
|
|
@@ -494,40 +477,50 @@ function _createFundDeployer() {
|
|
|
494
477
|
case 54:
|
|
495
478
|
_context.t11 = _context.sent;
|
|
496
479
|
_context.next = 57;
|
|
497
|
-
return vaultLib.
|
|
480
|
+
return vaultLib.getMlnBurner();
|
|
498
481
|
|
|
499
482
|
case 57:
|
|
500
483
|
_context.t12 = _context.sent;
|
|
501
484
|
_context.next = 60;
|
|
502
|
-
return
|
|
485
|
+
return vaultLib.getWethToken();
|
|
503
486
|
|
|
504
487
|
case 60:
|
|
505
|
-
|
|
488
|
+
_context.t13 = _context.sent;
|
|
506
489
|
_context.next = 63;
|
|
507
|
-
return
|
|
490
|
+
return vaultLib.getPositionsLimit();
|
|
508
491
|
|
|
509
492
|
case 63:
|
|
493
|
+
_context.t14 = _context.sent;
|
|
494
|
+
_context.next = 66;
|
|
495
|
+
return _context.t5.deploy.call(_context.t5, _context.t6, _context.t7, _context.t8, _context.t9, _context.t10, _context.t11, _context.t12, _context.t13, _context.t14);
|
|
496
|
+
|
|
497
|
+
case 66:
|
|
498
|
+
nextVaultLib = _context.sent;
|
|
499
|
+
_context.next = 69;
|
|
500
|
+
return nextFundDeployer.setVaultLib(nextVaultLib);
|
|
501
|
+
|
|
502
|
+
case 69:
|
|
510
503
|
if (!setReleaseLive) {
|
|
511
|
-
_context.next =
|
|
504
|
+
_context.next = 72;
|
|
512
505
|
break;
|
|
513
506
|
}
|
|
514
507
|
|
|
515
|
-
_context.next =
|
|
508
|
+
_context.next = 72;
|
|
516
509
|
return nextFundDeployer.setReleaseLive();
|
|
517
510
|
|
|
518
|
-
case
|
|
511
|
+
case 72:
|
|
519
512
|
if (!setOnDispatcher) {
|
|
520
|
-
_context.next =
|
|
513
|
+
_context.next = 75;
|
|
521
514
|
break;
|
|
522
515
|
}
|
|
523
516
|
|
|
524
|
-
_context.next =
|
|
517
|
+
_context.next = 75;
|
|
525
518
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
|
526
519
|
|
|
527
|
-
case
|
|
520
|
+
case 75:
|
|
528
521
|
return _context.abrupt("return", nextFundDeployer);
|
|
529
522
|
|
|
530
|
-
case
|
|
523
|
+
case 76:
|
|
531
524
|
case "end":
|
|
532
525
|
return _context.stop();
|
|
533
526
|
}
|
|
@@ -586,9 +579,9 @@ function _callOnExternalPosition() {
|
|
|
586
579
|
case 0:
|
|
587
580
|
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
|
588
581
|
callArgs = callOnExternalPositionArgs({
|
|
589
|
-
|
|
582
|
+
actionArgs: actionArgs,
|
|
590
583
|
actionId: actionId,
|
|
591
|
-
|
|
584
|
+
externalPositionProxy: externalPositionProxy
|
|
592
585
|
});
|
|
593
586
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
594
587
|
|
|
@@ -608,23 +601,23 @@ function createExternalPosition(_x2) {
|
|
|
608
601
|
|
|
609
602
|
function _createExternalPosition() {
|
|
610
603
|
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
611
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
|
604
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, _ref2$callOnExternalP, callOnExternalPositionData, receipt, event, externalPositionProxy;
|
|
612
605
|
|
|
613
606
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
614
607
|
while (1) {
|
|
615
608
|
switch (_context2.prev = _context2.next) {
|
|
616
609
|
case 0:
|
|
617
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
|
610
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD, _ref2$callOnExternalP = _ref2.callOnExternalPositionData, callOnExternalPositionData = _ref2$callOnExternalP === void 0 ? '0x' : _ref2$callOnExternalP;
|
|
618
611
|
_context2.next = 3;
|
|
619
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
|
612
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes', 'bytes'], [externalPositionTypeId, initializationData, callOnExternalPositionData]));
|
|
620
613
|
|
|
621
614
|
case 3:
|
|
622
615
|
receipt = _context2.sent;
|
|
623
616
|
event = extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
|
624
617
|
externalPositionProxy = new IExternalPositionProxy(event[0].args.externalPosition, signer);
|
|
625
618
|
return _context2.abrupt("return", {
|
|
626
|
-
|
|
627
|
-
|
|
619
|
+
externalPositionProxy: externalPositionProxy,
|
|
620
|
+
receipt: receipt
|
|
628
621
|
});
|
|
629
622
|
|
|
630
623
|
case 7:
|
|
@@ -704,17 +697,17 @@ function _compoundDebtPositionAddCollateral() {
|
|
|
704
697
|
case 0:
|
|
705
698
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
|
706
699
|
actionArgs = compoundExternalPositionActionArgs({
|
|
707
|
-
assets: assets,
|
|
708
700
|
amounts: amounts,
|
|
701
|
+
assets: assets,
|
|
709
702
|
data: encodeArgs(['address[]'], [cTokens])
|
|
710
703
|
});
|
|
711
704
|
return _context.abrupt("return", callOnExternalPosition({
|
|
712
|
-
|
|
705
|
+
actionArgs: actionArgs,
|
|
706
|
+
actionId: CompoundDebtPositionActionId.AddCollateralAssets,
|
|
713
707
|
comptrollerProxy: comptrollerProxy,
|
|
714
708
|
externalPositionManager: externalPositionManager,
|
|
715
709
|
externalPositionProxy: externalPositionProxy,
|
|
716
|
-
|
|
717
|
-
actionArgs: actionArgs
|
|
710
|
+
signer: fundOwner
|
|
718
711
|
}));
|
|
719
712
|
|
|
720
713
|
case 3:
|
|
@@ -740,17 +733,17 @@ function _compoundDebtPositionBorrow() {
|
|
|
740
733
|
case 0:
|
|
741
734
|
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
|
742
735
|
actionArgs = compoundExternalPositionActionArgs({
|
|
743
|
-
assets: assets,
|
|
744
736
|
amounts: amounts,
|
|
737
|
+
assets: assets,
|
|
745
738
|
data: encodeArgs(['address[]'], [cTokens])
|
|
746
739
|
});
|
|
747
740
|
return _context2.abrupt("return", callOnExternalPosition({
|
|
748
|
-
|
|
741
|
+
actionArgs: actionArgs,
|
|
742
|
+
actionId: CompoundDebtPositionActionId.BorrowAsset,
|
|
749
743
|
comptrollerProxy: comptrollerProxy,
|
|
750
744
|
externalPositionManager: externalPositionManager,
|
|
751
745
|
externalPositionProxy: externalPositionProxy,
|
|
752
|
-
|
|
753
|
-
actionArgs: actionArgs
|
|
746
|
+
signer: fundOwner
|
|
754
747
|
}));
|
|
755
748
|
|
|
756
749
|
case 3:
|
|
@@ -776,17 +769,17 @@ function _compoundDebtPositionClaimComp() {
|
|
|
776
769
|
case 0:
|
|
777
770
|
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
|
778
771
|
actionArgs = compoundExternalPositionActionArgs({
|
|
779
|
-
assets: [],
|
|
780
772
|
amounts: [],
|
|
773
|
+
assets: [],
|
|
781
774
|
data: '0x'
|
|
782
775
|
});
|
|
783
776
|
return _context3.abrupt("return", callOnExternalPosition({
|
|
784
|
-
|
|
777
|
+
actionArgs: actionArgs,
|
|
778
|
+
actionId: CompoundDebtPositionActionId.ClaimComp,
|
|
785
779
|
comptrollerProxy: comptrollerProxy,
|
|
786
780
|
externalPositionManager: externalPositionManager,
|
|
787
781
|
externalPositionProxy: externalPositionProxy,
|
|
788
|
-
|
|
789
|
-
actionArgs: actionArgs
|
|
782
|
+
signer: fundOwner
|
|
790
783
|
}));
|
|
791
784
|
|
|
792
785
|
case 3:
|
|
@@ -812,17 +805,17 @@ function _compoundDebtPositionRemoveCollateral() {
|
|
|
812
805
|
case 0:
|
|
813
806
|
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
|
814
807
|
actionArgs = compoundExternalPositionActionArgs({
|
|
815
|
-
assets: assets,
|
|
816
808
|
amounts: amounts,
|
|
809
|
+
assets: assets,
|
|
817
810
|
data: encodeArgs(['address[]'], [cTokens])
|
|
818
811
|
});
|
|
819
812
|
return _context4.abrupt("return", callOnExternalPosition({
|
|
820
|
-
|
|
813
|
+
actionArgs: actionArgs,
|
|
814
|
+
actionId: CompoundDebtPositionActionId.RemoveCollateralAssets,
|
|
821
815
|
comptrollerProxy: comptrollerProxy,
|
|
822
816
|
externalPositionManager: externalPositionManager,
|
|
823
817
|
externalPositionProxy: externalPositionProxy,
|
|
824
|
-
|
|
825
|
-
actionArgs: actionArgs
|
|
818
|
+
signer: fundOwner
|
|
826
819
|
}));
|
|
827
820
|
|
|
828
821
|
case 3:
|
|
@@ -848,17 +841,17 @@ function _compoundDebtPositionRepayBorrow() {
|
|
|
848
841
|
case 0:
|
|
849
842
|
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
|
850
843
|
actionArgs = compoundExternalPositionActionArgs({
|
|
851
|
-
assets: assets,
|
|
852
844
|
amounts: amounts,
|
|
845
|
+
assets: assets,
|
|
853
846
|
data: encodeArgs(['address[]'], [cTokens])
|
|
854
847
|
});
|
|
855
848
|
return _context5.abrupt("return", callOnExternalPosition({
|
|
856
|
-
|
|
849
|
+
actionArgs: actionArgs,
|
|
850
|
+
actionId: CompoundDebtPositionActionId.RepayBorrowedAssets,
|
|
857
851
|
comptrollerProxy: comptrollerProxy,
|
|
858
852
|
externalPositionManager: externalPositionManager,
|
|
859
853
|
externalPositionProxy: externalPositionProxy,
|
|
860
|
-
|
|
861
|
-
actionArgs: actionArgs
|
|
854
|
+
signer: fundOwner
|
|
862
855
|
}));
|
|
863
856
|
|
|
864
857
|
case 3:
|
|
@@ -884,10 +877,10 @@ function _createCompoundDebtPosition() {
|
|
|
884
877
|
case 0:
|
|
885
878
|
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
|
886
879
|
return _context6.abrupt("return", createExternalPosition({
|
|
887
|
-
signer: signer,
|
|
888
880
|
comptrollerProxy: comptrollerProxy,
|
|
889
881
|
externalPositionManager: externalPositionManager,
|
|
890
|
-
externalPositionTypeId: ExternalPositionType.CompoundDebtPosition
|
|
882
|
+
externalPositionTypeId: ExternalPositionType.CompoundDebtPosition,
|
|
883
|
+
signer: signer
|
|
891
884
|
}));
|
|
892
885
|
|
|
893
886
|
case 2:
|
|
@@ -912,7 +905,7 @@ function _createMockExternalPosition() {
|
|
|
912
905
|
switch (_context.prev = _context.next) {
|
|
913
906
|
case 0:
|
|
914
907
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
|
915
|
-
_context.t0 = VaultLib
|
|
908
|
+
_context.t0 = VaultLib;
|
|
916
909
|
_context.next = 4;
|
|
917
910
|
return comptrollerProxy.getVaultProxy();
|
|
918
911
|
|
|
@@ -945,7 +938,12 @@ function _createMockExternalPosition() {
|
|
|
945
938
|
|
|
946
939
|
case 21:
|
|
947
940
|
_context.next = 23;
|
|
948
|
-
return
|
|
941
|
+
return createExternalPosition({
|
|
942
|
+
comptrollerProxy: comptrollerProxy,
|
|
943
|
+
externalPositionManager: externalPositionManager,
|
|
944
|
+
externalPositionTypeId: typeId,
|
|
945
|
+
signer: fundOwner
|
|
946
|
+
});
|
|
949
947
|
|
|
950
948
|
case 23:
|
|
951
949
|
receipt = _context.sent;
|
|
@@ -955,11 +953,11 @@ function _createMockExternalPosition() {
|
|
|
955
953
|
case 26:
|
|
956
954
|
externalPositionProxy = _context.sent[0];
|
|
957
955
|
return _context.abrupt("return", {
|
|
958
|
-
typeId: typeId,
|
|
959
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
|
960
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
|
961
956
|
externalPositionProxy: externalPositionProxy,
|
|
962
|
-
|
|
957
|
+
mockExternalPositionParser: mockExternalPositionParser,
|
|
958
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
|
959
|
+
receipt: receipt,
|
|
960
|
+
typeId: typeId
|
|
963
961
|
});
|
|
964
962
|
|
|
965
963
|
case 28:
|
|
@@ -985,16 +983,16 @@ function _mockExternalPositionAddDebtAssets() {
|
|
|
985
983
|
case 0:
|
|
986
984
|
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
|
987
985
|
actionArgs = mockGenericExternalPositionActionArgs({
|
|
988
|
-
|
|
989
|
-
|
|
986
|
+
amounts: amounts,
|
|
987
|
+
assets: assets
|
|
990
988
|
});
|
|
991
989
|
return _context2.abrupt("return", callOnExternalPosition({
|
|
992
|
-
|
|
990
|
+
actionArgs: actionArgs,
|
|
991
|
+
actionId: MockGenericExternalPositionActionId.AddDebtAssets,
|
|
993
992
|
comptrollerProxy: comptrollerProxy,
|
|
994
993
|
externalPositionManager: externalPositionManager,
|
|
995
994
|
externalPositionProxy: externalPositionProxy,
|
|
996
|
-
|
|
997
|
-
actionArgs: actionArgs
|
|
995
|
+
signer: signer
|
|
998
996
|
}));
|
|
999
997
|
|
|
1000
998
|
case 3:
|
|
@@ -1020,16 +1018,16 @@ function _mockExternalPositionAddManagedAssets() {
|
|
|
1020
1018
|
case 0:
|
|
1021
1019
|
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
|
1022
1020
|
actionArgs = mockGenericExternalPositionActionArgs({
|
|
1023
|
-
|
|
1024
|
-
|
|
1021
|
+
amounts: amounts,
|
|
1022
|
+
assets: assets
|
|
1025
1023
|
});
|
|
1026
1024
|
return _context3.abrupt("return", callOnExternalPosition({
|
|
1027
|
-
|
|
1025
|
+
actionArgs: actionArgs,
|
|
1026
|
+
actionId: MockGenericExternalPositionActionId.AddManagedAssets,
|
|
1028
1027
|
comptrollerProxy: comptrollerProxy,
|
|
1029
1028
|
externalPositionManager: externalPositionManager,
|
|
1030
1029
|
externalPositionProxy: externalPositionProxy,
|
|
1031
|
-
|
|
1032
|
-
actionArgs: actionArgs
|
|
1030
|
+
signer: signer
|
|
1033
1031
|
}));
|
|
1034
1032
|
|
|
1035
1033
|
case 3:
|
|
@@ -1055,16 +1053,16 @@ function _mockExternalPositionRemoveDebtAssets() {
|
|
|
1055
1053
|
case 0:
|
|
1056
1054
|
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
|
1057
1055
|
actionArgs = mockGenericExternalPositionActionArgs({
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
amounts: amounts,
|
|
1057
|
+
assets: assets
|
|
1060
1058
|
});
|
|
1061
1059
|
return _context4.abrupt("return", callOnExternalPosition({
|
|
1062
|
-
|
|
1060
|
+
actionArgs: actionArgs,
|
|
1061
|
+
actionId: MockGenericExternalPositionActionId.RemoveDebtAssets,
|
|
1063
1062
|
comptrollerProxy: comptrollerProxy,
|
|
1064
1063
|
externalPositionManager: externalPositionManager,
|
|
1065
1064
|
externalPositionProxy: externalPositionProxy,
|
|
1066
|
-
|
|
1067
|
-
actionArgs: actionArgs
|
|
1065
|
+
signer: signer
|
|
1068
1066
|
}));
|
|
1069
1067
|
|
|
1070
1068
|
case 3:
|
|
@@ -1090,16 +1088,16 @@ function _mockExternalPositionRemoveManagedAssets() {
|
|
|
1090
1088
|
case 0:
|
|
1091
1089
|
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
|
1092
1090
|
actionArgs = mockGenericExternalPositionActionArgs({
|
|
1093
|
-
|
|
1094
|
-
|
|
1091
|
+
amounts: amounts,
|
|
1092
|
+
assets: assets
|
|
1095
1093
|
});
|
|
1096
1094
|
return _context5.abrupt("return", callOnExternalPosition({
|
|
1097
|
-
|
|
1095
|
+
actionArgs: actionArgs,
|
|
1096
|
+
actionId: MockGenericExternalPositionActionId.RemoveManagedAssets,
|
|
1098
1097
|
comptrollerProxy: comptrollerProxy,
|
|
1099
1098
|
externalPositionManager: externalPositionManager,
|
|
1100
1099
|
externalPositionProxy: externalPositionProxy,
|
|
1101
|
-
|
|
1102
|
-
actionArgs: actionArgs
|
|
1100
|
+
signer: signer
|
|
1103
1101
|
}));
|
|
1104
1102
|
|
|
1105
1103
|
case 3:
|
|
@@ -1112,112 +1110,375 @@ function _mockExternalPositionRemoveManagedAssets() {
|
|
|
1112
1110
|
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
|
1113
1111
|
}
|
|
1114
1112
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1113
|
+
var _templateObject$3;
|
|
1114
|
+
var UniswapV3FeeAmount;
|
|
1115
|
+
|
|
1116
|
+
(function (UniswapV3FeeAmount) {
|
|
1117
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
|
1118
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
|
1119
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
|
1120
|
+
})(UniswapV3FeeAmount || (UniswapV3FeeAmount = {}));
|
|
1121
|
+
|
|
1122
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
|
1123
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
|
1124
|
+
};
|
|
1125
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
|
1126
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
|
1127
|
+
};
|
|
1128
|
+
var IUniswapV3NonFungibleTokenManager = contract()(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n function positions(uint256 tokenId) view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1)\n"])));
|
|
1129
|
+
function createUniswapV3LiquidityPosition(_x) {
|
|
1130
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
|
1117
1131
|
}
|
|
1118
1132
|
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1121
|
-
var
|
|
1133
|
+
function _createUniswapV3LiquidityPosition() {
|
|
1134
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1135
|
+
var signer, comptrollerProxy, externalPositionManager, _ref$callOnExternalPo, callOnExternalPositionData, _yield$createExternal, externalPositionProxyContract, receipt;
|
|
1136
|
+
|
|
1122
1137
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1123
1138
|
while (1) {
|
|
1124
1139
|
switch (_context.prev = _context.next) {
|
|
1125
1140
|
case 0:
|
|
1126
|
-
|
|
1141
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, _ref$callOnExternalPo = _ref.callOnExternalPositionData, callOnExternalPositionData = _ref$callOnExternalPo === void 0 ? '0x' : _ref$callOnExternalPo;
|
|
1127
1142
|
_context.next = 3;
|
|
1128
|
-
return
|
|
1129
|
-
|
|
1143
|
+
return createExternalPosition({
|
|
1144
|
+
callOnExternalPositionData: callOnExternalPositionData,
|
|
1145
|
+
comptrollerProxy: comptrollerProxy,
|
|
1146
|
+
externalPositionManager: externalPositionManager,
|
|
1147
|
+
externalPositionTypeId: ExternalPositionType.UniswapV3LiquidityPosition,
|
|
1148
|
+
signer: signer
|
|
1130
1149
|
});
|
|
1131
1150
|
|
|
1132
1151
|
case 3:
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1152
|
+
_yield$createExternal = _context.sent;
|
|
1153
|
+
externalPositionProxyContract = _yield$createExternal.externalPositionProxy;
|
|
1154
|
+
receipt = _yield$createExternal.receipt;
|
|
1155
|
+
return _context.abrupt("return", {
|
|
1156
|
+
externalPositionProxyAddress: externalPositionProxyContract.address,
|
|
1157
|
+
receipt: receipt
|
|
1158
|
+
});
|
|
1139
1159
|
|
|
1140
|
-
case
|
|
1160
|
+
case 7:
|
|
1141
1161
|
case "end":
|
|
1142
1162
|
return _context.stop();
|
|
1143
1163
|
}
|
|
1144
1164
|
}
|
|
1145
1165
|
}, _callee);
|
|
1146
1166
|
}));
|
|
1147
|
-
return
|
|
1167
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
|
1148
1168
|
}
|
|
1149
1169
|
|
|
1150
|
-
function
|
|
1151
|
-
return
|
|
1170
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
|
1171
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
|
1152
1172
|
}
|
|
1153
1173
|
|
|
1154
|
-
function
|
|
1155
|
-
|
|
1156
|
-
var
|
|
1174
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
|
1175
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
1176
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
|
1177
|
+
|
|
1157
1178
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1158
1179
|
while (1) {
|
|
1159
1180
|
switch (_context2.prev = _context2.next) {
|
|
1160
1181
|
case 0:
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
return IFee.mock(deployer);
|
|
1169
|
-
|
|
1170
|
-
case 6:
|
|
1171
|
-
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
|
1172
|
-
_context2.next = 9;
|
|
1173
|
-
return IFee.mock(deployer);
|
|
1174
|
-
|
|
1175
|
-
case 9:
|
|
1176
|
-
mockPostBuySharesFee = _context2.sent;
|
|
1177
|
-
_context2.next = 12;
|
|
1178
|
-
return Promise.all([// Continuous fee the mimics ManagementFee
|
|
1179
|
-
mockContinuousFeeSettleOnly.getRecipientForFund.returns(constants.AddressZero), mockContinuousFeeSettleOnly.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockContinuousFeeSettleOnly.payout.returns(false), mockContinuousFeeSettleOnly.addFundSettings.returns(undefined), mockContinuousFeeSettleOnly.activateForFund.returns(undefined), mockContinuousFeeSettleOnly.update.returns(undefined), mockContinuousFeeSettleOnly.settlesOnHook.returns(false, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.Continuous).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.PreBuyShares).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.PreRedeemShares).returns(true, false), mockContinuousFeeSettleOnly.updatesOnHook.returns(false, false), // Continuous fee the mimics PerformanceFee
|
|
1180
|
-
mockContinuousFeeWithGavAndUpdates.getRecipientForFund.returns(constants.AddressZero), mockContinuousFeeWithGavAndUpdates.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockContinuousFeeWithGavAndUpdates.payout.returns(false), mockContinuousFeeWithGavAndUpdates.addFundSettings.returns(undefined), mockContinuousFeeWithGavAndUpdates.activateForFund.returns(undefined), mockContinuousFeeWithGavAndUpdates.update.returns(undefined), mockContinuousFeeWithGavAndUpdates.settlesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.PreBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.PreRedeemShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.PostBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.PreRedeemShares).returns(true, true), // PostBuyShares fee
|
|
1181
|
-
mockPostBuySharesFee.getRecipientForFund.returns(constants.AddressZero), mockPostBuySharesFee.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockPostBuySharesFee.payout.returns(false), mockPostBuySharesFee.addFundSettings.returns(undefined), mockPostBuySharesFee.activateForFund.returns(undefined), mockPostBuySharesFee.update.returns(undefined), mockPostBuySharesFee.settlesOnHook.returns(false, false), mockPostBuySharesFee.settlesOnHook.given(FeeHook.PostBuyShares).returns(true, false), mockPostBuySharesFee.updatesOnHook.returns(false, false)]);
|
|
1182
|
-
|
|
1183
|
-
case 12:
|
|
1184
|
-
return _context2.abrupt("return", {
|
|
1185
|
-
mockContinuousFeeSettleOnly: mockContinuousFeeSettleOnly,
|
|
1186
|
-
mockContinuousFeeWithGavAndUpdates: mockContinuousFeeWithGavAndUpdates,
|
|
1187
|
-
mockPostBuySharesFee: mockPostBuySharesFee
|
|
1182
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, nftId = _ref2.nftId, amount0Desired = _ref2.amount0Desired, amount1Desired = _ref2.amount1Desired, _ref2$amount0Min = _ref2.amount0Min, amount0Min = _ref2$amount0Min === void 0 ? 0 : _ref2$amount0Min, _ref2$amount1Min = _ref2.amount1Min, amount1Min = _ref2$amount1Min === void 0 ? 0 : _ref2$amount1Min;
|
|
1183
|
+
actionArgs = uniswapV3LiquidityPositionAddLiquidityArgs({
|
|
1184
|
+
amount0Desired: amount0Desired,
|
|
1185
|
+
amount0Min: amount0Min,
|
|
1186
|
+
amount1Desired: amount1Desired,
|
|
1187
|
+
amount1Min: amount1Min,
|
|
1188
|
+
nftId: nftId
|
|
1188
1189
|
});
|
|
1190
|
+
callArgs = callOnExternalPositionArgs({
|
|
1191
|
+
actionArgs: actionArgs,
|
|
1192
|
+
actionId: UniswapV3LiquidityPositionActionId.AddLiquidity,
|
|
1193
|
+
externalPositionProxy: externalPositionProxy
|
|
1194
|
+
});
|
|
1195
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1189
1196
|
|
|
1190
|
-
case
|
|
1197
|
+
case 4:
|
|
1191
1198
|
case "end":
|
|
1192
1199
|
return _context2.stop();
|
|
1193
1200
|
}
|
|
1194
1201
|
}
|
|
1195
1202
|
}, _callee2);
|
|
1196
1203
|
}));
|
|
1197
|
-
return
|
|
1204
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
|
1198
1205
|
}
|
|
1199
1206
|
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1207
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
|
1208
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
|
1202
1209
|
}
|
|
1203
1210
|
|
|
1204
|
-
function
|
|
1205
|
-
|
|
1206
|
-
var
|
|
1207
|
-
|
|
1208
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1211
|
+
function _uniswapV3LiquidityPositionCollect() {
|
|
1212
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
1213
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
|
1214
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1209
1215
|
while (1) {
|
|
1210
|
-
switch (
|
|
1216
|
+
switch (_context3.prev = _context3.next) {
|
|
1211
1217
|
case 0:
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1218
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
|
1219
|
+
actionArgs = uniswapV3LiquidityPositionCollectArgs({
|
|
1220
|
+
nftId: nftId
|
|
1221
|
+
});
|
|
1222
|
+
callArgs = callOnExternalPositionArgs({
|
|
1223
|
+
actionArgs: actionArgs,
|
|
1224
|
+
actionId: UniswapV3LiquidityPositionActionId.Collect,
|
|
1225
|
+
externalPositionProxy: externalPositionProxy
|
|
1226
|
+
});
|
|
1227
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1228
|
+
|
|
1229
|
+
case 4:
|
|
1230
|
+
case "end":
|
|
1231
|
+
return _context3.stop();
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
}, _callee3);
|
|
1235
|
+
}));
|
|
1236
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
|
1240
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
function _uniswapV3LiquidityPositionMint() {
|
|
1244
|
+
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
1245
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
|
1246
|
+
|
|
1247
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1248
|
+
while (1) {
|
|
1249
|
+
switch (_context4.prev = _context4.next) {
|
|
1250
|
+
case 0:
|
|
1251
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, token0 = _ref4.token0, token1 = _ref4.token1, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
|
1252
|
+
actionArgs = uniswapV3LiquidityPositionMintArgs({
|
|
1253
|
+
amount0Desired: amount0Desired,
|
|
1254
|
+
amount0Min: amount0Min,
|
|
1255
|
+
amount1Desired: amount1Desired,
|
|
1256
|
+
amount1Min: amount1Min,
|
|
1257
|
+
fee: fee,
|
|
1258
|
+
tickLower: tickLower,
|
|
1259
|
+
tickUpper: tickUpper,
|
|
1260
|
+
token0: token0,
|
|
1261
|
+
token1: token1
|
|
1262
|
+
});
|
|
1263
|
+
callArgs = callOnExternalPositionArgs({
|
|
1264
|
+
actionArgs: actionArgs,
|
|
1265
|
+
actionId: UniswapV3LiquidityPositionActionId.Mint,
|
|
1266
|
+
externalPositionProxy: externalPositionProxy
|
|
1267
|
+
});
|
|
1268
|
+
_context4.next = 5;
|
|
1269
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
1270
|
+
|
|
1271
|
+
case 5:
|
|
1272
|
+
receipt = _context4.sent;
|
|
1273
|
+
externalPosition = new UniswapV3LiquidityPositionLib(externalPositionProxy, provider);
|
|
1274
|
+
nftId = extractEvent(receipt, externalPosition.abi.getEvent('NFTPositionAdded'))[0].args.tokenId;
|
|
1275
|
+
return _context4.abrupt("return", {
|
|
1276
|
+
nftId: nftId,
|
|
1277
|
+
receipt: receipt
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1280
|
+
case 9:
|
|
1281
|
+
case "end":
|
|
1282
|
+
return _context4.stop();
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
}, _callee4);
|
|
1286
|
+
}));
|
|
1287
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
function uniswapV3LiquidityPositionPurge(_x5) {
|
|
1291
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
function _uniswapV3LiquidityPositionPurge() {
|
|
1295
|
+
_uniswapV3LiquidityPositionPurge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
1296
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref5$amount0Min, amount0Min, _ref5$amount1Min, amount1Min, actionArgs, callArgs;
|
|
1297
|
+
|
|
1298
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1299
|
+
while (1) {
|
|
1300
|
+
switch (_context5.prev = _context5.next) {
|
|
1301
|
+
case 0:
|
|
1302
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, nftId = _ref5.nftId, liquidity = _ref5.liquidity, _ref5$amount0Min = _ref5.amount0Min, amount0Min = _ref5$amount0Min === void 0 ? 0 : _ref5$amount0Min, _ref5$amount1Min = _ref5.amount1Min, amount1Min = _ref5$amount1Min === void 0 ? 0 : _ref5$amount1Min;
|
|
1303
|
+
actionArgs = uniswapV3LiquidityPositionPurgeArgs({
|
|
1304
|
+
amount0Min: amount0Min,
|
|
1305
|
+
amount1Min: amount1Min,
|
|
1306
|
+
liquidity: liquidity,
|
|
1307
|
+
nftId: nftId
|
|
1308
|
+
});
|
|
1309
|
+
callArgs = callOnExternalPositionArgs({
|
|
1310
|
+
actionArgs: actionArgs,
|
|
1311
|
+
actionId: UniswapV3LiquidityPositionActionId.Purge,
|
|
1312
|
+
externalPositionProxy: externalPositionProxy
|
|
1313
|
+
});
|
|
1314
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1315
|
+
|
|
1316
|
+
case 4:
|
|
1317
|
+
case "end":
|
|
1318
|
+
return _context5.stop();
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}, _callee5);
|
|
1322
|
+
}));
|
|
1323
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
function uniswapV3LiquidityPositionRemoveLiquidity(_x6) {
|
|
1327
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
function _uniswapV3LiquidityPositionRemoveLiquidity() {
|
|
1331
|
+
_uniswapV3LiquidityPositionRemoveLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
|
1332
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref6$amount0Min, amount0Min, _ref6$amount1Min, amount1Min, actionArgs, callArgs;
|
|
1333
|
+
|
|
1334
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1335
|
+
while (1) {
|
|
1336
|
+
switch (_context6.prev = _context6.next) {
|
|
1337
|
+
case 0:
|
|
1338
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager, externalPositionProxy = _ref6.externalPositionProxy, nftId = _ref6.nftId, liquidity = _ref6.liquidity, _ref6$amount0Min = _ref6.amount0Min, amount0Min = _ref6$amount0Min === void 0 ? 0 : _ref6$amount0Min, _ref6$amount1Min = _ref6.amount1Min, amount1Min = _ref6$amount1Min === void 0 ? 0 : _ref6$amount1Min;
|
|
1339
|
+
actionArgs = uniswapV3LiquidityPositionRemoveLiquidityArgs({
|
|
1340
|
+
amount0Min: amount0Min,
|
|
1341
|
+
amount1Min: amount1Min,
|
|
1342
|
+
liquidity: liquidity,
|
|
1343
|
+
nftId: nftId
|
|
1344
|
+
});
|
|
1345
|
+
callArgs = callOnExternalPositionArgs({
|
|
1346
|
+
actionArgs: actionArgs,
|
|
1347
|
+
actionId: UniswapV3LiquidityPositionActionId.RemoveLiquidity,
|
|
1348
|
+
externalPositionProxy: externalPositionProxy
|
|
1349
|
+
});
|
|
1350
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1351
|
+
|
|
1352
|
+
case 4:
|
|
1353
|
+
case "end":
|
|
1354
|
+
return _context6.stop();
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}, _callee6);
|
|
1358
|
+
}));
|
|
1359
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
function uniswapV3OrderTokenPair(_ref7) {
|
|
1363
|
+
var tokenA = _ref7.tokenA,
|
|
1364
|
+
tokenB = _ref7.tokenB;
|
|
1365
|
+
var tokenAAddress = resolveAddress(tokenA);
|
|
1366
|
+
var tokenBAddress = resolveAddress(tokenB);
|
|
1367
|
+
return tokenAAddress < tokenBAddress ? {
|
|
1368
|
+
token0: tokenAAddress,
|
|
1369
|
+
token1: tokenBAddress
|
|
1370
|
+
} : {
|
|
1371
|
+
token0: tokenBAddress,
|
|
1372
|
+
token1: tokenAAddress
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
function generateFeeManagerConfigWithMockFees(_x) {
|
|
1377
|
+
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
function _generateFeeManagerConfigWithMockFees() {
|
|
1381
|
+
_generateFeeManagerConfigWithMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1382
|
+
var deployer, fees, feeManagerSettingsData;
|
|
1383
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1384
|
+
while (1) {
|
|
1385
|
+
switch (_context.prev = _context.next) {
|
|
1386
|
+
case 0:
|
|
1387
|
+
deployer = _ref.deployer;
|
|
1388
|
+
_context.next = 3;
|
|
1389
|
+
return generateMockFees({
|
|
1390
|
+
deployer: deployer
|
|
1391
|
+
});
|
|
1392
|
+
|
|
1393
|
+
case 3:
|
|
1394
|
+
fees = _context.sent;
|
|
1395
|
+
feeManagerSettingsData = [utils.randomBytes(10), '0x', utils.randomBytes(2)];
|
|
1396
|
+
return _context.abrupt("return", feeManagerConfigArgs({
|
|
1397
|
+
fees: Object.values(fees),
|
|
1398
|
+
settings: feeManagerSettingsData
|
|
1399
|
+
}));
|
|
1400
|
+
|
|
1401
|
+
case 6:
|
|
1402
|
+
case "end":
|
|
1403
|
+
return _context.stop();
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}, _callee);
|
|
1407
|
+
}));
|
|
1408
|
+
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
function generateMockFees(_x2) {
|
|
1412
|
+
return _generateMockFees.apply(this, arguments);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
function _generateMockFees() {
|
|
1416
|
+
_generateMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
1417
|
+
var deployer, mockContinuousFeeSettleOnly, mockContinuousFeeWithGavAndUpdates, mockPostBuySharesFee;
|
|
1418
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1419
|
+
while (1) {
|
|
1420
|
+
switch (_context2.prev = _context2.next) {
|
|
1421
|
+
case 0:
|
|
1422
|
+
deployer = _ref2.deployer;
|
|
1423
|
+
_context2.next = 3;
|
|
1424
|
+
return IFee.mock(deployer);
|
|
1425
|
+
|
|
1426
|
+
case 3:
|
|
1427
|
+
mockContinuousFeeSettleOnly = _context2.sent;
|
|
1428
|
+
_context2.next = 6;
|
|
1429
|
+
return IFee.mock(deployer);
|
|
1430
|
+
|
|
1431
|
+
case 6:
|
|
1432
|
+
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
|
1433
|
+
_context2.next = 9;
|
|
1434
|
+
return IFee.mock(deployer);
|
|
1435
|
+
|
|
1436
|
+
case 9:
|
|
1437
|
+
mockPostBuySharesFee = _context2.sent;
|
|
1438
|
+
_context2.next = 12;
|
|
1439
|
+
return Promise.all([// Continuous fee the mimics ManagementFee
|
|
1440
|
+
mockContinuousFeeSettleOnly.getRecipientForFund.returns(constants.AddressZero), mockContinuousFeeSettleOnly.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockContinuousFeeSettleOnly.payout.returns(false), mockContinuousFeeSettleOnly.addFundSettings.returns(undefined), mockContinuousFeeSettleOnly.activateForFund.returns(undefined), mockContinuousFeeSettleOnly.update.returns(undefined), mockContinuousFeeSettleOnly.settlesOnHook.returns(false, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.Continuous).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.PreBuyShares).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(FeeHook.PreRedeemShares).returns(true, false), mockContinuousFeeSettleOnly.updatesOnHook.returns(false, false), // Continuous fee the mimics PerformanceFee
|
|
1441
|
+
mockContinuousFeeWithGavAndUpdates.getRecipientForFund.returns(constants.AddressZero), mockContinuousFeeWithGavAndUpdates.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockContinuousFeeWithGavAndUpdates.payout.returns(false), mockContinuousFeeWithGavAndUpdates.addFundSettings.returns(undefined), mockContinuousFeeWithGavAndUpdates.activateForFund.returns(undefined), mockContinuousFeeWithGavAndUpdates.update.returns(undefined), mockContinuousFeeWithGavAndUpdates.settlesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.PreBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(FeeHook.PreRedeemShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.PostBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(FeeHook.PreRedeemShares).returns(true, true), // PostBuyShares fee
|
|
1442
|
+
mockPostBuySharesFee.getRecipientForFund.returns(constants.AddressZero), mockPostBuySharesFee.settle.returns(FeeSettlementType.None, constants.AddressZero, 0), mockPostBuySharesFee.payout.returns(false), mockPostBuySharesFee.addFundSettings.returns(undefined), mockPostBuySharesFee.activateForFund.returns(undefined), mockPostBuySharesFee.update.returns(undefined), mockPostBuySharesFee.settlesOnHook.returns(false, false), mockPostBuySharesFee.settlesOnHook.given(FeeHook.PostBuyShares).returns(true, false), mockPostBuySharesFee.updatesOnHook.returns(false, false)]);
|
|
1443
|
+
|
|
1444
|
+
case 12:
|
|
1445
|
+
return _context2.abrupt("return", {
|
|
1446
|
+
mockContinuousFeeSettleOnly: mockContinuousFeeSettleOnly,
|
|
1447
|
+
mockContinuousFeeWithGavAndUpdates: mockContinuousFeeWithGavAndUpdates,
|
|
1448
|
+
mockPostBuySharesFee: mockPostBuySharesFee
|
|
1449
|
+
});
|
|
1450
|
+
|
|
1451
|
+
case 13:
|
|
1452
|
+
case "end":
|
|
1453
|
+
return _context2.stop();
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}, _callee2);
|
|
1457
|
+
}));
|
|
1458
|
+
return _generateMockFees.apply(this, arguments);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
function aaveLend(_x) {
|
|
1462
|
+
return _aaveLend.apply(this, arguments);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
function _aaveLend() {
|
|
1466
|
+
_aaveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1467
|
+
var comptrollerProxy, integrationManager, fundOwner, aaveAdapter, aToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
|
1468
|
+
|
|
1469
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1470
|
+
while (1) {
|
|
1471
|
+
switch (_context.prev = _context.next) {
|
|
1472
|
+
case 0:
|
|
1473
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, aaveAdapter = _ref.aaveAdapter, aToken = _ref.aToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? utils.parseEther('1') : _ref$amount;
|
|
1474
|
+
lendArgs = aaveLendArgs({
|
|
1475
|
+
aToken: aToken,
|
|
1476
|
+
amount: amount
|
|
1216
1477
|
});
|
|
1217
1478
|
callArgs = callOnIntegrationArgs({
|
|
1218
1479
|
adapter: aaveAdapter,
|
|
1219
|
-
|
|
1220
|
-
|
|
1480
|
+
encodedCallArgs: lendArgs,
|
|
1481
|
+
selector: lendSelector
|
|
1221
1482
|
});
|
|
1222
1483
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1223
1484
|
return _context.abrupt("return", lendTx);
|
|
@@ -1251,8 +1512,8 @@ function _aaveRedeem() {
|
|
|
1251
1512
|
});
|
|
1252
1513
|
callArgs = callOnIntegrationArgs({
|
|
1253
1514
|
adapter: aaveAdapter,
|
|
1254
|
-
|
|
1255
|
-
|
|
1515
|
+
encodedCallArgs: redeemArgs,
|
|
1516
|
+
selector: redeemSelector
|
|
1256
1517
|
});
|
|
1257
1518
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1258
1519
|
return _context2.abrupt("return", redeemTx);
|
|
@@ -1269,87 +1530,303 @@ function _aaveRedeem() {
|
|
|
1269
1530
|
|
|
1270
1531
|
var _templateObject$2;
|
|
1271
1532
|
var ICompoundComptroller = contract()(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n function claimComp(address)\n"])));
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1533
|
+
function assertCompoundLend(_x) {
|
|
1534
|
+
return _assertCompoundLend.apply(this, arguments);
|
|
1274
1535
|
}
|
|
1275
1536
|
|
|
1276
|
-
function
|
|
1277
|
-
|
|
1278
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter,
|
|
1537
|
+
function _assertCompoundLend() {
|
|
1538
|
+
_assertCompoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1539
|
+
var tokenWhale, comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, _ref$tokenAmount, tokenAmount, cToken, compoundPriceFeed, token, rateBefore, minIncomingCTokenAmount, _yield$getAssetBalanc, _yield$getAssetBalanc2, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, lendReceipt, rate, _yield$getAssetBalanc3, _yield$getAssetBalanc4, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, expectedCTokenAmount;
|
|
1279
1540
|
|
|
1280
1541
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1281
1542
|
while (1) {
|
|
1282
1543
|
switch (_context.prev = _context.next) {
|
|
1283
1544
|
case 0:
|
|
1284
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
|
1545
|
+
tokenWhale = _ref.tokenWhale, comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? utils.parseEther('1') : _ref$tokenAmount, cToken = _ref.cToken, compoundPriceFeed = _ref.compoundPriceFeed;
|
|
1546
|
+
_context.t0 = StandardToken;
|
|
1547
|
+
_context.next = 4;
|
|
1548
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
|
1549
|
+
|
|
1550
|
+
case 4:
|
|
1551
|
+
_context.t1 = _context.sent;
|
|
1552
|
+
_context.t2 = tokenWhale;
|
|
1553
|
+
token = new _context.t0(_context.t1, _context.t2);
|
|
1554
|
+
_context.next = 9;
|
|
1555
|
+
return token.connect(tokenWhale).transfer(vaultProxy, tokenAmount);
|
|
1556
|
+
|
|
1557
|
+
case 9:
|
|
1558
|
+
_context.next = 11;
|
|
1559
|
+
return cToken.exchangeRateStored.call();
|
|
1560
|
+
|
|
1561
|
+
case 11:
|
|
1562
|
+
rateBefore = _context.sent;
|
|
1563
|
+
// Exchange rate stored can have a small deviation from exchangeRateStored
|
|
1564
|
+
minIncomingCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rateBefore).mul(BigNumber.from('999')).div(BigNumber.from('1000'));
|
|
1565
|
+
_context.next = 15;
|
|
1566
|
+
return getAssetBalances({
|
|
1567
|
+
account: vaultProxy,
|
|
1568
|
+
assets: [cToken, token]
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
case 15:
|
|
1572
|
+
_yield$getAssetBalanc = _context.sent;
|
|
1573
|
+
_yield$getAssetBalanc2 = _slicedToArray(_yield$getAssetBalanc, 2);
|
|
1574
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc2[0];
|
|
1575
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc2[1];
|
|
1576
|
+
_context.next = 21;
|
|
1577
|
+
return compoundLend({
|
|
1578
|
+
cToken: cToken,
|
|
1579
|
+
cTokenAmount: minIncomingCTokenAmount,
|
|
1580
|
+
compoundAdapter: compoundAdapter,
|
|
1581
|
+
comptrollerProxy: comptrollerProxy,
|
|
1582
|
+
fundOwner: fundOwner,
|
|
1583
|
+
integrationManager: integrationManager,
|
|
1584
|
+
tokenAmount: tokenAmount
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
case 21:
|
|
1588
|
+
lendReceipt = _context.sent;
|
|
1589
|
+
_context.next = 24;
|
|
1590
|
+
return cToken.exchangeRateStored();
|
|
1591
|
+
|
|
1592
|
+
case 24:
|
|
1593
|
+
rate = _context.sent;
|
|
1594
|
+
_context.next = 27;
|
|
1595
|
+
return getAssetBalances({
|
|
1596
|
+
account: vaultProxy,
|
|
1597
|
+
assets: [cToken, token]
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
case 27:
|
|
1601
|
+
_yield$getAssetBalanc3 = _context.sent;
|
|
1602
|
+
_yield$getAssetBalanc4 = _slicedToArray(_yield$getAssetBalanc3, 2);
|
|
1603
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc4[0];
|
|
1604
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc4[1];
|
|
1605
|
+
expectedCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rate);
|
|
1606
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedCTokenAmount));
|
|
1607
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(tokenAmount));
|
|
1608
|
+
return _context.abrupt("return", lendReceipt);
|
|
1609
|
+
|
|
1610
|
+
case 35:
|
|
1611
|
+
case "end":
|
|
1612
|
+
return _context.stop();
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}, _callee);
|
|
1616
|
+
}));
|
|
1617
|
+
return _assertCompoundLend.apply(this, arguments);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
function assertCompoundRedeem(_x2) {
|
|
1621
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
function _assertCompoundRedeem() {
|
|
1625
|
+
_assertCompoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
1626
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, cToken, compoundPriceFeed, cTokenAmount, token, _yield$getAssetBalanc5, _yield$getAssetBalanc6, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, rateBefore, minIncomingTokenAmount, redeemReceipt, _yield$getAssetBalanc7, _yield$getAssetBalanc8, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, rate, expectedTokenAmount;
|
|
1627
|
+
|
|
1628
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1629
|
+
while (1) {
|
|
1630
|
+
switch (_context2.prev = _context2.next) {
|
|
1631
|
+
case 0:
|
|
1632
|
+
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, compoundPriceFeed = _ref2.compoundPriceFeed;
|
|
1633
|
+
_context2.t0 = utils;
|
|
1634
|
+
_context2.next = 4;
|
|
1635
|
+
return cToken.decimals();
|
|
1636
|
+
|
|
1637
|
+
case 4:
|
|
1638
|
+
_context2.t1 = _context2.sent;
|
|
1639
|
+
cTokenAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
|
1640
|
+
_context2.next = 8;
|
|
1641
|
+
return cToken.transfer(vaultProxy, cTokenAmount);
|
|
1642
|
+
|
|
1643
|
+
case 8:
|
|
1644
|
+
_context2.t2 = StandardToken;
|
|
1645
|
+
_context2.next = 11;
|
|
1646
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
|
1647
|
+
|
|
1648
|
+
case 11:
|
|
1649
|
+
_context2.t3 = _context2.sent;
|
|
1650
|
+
_context2.t4 = provider;
|
|
1651
|
+
token = new _context2.t2(_context2.t3, _context2.t4);
|
|
1652
|
+
_context2.next = 16;
|
|
1653
|
+
return getAssetBalances({
|
|
1654
|
+
account: vaultProxy,
|
|
1655
|
+
assets: [token, cToken]
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
|
+
case 16:
|
|
1659
|
+
_yield$getAssetBalanc5 = _context2.sent;
|
|
1660
|
+
_yield$getAssetBalanc6 = _slicedToArray(_yield$getAssetBalanc5, 2);
|
|
1661
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc6[0];
|
|
1662
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc6[1];
|
|
1663
|
+
_context2.next = 22;
|
|
1664
|
+
return cToken.exchangeRateStored();
|
|
1665
|
+
|
|
1666
|
+
case 22:
|
|
1667
|
+
rateBefore = _context2.sent;
|
|
1668
|
+
minIncomingTokenAmount = cTokenAmount.mul(rateBefore).div(utils.parseEther('1'));
|
|
1669
|
+
_context2.next = 26;
|
|
1670
|
+
return compoundRedeem({
|
|
1671
|
+
cToken: cToken,
|
|
1672
|
+
cTokenAmount: cTokenAmount,
|
|
1673
|
+
compoundAdapter: compoundAdapter,
|
|
1674
|
+
comptrollerProxy: comptrollerProxy,
|
|
1675
|
+
fundOwner: fundOwner,
|
|
1676
|
+
integrationManager: integrationManager,
|
|
1677
|
+
tokenAmount: minIncomingTokenAmount,
|
|
1678
|
+
vaultProxy: vaultProxy
|
|
1679
|
+
});
|
|
1680
|
+
|
|
1681
|
+
case 26:
|
|
1682
|
+
redeemReceipt = _context2.sent;
|
|
1683
|
+
_context2.next = 29;
|
|
1684
|
+
return getAssetBalances({
|
|
1685
|
+
account: vaultProxy,
|
|
1686
|
+
assets: [token, cToken]
|
|
1687
|
+
});
|
|
1688
|
+
|
|
1689
|
+
case 29:
|
|
1690
|
+
_yield$getAssetBalanc7 = _context2.sent;
|
|
1691
|
+
_yield$getAssetBalanc8 = _slicedToArray(_yield$getAssetBalanc7, 2);
|
|
1692
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc8[0];
|
|
1693
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc8[1];
|
|
1694
|
+
_context2.next = 35;
|
|
1695
|
+
return cToken.exchangeRateStored();
|
|
1696
|
+
|
|
1697
|
+
case 35:
|
|
1698
|
+
rate = _context2.sent;
|
|
1699
|
+
expectedTokenAmount = cTokenAmount.mul(rate).div(utils.parseEther('1'));
|
|
1700
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedTokenAmount));
|
|
1701
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(cTokenAmount));
|
|
1702
|
+
return _context2.abrupt("return", redeemReceipt);
|
|
1703
|
+
|
|
1704
|
+
case 40:
|
|
1705
|
+
case "end":
|
|
1706
|
+
return _context2.stop();
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}, _callee2);
|
|
1710
|
+
}));
|
|
1711
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
function compoundClaim(_x3) {
|
|
1715
|
+
return _compoundClaim.apply(this, arguments);
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
function _compoundClaim() {
|
|
1719
|
+
_compoundClaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
1720
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, compoundComptroller, cTokens, claimArgs, callArgs, claimRewardsTx;
|
|
1721
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1722
|
+
while (1) {
|
|
1723
|
+
switch (_context3.prev = _context3.next) {
|
|
1724
|
+
case 0:
|
|
1725
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, compoundAdapter = _ref3.compoundAdapter, compoundComptroller = _ref3.compoundComptroller, cTokens = _ref3.cTokens;
|
|
1726
|
+
claimArgs = compoundClaimRewardsArgs({
|
|
1727
|
+
cTokens: cTokens,
|
|
1728
|
+
compoundComptroller: compoundComptroller
|
|
1729
|
+
});
|
|
1730
|
+
callArgs = callOnIntegrationArgs({
|
|
1731
|
+
adapter: compoundAdapter,
|
|
1732
|
+
encodedCallArgs: claimArgs,
|
|
1733
|
+
selector: claimRewardsSelector
|
|
1734
|
+
});
|
|
1735
|
+
claimRewardsTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1736
|
+
return _context3.abrupt("return", claimRewardsTx);
|
|
1737
|
+
|
|
1738
|
+
case 5:
|
|
1739
|
+
case "end":
|
|
1740
|
+
return _context3.stop();
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}, _callee3);
|
|
1744
|
+
}));
|
|
1745
|
+
return _compoundClaim.apply(this, arguments);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
function compoundLend(_x4) {
|
|
1749
|
+
return _compoundLend.apply(this, arguments);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
function _compoundLend() {
|
|
1753
|
+
_compoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
1754
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref4$tokenAmount, tokenAmount, _ref4$cTokenAmount, cTokenAmount, lendArgs, callArgs, lendTx;
|
|
1755
|
+
|
|
1756
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1757
|
+
while (1) {
|
|
1758
|
+
switch (_context4.prev = _context4.next) {
|
|
1759
|
+
case 0:
|
|
1760
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, compoundAdapter = _ref4.compoundAdapter, cToken = _ref4.cToken, _ref4$tokenAmount = _ref4.tokenAmount, tokenAmount = _ref4$tokenAmount === void 0 ? utils.parseEther('1') : _ref4$tokenAmount, _ref4$cTokenAmount = _ref4.cTokenAmount, cTokenAmount = _ref4$cTokenAmount === void 0 ? utils.parseEther('1') : _ref4$cTokenAmount;
|
|
1285
1761
|
lendArgs = compoundArgs({
|
|
1286
1762
|
cToken: cToken,
|
|
1287
|
-
|
|
1288
|
-
|
|
1763
|
+
minIncomingAssetAmount: cTokenAmount,
|
|
1764
|
+
outgoingAssetAmount: tokenAmount
|
|
1289
1765
|
});
|
|
1290
1766
|
callArgs = callOnIntegrationArgs({
|
|
1291
1767
|
adapter: compoundAdapter,
|
|
1292
|
-
|
|
1293
|
-
|
|
1768
|
+
encodedCallArgs: lendArgs,
|
|
1769
|
+
selector: lendSelector
|
|
1294
1770
|
});
|
|
1295
1771
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1296
|
-
return
|
|
1772
|
+
return _context4.abrupt("return", lendTx);
|
|
1297
1773
|
|
|
1298
1774
|
case 5:
|
|
1299
1775
|
case "end":
|
|
1300
|
-
return
|
|
1776
|
+
return _context4.stop();
|
|
1301
1777
|
}
|
|
1302
1778
|
}
|
|
1303
|
-
},
|
|
1779
|
+
}, _callee4);
|
|
1304
1780
|
}));
|
|
1305
1781
|
return _compoundLend.apply(this, arguments);
|
|
1306
1782
|
}
|
|
1307
1783
|
|
|
1308
|
-
function compoundRedeem(
|
|
1784
|
+
function compoundRedeem(_x5) {
|
|
1309
1785
|
return _compoundRedeem.apply(this, arguments);
|
|
1310
1786
|
}
|
|
1311
1787
|
|
|
1312
1788
|
function _compoundRedeem() {
|
|
1313
|
-
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1314
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken,
|
|
1789
|
+
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
1790
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref5$tokenAmount, tokenAmount, _ref5$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
|
1315
1791
|
|
|
1316
|
-
return _regeneratorRuntime.wrap(function
|
|
1792
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1317
1793
|
while (1) {
|
|
1318
|
-
switch (
|
|
1794
|
+
switch (_context5.prev = _context5.next) {
|
|
1319
1795
|
case 0:
|
|
1320
|
-
comptrollerProxy =
|
|
1796
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, fundOwner = _ref5.fundOwner, compoundAdapter = _ref5.compoundAdapter, cToken = _ref5.cToken, _ref5$tokenAmount = _ref5.tokenAmount, tokenAmount = _ref5$tokenAmount === void 0 ? utils.parseEther('1') : _ref5$tokenAmount, _ref5$cTokenAmount = _ref5.cTokenAmount, cTokenAmount = _ref5$cTokenAmount === void 0 ? utils.parseEther('1') : _ref5$cTokenAmount;
|
|
1321
1797
|
redeemArgs = compoundArgs({
|
|
1322
1798
|
cToken: resolveAddress(cToken),
|
|
1323
|
-
|
|
1324
|
-
|
|
1799
|
+
minIncomingAssetAmount: tokenAmount,
|
|
1800
|
+
outgoingAssetAmount: cTokenAmount
|
|
1325
1801
|
});
|
|
1326
1802
|
callArgs = callOnIntegrationArgs({
|
|
1327
1803
|
adapter: compoundAdapter,
|
|
1328
|
-
|
|
1329
|
-
|
|
1804
|
+
encodedCallArgs: redeemArgs,
|
|
1805
|
+
selector: redeemSelector
|
|
1330
1806
|
});
|
|
1331
1807
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1332
|
-
return
|
|
1808
|
+
return _context5.abrupt("return", redeemTx);
|
|
1333
1809
|
|
|
1334
1810
|
case 5:
|
|
1335
1811
|
case "end":
|
|
1336
|
-
return
|
|
1812
|
+
return _context5.stop();
|
|
1337
1813
|
}
|
|
1338
1814
|
}
|
|
1339
|
-
},
|
|
1815
|
+
}, _callee5);
|
|
1340
1816
|
}));
|
|
1341
1817
|
return _compoundRedeem.apply(this, arguments);
|
|
1342
1818
|
}
|
|
1343
1819
|
|
|
1344
|
-
var _templateObject$1, _templateObject2, _templateObject3;
|
|
1345
|
-
var CurveLiquidityGaugeV2 = contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
|
1820
|
+
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
|
1821
|
+
var CurveLiquidityGaugeV2 = contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
|
1822
|
+
var CurveRegistry = contract()(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n function get_coins(address) view returns (address[8])\n function get_lp_token(address) view returns (address)\n"]))); // prettier-ignore
|
|
1346
1823
|
|
|
1347
|
-
var CurveSwaps = contract()(
|
|
1348
|
-
var CurveMinter = contract()(
|
|
1824
|
+
var CurveSwaps = contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
|
1825
|
+
var CurveMinter = contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
|
1349
1826
|
|
|
1350
1827
|
function curveTakeOrder(_x) {
|
|
1351
1828
|
return _curveTakeOrder.apply(this, arguments);
|
|
1352
|
-
} //
|
|
1829
|
+
} // combined liquidity
|
|
1353
1830
|
|
|
1354
1831
|
function _curveTakeOrder() {
|
|
1355
1832
|
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
@@ -1361,16 +1838,16 @@ function _curveTakeOrder() {
|
|
|
1361
1838
|
case 0:
|
|
1362
1839
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, curveExchangeAdapter = _ref.curveExchangeAdapter, pool = _ref.pool, outgoingAsset = _ref.outgoingAsset, _ref$outgoingAssetAmo = _ref.outgoingAssetAmount, outgoingAssetAmount = _ref$outgoingAssetAmo === void 0 ? utils.parseEther('1') : _ref$outgoingAssetAmo, incomingAsset = _ref.incomingAsset, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? utils.parseEther('1') : _ref$minIncomingAsset;
|
|
1363
1840
|
takeOrderArgs = curveTakeOrderArgs({
|
|
1364
|
-
|
|
1841
|
+
incomingAsset: incomingAsset,
|
|
1842
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
1365
1843
|
outgoingAsset: outgoingAsset,
|
|
1366
1844
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
1367
|
-
|
|
1368
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
|
1845
|
+
pool: pool
|
|
1369
1846
|
});
|
|
1370
1847
|
callArgs = callOnIntegrationArgs({
|
|
1371
1848
|
adapter: curveExchangeAdapter,
|
|
1372
|
-
|
|
1373
|
-
|
|
1849
|
+
encodedCallArgs: takeOrderArgs,
|
|
1850
|
+
selector: takeOrderSelector
|
|
1374
1851
|
});
|
|
1375
1852
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1376
1853
|
|
|
@@ -1384,284 +1861,384 @@ function _curveTakeOrder() {
|
|
|
1384
1861
|
return _curveTakeOrder.apply(this, arguments);
|
|
1385
1862
|
}
|
|
1386
1863
|
|
|
1387
|
-
function
|
|
1864
|
+
function curveClaimRewards(_ref2) {
|
|
1388
1865
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
|
1389
1866
|
integrationManager = _ref2.integrationManager,
|
|
1390
1867
|
fundOwner = _ref2.fundOwner,
|
|
1391
|
-
|
|
1868
|
+
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
|
1869
|
+
stakingToken = _ref2.stakingToken;
|
|
1392
1870
|
var callArgs = callOnIntegrationArgs({
|
|
1393
|
-
adapter:
|
|
1394
|
-
|
|
1395
|
-
|
|
1871
|
+
adapter: curveLiquidityAdapter,
|
|
1872
|
+
encodedCallArgs: curveClaimRewardsArgs({
|
|
1873
|
+
stakingToken: stakingToken
|
|
1874
|
+
}),
|
|
1875
|
+
selector: claimRewardsSelector
|
|
1396
1876
|
});
|
|
1397
1877
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1398
1878
|
}
|
|
1399
|
-
function
|
|
1400
|
-
|
|
1401
|
-
integrationManager = _ref3.integrationManager,
|
|
1402
|
-
fundOwner = _ref3.fundOwner,
|
|
1403
|
-
curveLiquidityAaveAdapter = _ref3.curveLiquidityAaveAdapter,
|
|
1404
|
-
_ref3$outgoingAaveDai = _ref3.outgoingAaveDaiAmount,
|
|
1405
|
-
outgoingAaveDaiAmount = _ref3$outgoingAaveDai === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveDai,
|
|
1406
|
-
_ref3$outgoingAaveUsd = _ref3.outgoingAaveUsdcAmount,
|
|
1407
|
-
outgoingAaveUsdcAmount = _ref3$outgoingAaveUsd === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveUsd,
|
|
1408
|
-
_ref3$outgoingAaveUsd2 = _ref3.outgoingAaveUsdtAmount,
|
|
1409
|
-
outgoingAaveUsdtAmount = _ref3$outgoingAaveUsd2 === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveUsd2,
|
|
1410
|
-
_ref3$minIncomingLPTo = _ref3.minIncomingLPTokenAmount,
|
|
1411
|
-
minIncomingLPTokenAmount = _ref3$minIncomingLPTo === void 0 ? BigNumber.from(1) : _ref3$minIncomingLPTo,
|
|
1412
|
-
_ref3$useUnderlyings = _ref3.useUnderlyings,
|
|
1413
|
-
useUnderlyings = _ref3$useUnderlyings === void 0 ? false : _ref3$useUnderlyings;
|
|
1414
|
-
var callArgs = callOnIntegrationArgs({
|
|
1415
|
-
adapter: curveLiquidityAaveAdapter,
|
|
1416
|
-
selector: lendSelector,
|
|
1417
|
-
encodedCallArgs: curveAaveLendArgs({
|
|
1418
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
|
1419
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
|
1420
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
|
1421
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1422
|
-
useUnderlyings: useUnderlyings
|
|
1423
|
-
})
|
|
1424
|
-
});
|
|
1425
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1879
|
+
function curveLend(_x2) {
|
|
1880
|
+
return _curveLend.apply(this, arguments);
|
|
1426
1881
|
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1882
|
+
|
|
1883
|
+
function _curveLend() {
|
|
1884
|
+
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
1885
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
|
1886
|
+
|
|
1887
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1888
|
+
while (1) {
|
|
1889
|
+
switch (_context2.prev = _context2.next) {
|
|
1890
|
+
case 0:
|
|
1891
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, signer = _ref3.signer, curveLiquidityAdapter = _ref3.curveLiquidityAdapter, pool = _ref3.pool, orderedOutgoingAssetAmounts = _ref3.orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo = _ref3.minIncomingLpTokenAmount, minIncomingLpTokenAmount = _ref3$minIncomingLpTo === void 0 ? BigNumber.from(1) : _ref3$minIncomingLpTo, useUnderlyings = _ref3.useUnderlyings;
|
|
1892
|
+
callArgs = callOnIntegrationArgs({
|
|
1893
|
+
adapter: curveLiquidityAdapter,
|
|
1894
|
+
encodedCallArgs: curveLendArgs({
|
|
1895
|
+
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
|
1896
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
|
1897
|
+
pool: pool,
|
|
1898
|
+
useUnderlyings: useUnderlyings
|
|
1899
|
+
}),
|
|
1900
|
+
selector: lendSelector
|
|
1901
|
+
});
|
|
1902
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1903
|
+
|
|
1904
|
+
case 3:
|
|
1905
|
+
case "end":
|
|
1906
|
+
return _context2.stop();
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
}, _callee2);
|
|
1910
|
+
}));
|
|
1911
|
+
return _curveLend.apply(this, arguments);
|
|
1454
1912
|
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
fundOwner = _ref5.fundOwner,
|
|
1459
|
-
curveLiquidityAaveAdapter = _ref5.curveLiquidityAaveAdapter,
|
|
1460
|
-
outgoingLPTokenAmount = _ref5.outgoingLPTokenAmount,
|
|
1461
|
-
_ref5$minIncomingAave = _ref5.minIncomingAaveDaiAmount,
|
|
1462
|
-
minIncomingAaveDaiAmount = _ref5$minIncomingAave === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave,
|
|
1463
|
-
_ref5$minIncomingAave2 = _ref5.minIncomingAaveUsdcAmount,
|
|
1464
|
-
minIncomingAaveUsdcAmount = _ref5$minIncomingAave2 === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave2,
|
|
1465
|
-
_ref5$minIncomingAave3 = _ref5.minIncomingAaveUsdtAmount,
|
|
1466
|
-
minIncomingAaveUsdtAmount = _ref5$minIncomingAave3 === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave3,
|
|
1467
|
-
_ref5$receiveSingleAs = _ref5.receiveSingleAsset,
|
|
1468
|
-
receiveSingleAsset = _ref5$receiveSingleAs === void 0 ? false : _ref5$receiveSingleAs,
|
|
1469
|
-
_ref5$useUnderlyings = _ref5.useUnderlyings,
|
|
1470
|
-
useUnderlyings = _ref5$useUnderlyings === void 0 ? false : _ref5$useUnderlyings;
|
|
1471
|
-
var callArgs = callOnIntegrationArgs({
|
|
1472
|
-
adapter: curveLiquidityAaveAdapter,
|
|
1473
|
-
selector: redeemSelector,
|
|
1474
|
-
encodedCallArgs: curveAaveRedeemArgs({
|
|
1475
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1476
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
1477
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
1478
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
1479
|
-
receiveSingleAsset: receiveSingleAsset,
|
|
1480
|
-
useUnderlyings: useUnderlyings
|
|
1481
|
-
})
|
|
1482
|
-
});
|
|
1483
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1913
|
+
|
|
1914
|
+
function curveLendAndStake(_x3) {
|
|
1915
|
+
return _curveLendAndStake.apply(this, arguments);
|
|
1484
1916
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1917
|
+
|
|
1918
|
+
function _curveLendAndStake() {
|
|
1919
|
+
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
1920
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingStakingToken, _ref4$minIncomingStak, minIncomingStakingTokenAmount, useUnderlyings, callArgs;
|
|
1921
|
+
|
|
1922
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1923
|
+
while (1) {
|
|
1924
|
+
switch (_context3.prev = _context3.next) {
|
|
1925
|
+
case 0:
|
|
1926
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingStakingToken = _ref4.incomingStakingToken, _ref4$minIncomingStak = _ref4.minIncomingStakingTokenAmount, minIncomingStakingTokenAmount = _ref4$minIncomingStak === void 0 ? BigNumber.from(1) : _ref4$minIncomingStak, useUnderlyings = _ref4.useUnderlyings;
|
|
1927
|
+
callArgs = callOnIntegrationArgs({
|
|
1928
|
+
adapter: curveLiquidityAdapter,
|
|
1929
|
+
encodedCallArgs: curveLendAndStakeArgs({
|
|
1930
|
+
incomingStakingToken: incomingStakingToken,
|
|
1931
|
+
minIncomingStakingTokenAmount: minIncomingStakingTokenAmount,
|
|
1932
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
|
1933
|
+
pool: pool,
|
|
1934
|
+
useUnderlyings: useUnderlyings
|
|
1935
|
+
}),
|
|
1936
|
+
selector: lendAndStakeSelector
|
|
1937
|
+
});
|
|
1938
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1939
|
+
|
|
1940
|
+
case 3:
|
|
1941
|
+
case "end":
|
|
1942
|
+
return _context3.stop();
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
}, _callee3);
|
|
1946
|
+
}));
|
|
1947
|
+
return _curveLendAndStake.apply(this, arguments);
|
|
1499
1948
|
}
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
fundOwner = _ref7.fundOwner,
|
|
1504
|
-
curveLiquidityAaveAdapter = _ref7.curveLiquidityAaveAdapter,
|
|
1505
|
-
outgoingLiquidityGaugeTokenAmount = _ref7.outgoingLiquidityGaugeTokenAmount,
|
|
1506
|
-
_ref7$minIncomingAave = _ref7.minIncomingAaveDaiAmount,
|
|
1507
|
-
minIncomingAaveDaiAmount = _ref7$minIncomingAave === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave,
|
|
1508
|
-
_ref7$minIncomingAave2 = _ref7.minIncomingAaveUsdcAmount,
|
|
1509
|
-
minIncomingAaveUsdcAmount = _ref7$minIncomingAave2 === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave2,
|
|
1510
|
-
_ref7$minIncomingAave3 = _ref7.minIncomingAaveUsdtAmount,
|
|
1511
|
-
minIncomingAaveUsdtAmount = _ref7$minIncomingAave3 === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave3,
|
|
1512
|
-
_ref7$receiveSingleAs = _ref7.receiveSingleAsset,
|
|
1513
|
-
receiveSingleAsset = _ref7$receiveSingleAs === void 0 ? false : _ref7$receiveSingleAs,
|
|
1514
|
-
_ref7$useUnderlyings = _ref7.useUnderlyings,
|
|
1515
|
-
useUnderlyings = _ref7$useUnderlyings === void 0 ? false : _ref7$useUnderlyings;
|
|
1516
|
-
var callArgs = callOnIntegrationArgs({
|
|
1517
|
-
adapter: curveLiquidityAaveAdapter,
|
|
1518
|
-
selector: unstakeAndRedeemSelector,
|
|
1519
|
-
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
|
1520
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1521
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
1522
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
1523
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
1524
|
-
receiveSingleAsset: receiveSingleAsset,
|
|
1525
|
-
useUnderlyings: useUnderlyings
|
|
1526
|
-
})
|
|
1527
|
-
});
|
|
1528
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1949
|
+
|
|
1950
|
+
function curveRedeem(_x4) {
|
|
1951
|
+
return _curveRedeem.apply(this, arguments);
|
|
1529
1952
|
}
|
|
1530
|
-
function curveAaveUnstake(_ref8) {
|
|
1531
|
-
var comptrollerProxy = _ref8.comptrollerProxy,
|
|
1532
|
-
integrationManager = _ref8.integrationManager,
|
|
1533
|
-
fundOwner = _ref8.fundOwner,
|
|
1534
|
-
curveLiquidityAaveAdapter = _ref8.curveLiquidityAaveAdapter,
|
|
1535
|
-
outgoingLiquidityGaugeTokenAmount = _ref8.outgoingLiquidityGaugeTokenAmount;
|
|
1536
|
-
var callArgs = callOnIntegrationArgs({
|
|
1537
|
-
adapter: curveLiquidityAaveAdapter,
|
|
1538
|
-
selector: unstakeSelector,
|
|
1539
|
-
encodedCallArgs: curveAaveUnstakeArgs({
|
|
1540
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1541
|
-
})
|
|
1542
|
-
});
|
|
1543
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1544
|
-
} // eurs pool
|
|
1545
1953
|
|
|
1546
|
-
function
|
|
1954
|
+
function _curveRedeem() {
|
|
1955
|
+
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref5) {
|
|
1956
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
|
1957
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1958
|
+
while (1) {
|
|
1959
|
+
switch (_context4.prev = _context4.next) {
|
|
1960
|
+
case 0:
|
|
1961
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, signer = _ref5.signer, curveLiquidityAdapter = _ref5.curveLiquidityAdapter, pool = _ref5.pool, outgoingLpTokenAmount = _ref5.outgoingLpTokenAmount, useUnderlyings = _ref5.useUnderlyings, redeemType = _ref5.redeemType, incomingAssetData = _ref5.incomingAssetData;
|
|
1962
|
+
callArgs = callOnIntegrationArgs({
|
|
1963
|
+
adapter: curveLiquidityAdapter,
|
|
1964
|
+
encodedCallArgs: curveRedeemArgs({
|
|
1965
|
+
incomingAssetData: incomingAssetData,
|
|
1966
|
+
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
|
1967
|
+
pool: pool,
|
|
1968
|
+
redeemType: redeemType,
|
|
1969
|
+
useUnderlyings: useUnderlyings
|
|
1970
|
+
}),
|
|
1971
|
+
selector: redeemSelector
|
|
1972
|
+
});
|
|
1973
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1974
|
+
|
|
1975
|
+
case 3:
|
|
1976
|
+
case "end":
|
|
1977
|
+
return _context4.stop();
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
}, _callee4);
|
|
1981
|
+
}));
|
|
1982
|
+
return _curveRedeem.apply(this, arguments);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
function curveStake(_x5) {
|
|
1986
|
+
return _curveStake.apply(this, arguments);
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
function _curveStake() {
|
|
1990
|
+
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref6) {
|
|
1991
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingStakingToken, amount, callArgs;
|
|
1992
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1993
|
+
while (1) {
|
|
1994
|
+
switch (_context5.prev = _context5.next) {
|
|
1995
|
+
case 0:
|
|
1996
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingStakingToken = _ref6.incomingStakingToken, amount = _ref6.amount;
|
|
1997
|
+
callArgs = callOnIntegrationArgs({
|
|
1998
|
+
adapter: curveLiquidityAdapter,
|
|
1999
|
+
encodedCallArgs: curveStakeArgs({
|
|
2000
|
+
amount: amount,
|
|
2001
|
+
incomingStakingToken: incomingStakingToken,
|
|
2002
|
+
pool: pool
|
|
2003
|
+
}),
|
|
2004
|
+
selector: stakeSelector
|
|
2005
|
+
});
|
|
2006
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2007
|
+
|
|
2008
|
+
case 3:
|
|
2009
|
+
case "end":
|
|
2010
|
+
return _context5.stop();
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
}, _callee5);
|
|
2014
|
+
}));
|
|
2015
|
+
return _curveStake.apply(this, arguments);
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
function curveUnstake(_x6) {
|
|
2019
|
+
return _curveUnstake.apply(this, arguments);
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
function _curveUnstake() {
|
|
2023
|
+
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref7) {
|
|
2024
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, amount, callArgs;
|
|
2025
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
2026
|
+
while (1) {
|
|
2027
|
+
switch (_context6.prev = _context6.next) {
|
|
2028
|
+
case 0:
|
|
2029
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingStakingToken = _ref7.outgoingStakingToken, amount = _ref7.amount;
|
|
2030
|
+
callArgs = callOnIntegrationArgs({
|
|
2031
|
+
adapter: curveLiquidityAdapter,
|
|
2032
|
+
encodedCallArgs: curveUnstakeArgs({
|
|
2033
|
+
amount: amount,
|
|
2034
|
+
outgoingStakingToken: outgoingStakingToken,
|
|
2035
|
+
pool: pool
|
|
2036
|
+
}),
|
|
2037
|
+
selector: unstakeSelector
|
|
2038
|
+
});
|
|
2039
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2040
|
+
|
|
2041
|
+
case 3:
|
|
2042
|
+
case "end":
|
|
2043
|
+
return _context6.stop();
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
}, _callee6);
|
|
2047
|
+
}));
|
|
2048
|
+
return _curveUnstake.apply(this, arguments);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
function curveUnstakeAndRedeem(_x7) {
|
|
2052
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
|
2053
|
+
} // aave pool
|
|
2054
|
+
|
|
2055
|
+
function _curveUnstakeAndRedeem() {
|
|
2056
|
+
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref8) {
|
|
2057
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, outgoingStakingTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
|
2058
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
2059
|
+
while (1) {
|
|
2060
|
+
switch (_context7.prev = _context7.next) {
|
|
2061
|
+
case 0:
|
|
2062
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingStakingToken = _ref8.outgoingStakingToken, outgoingStakingTokenAmount = _ref8.outgoingStakingTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
|
2063
|
+
callArgs = callOnIntegrationArgs({
|
|
2064
|
+
adapter: curveLiquidityAdapter,
|
|
2065
|
+
encodedCallArgs: curveUnstakeAndRedeemArgs({
|
|
2066
|
+
incomingAssetData: incomingAssetData,
|
|
2067
|
+
outgoingStakingToken: outgoingStakingToken,
|
|
2068
|
+
outgoingStakingTokenAmount: outgoingStakingTokenAmount,
|
|
2069
|
+
pool: pool,
|
|
2070
|
+
redeemType: redeemType,
|
|
2071
|
+
useUnderlyings: useUnderlyings
|
|
2072
|
+
}),
|
|
2073
|
+
selector: unstakeAndRedeemSelector
|
|
2074
|
+
});
|
|
2075
|
+
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2076
|
+
|
|
2077
|
+
case 3:
|
|
2078
|
+
case "end":
|
|
2079
|
+
return _context7.stop();
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
}, _callee7);
|
|
2083
|
+
}));
|
|
2084
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
function curveAaveClaimRewards(_ref9) {
|
|
1547
2088
|
var comptrollerProxy = _ref9.comptrollerProxy,
|
|
1548
2089
|
integrationManager = _ref9.integrationManager,
|
|
1549
2090
|
fundOwner = _ref9.fundOwner,
|
|
1550
|
-
|
|
2091
|
+
curveLiquidityAaveAdapter = _ref9.curveLiquidityAaveAdapter;
|
|
1551
2092
|
var callArgs = callOnIntegrationArgs({
|
|
1552
|
-
adapter:
|
|
1553
|
-
|
|
1554
|
-
|
|
2093
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2094
|
+
encodedCallArgs: constants.HashZero,
|
|
2095
|
+
selector: claimRewardsSelector
|
|
1555
2096
|
});
|
|
1556
2097
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1557
2098
|
}
|
|
1558
|
-
function
|
|
2099
|
+
function curveAaveLend(_ref10) {
|
|
1559
2100
|
var comptrollerProxy = _ref10.comptrollerProxy,
|
|
1560
2101
|
integrationManager = _ref10.integrationManager,
|
|
1561
2102
|
fundOwner = _ref10.fundOwner,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
2103
|
+
curveLiquidityAaveAdapter = _ref10.curveLiquidityAaveAdapter,
|
|
2104
|
+
_ref10$outgoingAaveDa = _ref10.outgoingAaveDaiAmount,
|
|
2105
|
+
outgoingAaveDaiAmount = _ref10$outgoingAaveDa === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveDa,
|
|
2106
|
+
_ref10$outgoingAaveUs = _ref10.outgoingAaveUsdcAmount,
|
|
2107
|
+
outgoingAaveUsdcAmount = _ref10$outgoingAaveUs === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveUs,
|
|
2108
|
+
_ref10$outgoingAaveUs2 = _ref10.outgoingAaveUsdtAmount,
|
|
2109
|
+
outgoingAaveUsdtAmount = _ref10$outgoingAaveUs2 === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveUs2,
|
|
2110
|
+
_ref10$minIncomingLPT = _ref10.minIncomingLPTokenAmount,
|
|
2111
|
+
minIncomingLPTokenAmount = _ref10$minIncomingLPT === void 0 ? BigNumber.from(1) : _ref10$minIncomingLPT,
|
|
2112
|
+
_ref10$useUnderlyings = _ref10.useUnderlyings,
|
|
2113
|
+
useUnderlyings = _ref10$useUnderlyings === void 0 ? false : _ref10$useUnderlyings;
|
|
1566
2114
|
var callArgs = callOnIntegrationArgs({
|
|
1567
|
-
adapter:
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
2115
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2116
|
+
encodedCallArgs: curveAaveLendArgs({
|
|
2117
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
2118
|
+
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
|
2119
|
+
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
|
2120
|
+
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
|
2121
|
+
useUnderlyings: useUnderlyings
|
|
2122
|
+
}),
|
|
2123
|
+
selector: lendSelector
|
|
1574
2124
|
});
|
|
1575
2125
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1576
2126
|
}
|
|
1577
|
-
function
|
|
2127
|
+
function curveAaveLendAndStake(_ref11) {
|
|
1578
2128
|
var comptrollerProxy = _ref11.comptrollerProxy,
|
|
1579
2129
|
integrationManager = _ref11.integrationManager,
|
|
1580
2130
|
fundOwner = _ref11.fundOwner,
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
2131
|
+
curveLiquidityAaveAdapter = _ref11.curveLiquidityAaveAdapter,
|
|
2132
|
+
_ref11$outgoingAaveDa = _ref11.outgoingAaveDaiAmount,
|
|
2133
|
+
outgoingAaveDaiAmount = _ref11$outgoingAaveDa === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveDa,
|
|
2134
|
+
_ref11$outgoingAaveUs = _ref11.outgoingAaveUsdcAmount,
|
|
2135
|
+
outgoingAaveUsdcAmount = _ref11$outgoingAaveUs === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveUs,
|
|
2136
|
+
_ref11$outgoingAaveUs2 = _ref11.outgoingAaveUsdtAmount,
|
|
2137
|
+
outgoingAaveUsdtAmount = _ref11$outgoingAaveUs2 === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveUs2,
|
|
2138
|
+
_ref11$minIncomingLiq = _ref11.minIncomingLiquidityGaugeTokenAmount,
|
|
2139
|
+
minIncomingLiquidityGaugeTokenAmount = _ref11$minIncomingLiq === void 0 ? BigNumber.from(1) : _ref11$minIncomingLiq,
|
|
2140
|
+
_ref11$useUnderlyings = _ref11.useUnderlyings,
|
|
2141
|
+
useUnderlyings = _ref11$useUnderlyings === void 0 ? false : _ref11$useUnderlyings;
|
|
1585
2142
|
var callArgs = callOnIntegrationArgs({
|
|
1586
|
-
adapter:
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
2143
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2144
|
+
encodedCallArgs: curveAaveLendAndStakeArgs({
|
|
2145
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
2146
|
+
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
|
2147
|
+
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
|
2148
|
+
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
|
2149
|
+
useUnderlyings: useUnderlyings
|
|
2150
|
+
}),
|
|
2151
|
+
selector: lendAndStakeSelector
|
|
1593
2152
|
});
|
|
1594
2153
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1595
2154
|
}
|
|
1596
|
-
function
|
|
2155
|
+
function curveAaveRedeem(_ref12) {
|
|
1597
2156
|
var comptrollerProxy = _ref12.comptrollerProxy,
|
|
1598
2157
|
integrationManager = _ref12.integrationManager,
|
|
1599
2158
|
fundOwner = _ref12.fundOwner,
|
|
1600
|
-
|
|
2159
|
+
curveLiquidityAaveAdapter = _ref12.curveLiquidityAaveAdapter,
|
|
1601
2160
|
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
2161
|
+
_ref12$minIncomingAav = _ref12.minIncomingAaveDaiAmount,
|
|
2162
|
+
minIncomingAaveDaiAmount = _ref12$minIncomingAav === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav,
|
|
2163
|
+
_ref12$minIncomingAav2 = _ref12.minIncomingAaveUsdcAmount,
|
|
2164
|
+
minIncomingAaveUsdcAmount = _ref12$minIncomingAav2 === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav2,
|
|
2165
|
+
_ref12$minIncomingAav3 = _ref12.minIncomingAaveUsdtAmount,
|
|
2166
|
+
minIncomingAaveUsdtAmount = _ref12$minIncomingAav3 === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav3,
|
|
2167
|
+
_ref12$receiveSingleA = _ref12.receiveSingleAsset,
|
|
2168
|
+
receiveSingleAsset = _ref12$receiveSingleA === void 0 ? false : _ref12$receiveSingleA,
|
|
2169
|
+
_ref12$useUnderlyings = _ref12.useUnderlyings,
|
|
2170
|
+
useUnderlyings = _ref12$useUnderlyings === void 0 ? false : _ref12$useUnderlyings;
|
|
1605
2171
|
var callArgs = callOnIntegrationArgs({
|
|
1606
|
-
adapter:
|
|
1607
|
-
|
|
1608
|
-
|
|
2172
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2173
|
+
encodedCallArgs: curveAaveRedeemArgs({
|
|
2174
|
+
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
2175
|
+
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
2176
|
+
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
1609
2177
|
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
2178
|
+
receiveSingleAsset: receiveSingleAsset,
|
|
2179
|
+
useUnderlyings: useUnderlyings
|
|
2180
|
+
}),
|
|
2181
|
+
selector: redeemSelector
|
|
1614
2182
|
});
|
|
1615
2183
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1616
2184
|
}
|
|
1617
|
-
function
|
|
2185
|
+
function curveAaveStake(_ref13) {
|
|
1618
2186
|
var comptrollerProxy = _ref13.comptrollerProxy,
|
|
1619
2187
|
integrationManager = _ref13.integrationManager,
|
|
1620
2188
|
fundOwner = _ref13.fundOwner,
|
|
1621
|
-
|
|
2189
|
+
curveLiquidityAaveAdapter = _ref13.curveLiquidityAaveAdapter,
|
|
1622
2190
|
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
|
1623
2191
|
var callArgs = callOnIntegrationArgs({
|
|
1624
|
-
adapter:
|
|
1625
|
-
|
|
1626
|
-
encodedCallArgs: curveEursStakeArgs({
|
|
2192
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2193
|
+
encodedCallArgs: curveAaveStakeArgs({
|
|
1627
2194
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1628
|
-
})
|
|
2195
|
+
}),
|
|
2196
|
+
selector: stakeSelector
|
|
1629
2197
|
});
|
|
1630
2198
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1631
2199
|
}
|
|
1632
|
-
function
|
|
2200
|
+
function curveAaveUnstakeAndRedeem(_ref14) {
|
|
1633
2201
|
var comptrollerProxy = _ref14.comptrollerProxy,
|
|
1634
2202
|
integrationManager = _ref14.integrationManager,
|
|
1635
2203
|
fundOwner = _ref14.fundOwner,
|
|
1636
|
-
|
|
2204
|
+
curveLiquidityAaveAdapter = _ref14.curveLiquidityAaveAdapter,
|
|
1637
2205
|
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
2206
|
+
_ref14$minIncomingAav = _ref14.minIncomingAaveDaiAmount,
|
|
2207
|
+
minIncomingAaveDaiAmount = _ref14$minIncomingAav === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav,
|
|
2208
|
+
_ref14$minIncomingAav2 = _ref14.minIncomingAaveUsdcAmount,
|
|
2209
|
+
minIncomingAaveUsdcAmount = _ref14$minIncomingAav2 === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav2,
|
|
2210
|
+
_ref14$minIncomingAav3 = _ref14.minIncomingAaveUsdtAmount,
|
|
2211
|
+
minIncomingAaveUsdtAmount = _ref14$minIncomingAav3 === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav3,
|
|
2212
|
+
_ref14$receiveSingleA = _ref14.receiveSingleAsset,
|
|
2213
|
+
receiveSingleAsset = _ref14$receiveSingleA === void 0 ? false : _ref14$receiveSingleA,
|
|
2214
|
+
_ref14$useUnderlyings = _ref14.useUnderlyings,
|
|
2215
|
+
useUnderlyings = _ref14$useUnderlyings === void 0 ? false : _ref14$useUnderlyings;
|
|
1641
2216
|
var callArgs = callOnIntegrationArgs({
|
|
1642
|
-
adapter:
|
|
1643
|
-
|
|
1644
|
-
|
|
2217
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2218
|
+
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
|
2219
|
+
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
2220
|
+
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
2221
|
+
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
1645
2222
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
2223
|
+
receiveSingleAsset: receiveSingleAsset,
|
|
2224
|
+
useUnderlyings: useUnderlyings
|
|
2225
|
+
}),
|
|
2226
|
+
selector: unstakeAndRedeemSelector
|
|
1650
2227
|
});
|
|
1651
2228
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1652
2229
|
}
|
|
1653
|
-
function
|
|
2230
|
+
function curveAaveUnstake(_ref15) {
|
|
1654
2231
|
var comptrollerProxy = _ref15.comptrollerProxy,
|
|
1655
2232
|
integrationManager = _ref15.integrationManager,
|
|
1656
2233
|
fundOwner = _ref15.fundOwner,
|
|
1657
|
-
|
|
2234
|
+
curveLiquidityAaveAdapter = _ref15.curveLiquidityAaveAdapter,
|
|
1658
2235
|
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
|
1659
2236
|
var callArgs = callOnIntegrationArgs({
|
|
1660
|
-
adapter:
|
|
1661
|
-
|
|
1662
|
-
encodedCallArgs: curveEursUnstakeArgs({
|
|
2237
|
+
adapter: curveLiquidityAaveAdapter,
|
|
2238
|
+
encodedCallArgs: curveAaveUnstakeArgs({
|
|
1663
2239
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1664
|
-
})
|
|
2240
|
+
}),
|
|
2241
|
+
selector: unstakeSelector
|
|
1665
2242
|
});
|
|
1666
2243
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1667
2244
|
} // sETH pool
|
|
@@ -1673,8 +2250,8 @@ function curveSethClaimRewards(_ref16) {
|
|
|
1673
2250
|
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
|
1674
2251
|
var callArgs = callOnIntegrationArgs({
|
|
1675
2252
|
adapter: curveLiquiditySethAdapter,
|
|
1676
|
-
|
|
1677
|
-
|
|
2253
|
+
encodedCallArgs: constants.HashZero,
|
|
2254
|
+
selector: claimRewardsSelector
|
|
1678
2255
|
});
|
|
1679
2256
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1680
2257
|
}
|
|
@@ -1688,12 +2265,12 @@ function curveSethLend(_ref17) {
|
|
|
1688
2265
|
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
|
1689
2266
|
var callArgs = callOnIntegrationArgs({
|
|
1690
2267
|
adapter: curveLiquiditySethAdapter,
|
|
1691
|
-
selector: lendSelector,
|
|
1692
2268
|
encodedCallArgs: curveSethLendArgs({
|
|
1693
|
-
|
|
2269
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1694
2270
|
outgoingSethAmount: outgoingSethAmount,
|
|
1695
|
-
|
|
1696
|
-
})
|
|
2271
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2272
|
+
}),
|
|
2273
|
+
selector: lendSelector
|
|
1697
2274
|
});
|
|
1698
2275
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1699
2276
|
}
|
|
@@ -1707,12 +2284,12 @@ function curveSethLendAndStake(_ref18) {
|
|
|
1707
2284
|
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
|
1708
2285
|
var callArgs = callOnIntegrationArgs({
|
|
1709
2286
|
adapter: curveLiquiditySethAdapter,
|
|
1710
|
-
selector: lendAndStakeSelector,
|
|
1711
2287
|
encodedCallArgs: curveSethLendAndStakeArgs({
|
|
1712
|
-
|
|
2288
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1713
2289
|
outgoingSethAmount: outgoingSethAmount,
|
|
1714
|
-
|
|
1715
|
-
})
|
|
2290
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2291
|
+
}),
|
|
2292
|
+
selector: lendAndStakeSelector
|
|
1716
2293
|
});
|
|
1717
2294
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1718
2295
|
}
|
|
@@ -1727,13 +2304,13 @@ function curveSethRedeem(_ref19) {
|
|
|
1727
2304
|
receiveSingleAsset = _ref19.receiveSingleAsset;
|
|
1728
2305
|
var callArgs = callOnIntegrationArgs({
|
|
1729
2306
|
adapter: curveLiquiditySethAdapter,
|
|
1730
|
-
|
|
1731
|
-
encodedCallArgs: curveSethRedeemArgs({
|
|
1732
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1733
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
2307
|
+
encodedCallArgs: curveSethRedeemArgs({
|
|
1734
2308
|
minIncomingSethAmount: minIncomingSethAmount,
|
|
2309
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2310
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1735
2311
|
receiveSingleAsset: receiveSingleAsset
|
|
1736
|
-
})
|
|
2312
|
+
}),
|
|
2313
|
+
selector: redeemSelector
|
|
1737
2314
|
});
|
|
1738
2315
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1739
2316
|
}
|
|
@@ -1745,10 +2322,10 @@ function curveSethStake(_ref20) {
|
|
|
1745
2322
|
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
|
1746
2323
|
var callArgs = callOnIntegrationArgs({
|
|
1747
2324
|
adapter: curveLiquiditySethAdapter,
|
|
1748
|
-
selector: stakeSelector,
|
|
1749
2325
|
encodedCallArgs: curveSethStakeArgs({
|
|
1750
2326
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1751
|
-
})
|
|
2327
|
+
}),
|
|
2328
|
+
selector: stakeSelector
|
|
1752
2329
|
});
|
|
1753
2330
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1754
2331
|
}
|
|
@@ -1763,13 +2340,13 @@ function curveSethUnstakeAndRedeem(_ref21) {
|
|
|
1763
2340
|
receiveSingleAsset = _ref21.receiveSingleAsset;
|
|
1764
2341
|
var callArgs = callOnIntegrationArgs({
|
|
1765
2342
|
adapter: curveLiquiditySethAdapter,
|
|
1766
|
-
selector: unstakeAndRedeemSelector,
|
|
1767
2343
|
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
|
1768
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1769
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1770
2344
|
minIncomingSethAmount: minIncomingSethAmount,
|
|
2345
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2346
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1771
2347
|
receiveSingleAsset: receiveSingleAsset
|
|
1772
|
-
})
|
|
2348
|
+
}),
|
|
2349
|
+
selector: unstakeAndRedeemSelector
|
|
1773
2350
|
});
|
|
1774
2351
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1775
2352
|
}
|
|
@@ -1781,10 +2358,10 @@ function curveSethUnstake(_ref22) {
|
|
|
1781
2358
|
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
|
1782
2359
|
var callArgs = callOnIntegrationArgs({
|
|
1783
2360
|
adapter: curveLiquiditySethAdapter,
|
|
1784
|
-
selector: unstakeSelector,
|
|
1785
2361
|
encodedCallArgs: curveSethUnstakeArgs({
|
|
1786
2362
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1787
|
-
})
|
|
2363
|
+
}),
|
|
2364
|
+
selector: unstakeSelector
|
|
1788
2365
|
});
|
|
1789
2366
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1790
2367
|
} // stETH pool
|
|
@@ -1796,8 +2373,8 @@ function curveStethClaimRewards(_ref23) {
|
|
|
1796
2373
|
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
|
1797
2374
|
var callArgs = callOnIntegrationArgs({
|
|
1798
2375
|
adapter: curveLiquidityStethAdapter,
|
|
1799
|
-
|
|
1800
|
-
|
|
2376
|
+
encodedCallArgs: constants.HashZero,
|
|
2377
|
+
selector: claimRewardsSelector
|
|
1801
2378
|
});
|
|
1802
2379
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1803
2380
|
}
|
|
@@ -1811,12 +2388,12 @@ function curveStethLend(_ref24) {
|
|
|
1811
2388
|
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
|
1812
2389
|
var callArgs = callOnIntegrationArgs({
|
|
1813
2390
|
adapter: curveLiquidityStethAdapter,
|
|
1814
|
-
selector: lendSelector,
|
|
1815
2391
|
encodedCallArgs: curveStethLendArgs({
|
|
1816
|
-
|
|
2392
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1817
2393
|
outgoingStethAmount: outgoingStethAmount,
|
|
1818
|
-
|
|
1819
|
-
})
|
|
2394
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2395
|
+
}),
|
|
2396
|
+
selector: lendSelector
|
|
1820
2397
|
});
|
|
1821
2398
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1822
2399
|
}
|
|
@@ -1830,12 +2407,12 @@ function curveStethLendAndStake(_ref25) {
|
|
|
1830
2407
|
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
|
1831
2408
|
var callArgs = callOnIntegrationArgs({
|
|
1832
2409
|
adapter: curveLiquidityStethAdapter,
|
|
1833
|
-
selector: lendAndStakeSelector,
|
|
1834
2410
|
encodedCallArgs: curveStethLendAndStakeArgs({
|
|
1835
|
-
|
|
2411
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1836
2412
|
outgoingStethAmount: outgoingStethAmount,
|
|
1837
|
-
|
|
1838
|
-
})
|
|
2413
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2414
|
+
}),
|
|
2415
|
+
selector: lendAndStakeSelector
|
|
1839
2416
|
});
|
|
1840
2417
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1841
2418
|
}
|
|
@@ -1850,13 +2427,13 @@ function curveStethRedeem(_ref26) {
|
|
|
1850
2427
|
receiveSingleAsset = _ref26.receiveSingleAsset;
|
|
1851
2428
|
var callArgs = callOnIntegrationArgs({
|
|
1852
2429
|
adapter: curveLiquidityStethAdapter,
|
|
1853
|
-
selector: redeemSelector,
|
|
1854
2430
|
encodedCallArgs: curveStethRedeemArgs({
|
|
1855
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1856
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1857
2431
|
minIncomingStethAmount: minIncomingStethAmount,
|
|
2432
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2433
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1858
2434
|
receiveSingleAsset: receiveSingleAsset
|
|
1859
|
-
})
|
|
2435
|
+
}),
|
|
2436
|
+
selector: redeemSelector
|
|
1860
2437
|
});
|
|
1861
2438
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1862
2439
|
}
|
|
@@ -1868,10 +2445,10 @@ function curveStethStake(_ref27) {
|
|
|
1868
2445
|
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
|
1869
2446
|
var callArgs = callOnIntegrationArgs({
|
|
1870
2447
|
adapter: curveLiquidityStethAdapter,
|
|
1871
|
-
selector: stakeSelector,
|
|
1872
2448
|
encodedCallArgs: curveStethStakeArgs({
|
|
1873
2449
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1874
|
-
})
|
|
2450
|
+
}),
|
|
2451
|
+
selector: stakeSelector
|
|
1875
2452
|
});
|
|
1876
2453
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1877
2454
|
}
|
|
@@ -1886,13 +2463,13 @@ function curveStethUnstakeAndRedeem(_ref28) {
|
|
|
1886
2463
|
receiveSingleAsset = _ref28.receiveSingleAsset;
|
|
1887
2464
|
var callArgs = callOnIntegrationArgs({
|
|
1888
2465
|
adapter: curveLiquidityStethAdapter,
|
|
1889
|
-
selector: unstakeAndRedeemSelector,
|
|
1890
2466
|
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
|
1891
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1892
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1893
2467
|
minIncomingStethAmount: minIncomingStethAmount,
|
|
2468
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2469
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1894
2470
|
receiveSingleAsset: receiveSingleAsset
|
|
1895
|
-
})
|
|
2471
|
+
}),
|
|
2472
|
+
selector: unstakeAndRedeemSelector
|
|
1896
2473
|
});
|
|
1897
2474
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1898
2475
|
}
|
|
@@ -1904,10 +2481,10 @@ function curveStethUnstake(_ref29) {
|
|
|
1904
2481
|
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
|
1905
2482
|
var callArgs = callOnIntegrationArgs({
|
|
1906
2483
|
adapter: curveLiquidityStethAdapter,
|
|
1907
|
-
selector: unstakeSelector,
|
|
1908
2484
|
encodedCallArgs: curveStethUnstakeArgs({
|
|
1909
2485
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1910
|
-
})
|
|
2486
|
+
}),
|
|
2487
|
+
selector: unstakeSelector
|
|
1911
2488
|
});
|
|
1912
2489
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1913
2490
|
}
|
|
@@ -1926,10 +2503,10 @@ function _idleClaimRewards() {
|
|
|
1926
2503
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
|
1927
2504
|
callArgs = callOnIntegrationArgs({
|
|
1928
2505
|
adapter: idleAdapter,
|
|
1929
|
-
selector: claimRewardsSelector,
|
|
1930
2506
|
encodedCallArgs: idleClaimRewardsArgs({
|
|
1931
2507
|
idleToken: idleToken
|
|
1932
|
-
})
|
|
2508
|
+
}),
|
|
2509
|
+
selector: claimRewardsSelector
|
|
1933
2510
|
});
|
|
1934
2511
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1935
2512
|
|
|
@@ -1958,12 +2535,12 @@ function _idleLend() {
|
|
|
1958
2535
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, idleAdapter = _ref2.idleAdapter, idleToken = _ref2.idleToken, outgoingUnderlyingAmount = _ref2.outgoingUnderlyingAmount, _ref2$minIncomingIdle = _ref2.minIncomingIdleTokenAmount, minIncomingIdleTokenAmount = _ref2$minIncomingIdle === void 0 ? BigNumber.from(1) : _ref2$minIncomingIdle;
|
|
1959
2536
|
callArgs = callOnIntegrationArgs({
|
|
1960
2537
|
adapter: idleAdapter,
|
|
1961
|
-
selector: lendSelector,
|
|
1962
2538
|
encodedCallArgs: idleLendArgs({
|
|
1963
2539
|
idleToken: idleToken,
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
})
|
|
2540
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
|
2541
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
|
2542
|
+
}),
|
|
2543
|
+
selector: lendSelector
|
|
1967
2544
|
});
|
|
1968
2545
|
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1969
2546
|
|
|
@@ -1992,12 +2569,12 @@ function _idleRedeem() {
|
|
|
1992
2569
|
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, idleAdapter = _ref3.idleAdapter, idleToken = _ref3.idleToken, outgoingIdleTokenAmount = _ref3.outgoingIdleTokenAmount, _ref3$minIncomingUnde = _ref3.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref3$minIncomingUnde === void 0 ? BigNumber.from(1) : _ref3$minIncomingUnde;
|
|
1993
2570
|
callArgs = callOnIntegrationArgs({
|
|
1994
2571
|
adapter: idleAdapter,
|
|
1995
|
-
selector: redeemSelector,
|
|
1996
2572
|
encodedCallArgs: idleRedeemArgs({
|
|
1997
2573
|
idleToken: idleToken,
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
})
|
|
2574
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
|
2575
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
|
2576
|
+
}),
|
|
2577
|
+
selector: redeemSelector
|
|
2001
2578
|
});
|
|
2002
2579
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2003
2580
|
|
|
@@ -2068,17 +2645,17 @@ function _mockGenericSwap() {
|
|
|
2068
2645
|
|
|
2069
2646
|
case 9:
|
|
2070
2647
|
swapArgs = mockGenericSwapArgs({
|
|
2071
|
-
|
|
2072
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
|
2648
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
|
2073
2649
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
|
2074
2650
|
incomingAssets: incomingAssets,
|
|
2651
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
|
2075
2652
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
|
2076
|
-
|
|
2653
|
+
spendAssets: spendAssets
|
|
2077
2654
|
});
|
|
2078
2655
|
callArgs = callOnIntegrationArgs({
|
|
2079
2656
|
adapter: mockGenericAdapter,
|
|
2080
|
-
|
|
2081
|
-
|
|
2657
|
+
encodedCallArgs: swapArgs,
|
|
2658
|
+
selector: selector
|
|
2082
2659
|
});
|
|
2083
2660
|
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2084
2661
|
_context.next = 14;
|
|
@@ -2097,14 +2674,80 @@ function _mockGenericSwap() {
|
|
|
2097
2674
|
return _mockGenericSwap.apply(this, arguments);
|
|
2098
2675
|
}
|
|
2099
2676
|
|
|
2677
|
+
function olympusV2Stake(_x) {
|
|
2678
|
+
return _olympusV2Stake.apply(this, arguments);
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
function _olympusV2Stake() {
|
|
2682
|
+
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
2683
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
|
2684
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2685
|
+
while (1) {
|
|
2686
|
+
switch (_context.prev = _context.next) {
|
|
2687
|
+
case 0:
|
|
2688
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
|
2689
|
+
stakeArgs = olympusV2StakeArgs({
|
|
2690
|
+
amount: amount
|
|
2691
|
+
});
|
|
2692
|
+
callArgs = callOnIntegrationArgs({
|
|
2693
|
+
adapter: olympusV2Adapter,
|
|
2694
|
+
encodedCallArgs: stakeArgs,
|
|
2695
|
+
selector: stakeSelector
|
|
2696
|
+
});
|
|
2697
|
+
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2698
|
+
return _context.abrupt("return", stakeTx);
|
|
2699
|
+
|
|
2700
|
+
case 5:
|
|
2701
|
+
case "end":
|
|
2702
|
+
return _context.stop();
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
}, _callee);
|
|
2706
|
+
}));
|
|
2707
|
+
return _olympusV2Stake.apply(this, arguments);
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
function olympusV2Unstake(_x2) {
|
|
2711
|
+
return _olympusV2Unstake.apply(this, arguments);
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
function _olympusV2Unstake() {
|
|
2715
|
+
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
2716
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
|
2717
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2718
|
+
while (1) {
|
|
2719
|
+
switch (_context2.prev = _context2.next) {
|
|
2720
|
+
case 0:
|
|
2721
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
|
2722
|
+
unstakeArgs = olympusV2UnstakeArgs({
|
|
2723
|
+
amount: amount
|
|
2724
|
+
});
|
|
2725
|
+
callArgs = callOnIntegrationArgs({
|
|
2726
|
+
adapter: olympusV2Adapter,
|
|
2727
|
+
encodedCallArgs: unstakeArgs,
|
|
2728
|
+
selector: unstakeSelector
|
|
2729
|
+
});
|
|
2730
|
+
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2731
|
+
return _context2.abrupt("return", unstakeTx);
|
|
2732
|
+
|
|
2733
|
+
case 5:
|
|
2734
|
+
case "end":
|
|
2735
|
+
return _context2.stop();
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
}, _callee2);
|
|
2739
|
+
}));
|
|
2740
|
+
return _olympusV2Unstake.apply(this, arguments);
|
|
2741
|
+
}
|
|
2742
|
+
|
|
2100
2743
|
function paraSwapV4GenerateDummyPaths(_ref) {
|
|
2101
2744
|
var toTokens = _ref.toTokens;
|
|
2102
2745
|
return toTokens.map(function (toToken) {
|
|
2103
2746
|
return {
|
|
2104
|
-
to: toToken,
|
|
2105
|
-
totalNetworkFee: 0,
|
|
2106
2747
|
// Not supported in our protocol
|
|
2107
|
-
routes: []
|
|
2748
|
+
routes: [],
|
|
2749
|
+
to: toToken,
|
|
2750
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
|
2108
2751
|
|
|
2109
2752
|
};
|
|
2110
2753
|
});
|
|
@@ -2123,16 +2766,16 @@ function _paraSwapV4TakeOrder() {
|
|
|
2123
2766
|
case 0:
|
|
2124
2767
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV4Adapter = _ref2.paraSwapV4Adapter, outgoingAsset = _ref2.outgoingAsset, _ref2$outgoingAssetAm = _ref2.outgoingAssetAmount, outgoingAssetAmount = _ref2$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref2$outgoingAssetAm, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, paths = _ref2.paths;
|
|
2125
2768
|
takeOrderArgs = paraSwapV4TakeOrderArgs({
|
|
2126
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2127
2769
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
|
2770
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2128
2771
|
outgoingAsset: outgoingAsset,
|
|
2129
2772
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
2130
2773
|
paths: paths
|
|
2131
2774
|
});
|
|
2132
2775
|
callArgs = callOnIntegrationArgs({
|
|
2133
2776
|
adapter: paraSwapV4Adapter,
|
|
2134
|
-
|
|
2135
|
-
|
|
2777
|
+
encodedCallArgs: takeOrderArgs,
|
|
2778
|
+
selector: takeOrderSelector
|
|
2136
2779
|
});
|
|
2137
2780
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2138
2781
|
|
|
@@ -2146,30 +2789,177 @@ function _paraSwapV4TakeOrder() {
|
|
|
2146
2789
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
|
2147
2790
|
}
|
|
2148
2791
|
|
|
2792
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
|
2793
|
+
var toTokens = _ref.toTokens;
|
|
2794
|
+
return toTokens.map(function (toToken) {
|
|
2795
|
+
return {
|
|
2796
|
+
// Not supported in our protocol
|
|
2797
|
+
adapters: [],
|
|
2798
|
+
to: toToken,
|
|
2799
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
|
2800
|
+
|
|
2801
|
+
};
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
function paraSwapV5TakeOrder(_x) {
|
|
2805
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
function _paraSwapV5TakeOrder() {
|
|
2809
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
2810
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
|
2811
|
+
|
|
2812
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2813
|
+
while (1) {
|
|
2814
|
+
switch (_context.prev = _context.next) {
|
|
2815
|
+
case 0:
|
|
2816
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV5Adapter = _ref2.paraSwapV5Adapter, outgoingAsset = _ref2.outgoingAsset, outgoingAssetAmount = _ref2.outgoingAssetAmount, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, _ref2$uuid = _ref2.uuid, uuid = _ref2$uuid === void 0 ? utils.randomBytes(16) : _ref2$uuid, paths = _ref2.paths;
|
|
2817
|
+
takeOrderArgs = paraSwapV5TakeOrderArgs({
|
|
2818
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
|
2819
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2820
|
+
outgoingAsset: outgoingAsset,
|
|
2821
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
|
2822
|
+
paths: paths,
|
|
2823
|
+
uuid: uuid
|
|
2824
|
+
});
|
|
2825
|
+
callArgs = callOnIntegrationArgs({
|
|
2826
|
+
adapter: paraSwapV5Adapter,
|
|
2827
|
+
encodedCallArgs: takeOrderArgs,
|
|
2828
|
+
selector: takeOrderSelector
|
|
2829
|
+
});
|
|
2830
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2831
|
+
|
|
2832
|
+
case 4:
|
|
2833
|
+
case "end":
|
|
2834
|
+
return _context.stop();
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
}, _callee);
|
|
2838
|
+
}));
|
|
2839
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
function poolTogetherV4Lend(_x) {
|
|
2843
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
function _poolTogetherV4Lend() {
|
|
2847
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
2848
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
|
2849
|
+
|
|
2850
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2851
|
+
while (1) {
|
|
2852
|
+
switch (_context.prev = _context.next) {
|
|
2853
|
+
case 0:
|
|
2854
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, poolTogetherV4Adapter = _ref.poolTogetherV4Adapter, ptToken = _ref.ptToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? utils.parseEther('1') : _ref$amount;
|
|
2855
|
+
lendArgs = poolTogetherV4LendArgs({
|
|
2856
|
+
amount: amount,
|
|
2857
|
+
ptToken: ptToken
|
|
2858
|
+
});
|
|
2859
|
+
callArgs = callOnIntegrationArgs({
|
|
2860
|
+
adapter: poolTogetherV4Adapter,
|
|
2861
|
+
encodedCallArgs: lendArgs,
|
|
2862
|
+
selector: lendSelector
|
|
2863
|
+
});
|
|
2864
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2865
|
+
return _context.abrupt("return", lendTx);
|
|
2866
|
+
|
|
2867
|
+
case 5:
|
|
2868
|
+
case "end":
|
|
2869
|
+
return _context.stop();
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
}, _callee);
|
|
2873
|
+
}));
|
|
2874
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
function poolTogetherV4Redeem(_x2) {
|
|
2878
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
function _poolTogetherV4Redeem() {
|
|
2882
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
2883
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
|
2884
|
+
|
|
2885
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2886
|
+
while (1) {
|
|
2887
|
+
switch (_context2.prev = _context2.next) {
|
|
2888
|
+
case 0:
|
|
2889
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, poolTogetherV4Adapter = _ref2.poolTogetherV4Adapter, ptToken = _ref2.ptToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? utils.parseEther('1') : _ref2$amount;
|
|
2890
|
+
redeemArgs = poolTogetherV4RedeemArgs({
|
|
2891
|
+
amount: amount,
|
|
2892
|
+
ptToken: ptToken
|
|
2893
|
+
});
|
|
2894
|
+
callArgs = callOnIntegrationArgs({
|
|
2895
|
+
adapter: poolTogetherV4Adapter,
|
|
2896
|
+
encodedCallArgs: redeemArgs,
|
|
2897
|
+
selector: redeemSelector
|
|
2898
|
+
});
|
|
2899
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2900
|
+
return _context2.abrupt("return", redeemTx);
|
|
2901
|
+
|
|
2902
|
+
case 5:
|
|
2903
|
+
case "end":
|
|
2904
|
+
return _context2.stop();
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
}, _callee2);
|
|
2908
|
+
}));
|
|
2909
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
|
2913
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
function _poolTogetherV4ClaimRewards() {
|
|
2917
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
2918
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
|
2919
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2920
|
+
while (1) {
|
|
2921
|
+
switch (_context3.prev = _context3.next) {
|
|
2922
|
+
case 0:
|
|
2923
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
|
2924
|
+
claimRewardsArgs = poolTogetherV4ClaimRewardsArgs({
|
|
2925
|
+
drawIds: drawIds,
|
|
2926
|
+
prizeDistributor: prizeDistributor,
|
|
2927
|
+
winningPicks: winningPicks
|
|
2928
|
+
});
|
|
2929
|
+
callArgs = callOnIntegrationArgs({
|
|
2930
|
+
adapter: poolTogetherV4Adapter,
|
|
2931
|
+
encodedCallArgs: claimRewardsArgs,
|
|
2932
|
+
selector: claimRewardsSelector
|
|
2933
|
+
});
|
|
2934
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2935
|
+
return _context3.abrupt("return", claimTx);
|
|
2936
|
+
|
|
2937
|
+
case 5:
|
|
2938
|
+
case "end":
|
|
2939
|
+
return _context3.stop();
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
}, _callee3);
|
|
2943
|
+
}));
|
|
2944
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2149
2947
|
function synthetixAssignExchangeDelegate(_x) {
|
|
2150
2948
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
|
2151
2949
|
}
|
|
2152
2950
|
|
|
2153
2951
|
function _synthetixAssignExchangeDelegate() {
|
|
2154
2952
|
_synthetixAssignExchangeDelegate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
2155
|
-
var comptrollerProxy,
|
|
2953
|
+
var comptrollerProxy, synthetixDelegateApprovals, fundOwner, delegate;
|
|
2156
2954
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2157
2955
|
while (1) {
|
|
2158
2956
|
switch (_context.prev = _context.next) {
|
|
2159
2957
|
case 0:
|
|
2160
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
|
2958
|
+
comptrollerProxy = _ref.comptrollerProxy, synthetixDelegateApprovals = _ref.synthetixDelegateApprovals, fundOwner = _ref.fundOwner, delegate = _ref.delegate;
|
|
2161
2959
|
_context.next = 3;
|
|
2162
|
-
return
|
|
2163
|
-
addressResolver: addressResolver,
|
|
2164
|
-
name: 'DelegateApprovals'
|
|
2165
|
-
});
|
|
2960
|
+
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(synthetixDelegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
|
2166
2961
|
|
|
2167
2962
|
case 3:
|
|
2168
|
-
delegateApprovals = _context.sent;
|
|
2169
|
-
_context.next = 6;
|
|
2170
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
|
2171
|
-
|
|
2172
|
-
case 6:
|
|
2173
2963
|
case "end":
|
|
2174
2964
|
return _context.stop();
|
|
2175
2965
|
}
|
|
@@ -2179,28 +2969,36 @@ function _synthetixAssignExchangeDelegate() {
|
|
|
2179
2969
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
|
2180
2970
|
}
|
|
2181
2971
|
|
|
2182
|
-
function
|
|
2183
|
-
return
|
|
2972
|
+
function synthetixRedeem(_x2) {
|
|
2973
|
+
return _synthetixRedeem.apply(this, arguments);
|
|
2184
2974
|
}
|
|
2185
2975
|
|
|
2186
|
-
function
|
|
2187
|
-
|
|
2188
|
-
var
|
|
2976
|
+
function _synthetixRedeem() {
|
|
2977
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
2978
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
|
2189
2979
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2190
2980
|
while (1) {
|
|
2191
2981
|
switch (_context2.prev = _context2.next) {
|
|
2192
2982
|
case 0:
|
|
2193
|
-
|
|
2194
|
-
|
|
2983
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, synthetixAdapter = _ref2.synthetixAdapter, synths = _ref2.synths;
|
|
2984
|
+
redeemArgs = synthetixRedeemArgs({
|
|
2985
|
+
synths: synths
|
|
2986
|
+
});
|
|
2987
|
+
callArgs = callOnIntegrationArgs({
|
|
2988
|
+
adapter: synthetixAdapter,
|
|
2989
|
+
encodedCallArgs: redeemArgs,
|
|
2990
|
+
selector: redeemSelector
|
|
2991
|
+
});
|
|
2992
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2195
2993
|
|
|
2196
|
-
case
|
|
2994
|
+
case 4:
|
|
2197
2995
|
case "end":
|
|
2198
2996
|
return _context2.stop();
|
|
2199
2997
|
}
|
|
2200
2998
|
}
|
|
2201
2999
|
}, _callee2);
|
|
2202
3000
|
}));
|
|
2203
|
-
return
|
|
3001
|
+
return _synthetixRedeem.apply(this, arguments);
|
|
2204
3002
|
}
|
|
2205
3003
|
|
|
2206
3004
|
function synthetixTakeOrder(_x3) {
|
|
@@ -2209,13 +3007,13 @@ function synthetixTakeOrder(_x3) {
|
|
|
2209
3007
|
|
|
2210
3008
|
function _synthetixTakeOrder() {
|
|
2211
3009
|
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
2212
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount,
|
|
3010
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount, _ref3$minIncomingSusd, minIncomingSusdAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
2213
3011
|
|
|
2214
3012
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2215
3013
|
while (1) {
|
|
2216
3014
|
switch (_context3.prev = _context3.next) {
|
|
2217
3015
|
case 0:
|
|
2218
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref3$outgoingAssetAm,
|
|
3016
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref3$outgoingAssetAm, _ref3$minIncomingSusd = _ref3.minIncomingSusdAmount, minIncomingSusdAmount = _ref3$minIncomingSusd === void 0 ? utils.parseEther('1') : _ref3$minIncomingSusd, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
|
2219
3017
|
|
|
2220
3018
|
if (!seedFund) {
|
|
2221
3019
|
_context3.next = 4;
|
|
@@ -2227,16 +3025,15 @@ function _synthetixTakeOrder() {
|
|
|
2227
3025
|
|
|
2228
3026
|
case 4:
|
|
2229
3027
|
takeOrderArgs = synthetixTakeOrderArgs({
|
|
2230
|
-
|
|
2231
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
3028
|
+
minIncomingSusdAmount: minIncomingSusdAmount,
|
|
2232
3029
|
outgoingAsset: outgoingAsset,
|
|
2233
3030
|
outgoingAssetAmount: outgoingAssetAmount
|
|
2234
3031
|
});
|
|
2235
3032
|
_context3.next = 7;
|
|
2236
3033
|
return callOnIntegrationArgs({
|
|
2237
3034
|
adapter: synthetixAdapter,
|
|
2238
|
-
|
|
2239
|
-
|
|
3035
|
+
encodedCallArgs: takeOrderArgs,
|
|
3036
|
+
selector: takeOrderSelector
|
|
2240
3037
|
});
|
|
2241
3038
|
|
|
2242
3039
|
case 7:
|
|
@@ -2283,18 +3080,18 @@ function _uniswapV2Lend() {
|
|
|
2283
3080
|
|
|
2284
3081
|
case 6:
|
|
2285
3082
|
lendArgs = uniswapV2LendArgs({
|
|
2286
|
-
tokenA: tokenA,
|
|
2287
|
-
tokenB: tokenB,
|
|
2288
3083
|
amountADesired: amountADesired,
|
|
2289
|
-
amountBDesired: amountBDesired,
|
|
2290
3084
|
amountAMin: amountAMin,
|
|
3085
|
+
amountBDesired: amountBDesired,
|
|
2291
3086
|
amountBMin: amountBMin,
|
|
2292
|
-
minPoolTokenAmount: minPoolTokenAmount
|
|
3087
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
|
3088
|
+
tokenA: tokenA,
|
|
3089
|
+
tokenB: tokenB
|
|
2293
3090
|
});
|
|
2294
3091
|
callArgs = callOnIntegrationArgs({
|
|
2295
3092
|
adapter: uniswapV2LiquidityAdapter,
|
|
2296
|
-
|
|
2297
|
-
|
|
3093
|
+
encodedCallArgs: lendArgs,
|
|
3094
|
+
selector: lendSelector
|
|
2298
3095
|
});
|
|
2299
3096
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2300
3097
|
_context.next = 11;
|
|
@@ -2326,16 +3123,16 @@ function _uniswapV2Redeem() {
|
|
|
2326
3123
|
case 0:
|
|
2327
3124
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, uniswapV2LiquidityAdapter = _ref2.uniswapV2LiquidityAdapter, poolTokenAmount = _ref2.poolTokenAmount, tokenA = _ref2.tokenA, tokenB = _ref2.tokenB, amountAMin = _ref2.amountAMin, amountBMin = _ref2.amountBMin;
|
|
2328
3125
|
redeemArgs = uniswapV2RedeemArgs({
|
|
3126
|
+
amountAMin: amountAMin,
|
|
3127
|
+
amountBMin: amountBMin,
|
|
2329
3128
|
poolTokenAmount: poolTokenAmount,
|
|
2330
3129
|
tokenA: tokenA,
|
|
2331
|
-
tokenB: tokenB
|
|
2332
|
-
amountAMin: amountAMin,
|
|
2333
|
-
amountBMin: amountBMin
|
|
3130
|
+
tokenB: tokenB
|
|
2334
3131
|
});
|
|
2335
3132
|
callArgs = callOnIntegrationArgs({
|
|
2336
3133
|
adapter: uniswapV2LiquidityAdapter,
|
|
2337
|
-
|
|
2338
|
-
|
|
3134
|
+
encodedCallArgs: redeemArgs,
|
|
3135
|
+
selector: redeemSelector
|
|
2339
3136
|
});
|
|
2340
3137
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2341
3138
|
_context2.next = 6;
|
|
@@ -2378,14 +3175,14 @@ function _uniswapV2TakeOrder() {
|
|
|
2378
3175
|
|
|
2379
3176
|
case 4:
|
|
2380
3177
|
takeOrderArgs = uniswapV2TakeOrderArgs({
|
|
2381
|
-
|
|
3178
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2382
3179
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
2383
|
-
|
|
3180
|
+
path: path
|
|
2384
3181
|
});
|
|
2385
3182
|
callArgs = callOnIntegrationArgs({
|
|
2386
3183
|
adapter: uniswapV2ExchangeAdapter,
|
|
2387
|
-
|
|
2388
|
-
|
|
3184
|
+
encodedCallArgs: takeOrderArgs,
|
|
3185
|
+
selector: takeOrderSelector
|
|
2389
3186
|
});
|
|
2390
3187
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2391
3188
|
|
|
@@ -2405,7 +3202,7 @@ function uniswapV3TakeOrder(_x) {
|
|
|
2405
3202
|
|
|
2406
3203
|
function _uniswapV3TakeOrder() {
|
|
2407
3204
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
2408
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
3205
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
|
2409
3206
|
|
|
2410
3207
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2411
3208
|
while (1) {
|
|
@@ -2414,35 +3211,33 @@ function _uniswapV3TakeOrder() {
|
|
|
2414
3211
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV3Adapter = _ref.uniswapV3Adapter, pathAddresses = _ref.pathAddresses, pathFees = _ref.pathFees, outgoingAssetAmount = _ref.outgoingAssetAmount, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? 1 : _ref$minIncomingAsset, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
|
2415
3212
|
|
|
2416
3213
|
if (!seedFund) {
|
|
2417
|
-
_context.next =
|
|
3214
|
+
_context.next = 7;
|
|
2418
3215
|
break;
|
|
2419
3216
|
}
|
|
2420
3217
|
|
|
2421
|
-
_context.
|
|
2422
|
-
_context.next = 5;
|
|
3218
|
+
_context.next = 4;
|
|
2423
3219
|
return comptrollerProxy.getVaultProxy();
|
|
2424
3220
|
|
|
2425
|
-
case
|
|
2426
|
-
|
|
2427
|
-
_context.
|
|
2428
|
-
|
|
2429
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
|
3221
|
+
case 4:
|
|
3222
|
+
vaultProxy = _context.sent;
|
|
3223
|
+
_context.next = 7;
|
|
3224
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
|
2430
3225
|
|
|
2431
|
-
case
|
|
3226
|
+
case 7:
|
|
2432
3227
|
takeOrderArgs = uniswapV3TakeOrderArgs({
|
|
2433
|
-
|
|
2434
|
-
pathFees: pathFees,
|
|
3228
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2435
3229
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
2436
|
-
|
|
3230
|
+
pathAddresses: pathAddresses,
|
|
3231
|
+
pathFees: pathFees
|
|
2437
3232
|
});
|
|
2438
3233
|
callArgs = callOnIntegrationArgs({
|
|
2439
3234
|
adapter: uniswapV3Adapter,
|
|
2440
|
-
|
|
2441
|
-
|
|
3235
|
+
encodedCallArgs: takeOrderArgs,
|
|
3236
|
+
selector: takeOrderSelector
|
|
2442
3237
|
});
|
|
2443
3238
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2444
3239
|
|
|
2445
|
-
case
|
|
3240
|
+
case 10:
|
|
2446
3241
|
case "end":
|
|
2447
3242
|
return _context.stop();
|
|
2448
3243
|
}
|
|
@@ -2467,12 +3262,12 @@ function _yearnVaultV2Lend() {
|
|
|
2467
3262
|
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, yearnVaultV2Adapter = _ref.yearnVaultV2Adapter, yVault = _ref.yVault, outgoingUnderlyingAmount = _ref.outgoingUnderlyingAmount, _ref$minIncomingYVaul = _ref.minIncomingYVaultSharesAmount, minIncomingYVaultSharesAmount = _ref$minIncomingYVaul === void 0 ? BigNumber.from(1) : _ref$minIncomingYVaul;
|
|
2468
3263
|
callArgs = callOnIntegrationArgs({
|
|
2469
3264
|
adapter: yearnVaultV2Adapter,
|
|
2470
|
-
selector: lendSelector,
|
|
2471
3265
|
encodedCallArgs: yearnVaultV2LendArgs({
|
|
2472
|
-
|
|
3266
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
|
2473
3267
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
|
2474
|
-
|
|
2475
|
-
})
|
|
3268
|
+
yVault: yVault
|
|
3269
|
+
}),
|
|
3270
|
+
selector: lendSelector
|
|
2476
3271
|
});
|
|
2477
3272
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2478
3273
|
|
|
@@ -2501,13 +3296,13 @@ function _yearnVaultV2Redeem() {
|
|
|
2501
3296
|
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, yearnVaultV2Adapter = _ref2.yearnVaultV2Adapter, yVault = _ref2.yVault, maxOutgoingYVaultSharesAmount = _ref2.maxOutgoingYVaultSharesAmount, _ref2$minIncomingUnde = _ref2.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref2$minIncomingUnde === void 0 ? BigNumber.from(1) : _ref2$minIncomingUnde, _ref2$slippageToleran = _ref2.slippageToleranceBps, slippageToleranceBps = _ref2$slippageToleran === void 0 ? 1 : _ref2$slippageToleran;
|
|
2502
3297
|
callArgs = callOnIntegrationArgs({
|
|
2503
3298
|
adapter: yearnVaultV2Adapter,
|
|
2504
|
-
selector: redeemSelector,
|
|
2505
3299
|
encodedCallArgs: yearnVaultV2RedeemArgs({
|
|
2506
|
-
yVault: yVault,
|
|
2507
3300
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
|
2508
3301
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
|
2509
|
-
slippageToleranceBps: slippageToleranceBps
|
|
2510
|
-
|
|
3302
|
+
slippageToleranceBps: slippageToleranceBps,
|
|
3303
|
+
yVault: yVault
|
|
3304
|
+
}),
|
|
3305
|
+
selector: redeemSelector
|
|
2511
3306
|
});
|
|
2512
3307
|
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2513
3308
|
|
|
@@ -2539,8 +3334,8 @@ function _zeroExV2TakeOrder() {
|
|
|
2539
3334
|
});
|
|
2540
3335
|
callArgs = callOnIntegrationArgs({
|
|
2541
3336
|
adapter: zeroExV2Adapter,
|
|
2542
|
-
|
|
2543
|
-
|
|
3337
|
+
encodedCallArgs: takeOrderArgs,
|
|
3338
|
+
selector: takeOrderSelector
|
|
2544
3339
|
});
|
|
2545
3340
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2546
3341
|
|
|
@@ -2683,7 +3478,8 @@ function assertEvent(receipt, event, match) {
|
|
|
2683
3478
|
var events = extractEvent(receipt, event);
|
|
2684
3479
|
expect(events.length).toBe(1);
|
|
2685
3480
|
expect(receipt).toHaveEmittedWith(event, match);
|
|
2686
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
|
3481
|
+
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3482
|
+
|
|
2687
3483
|
return args;
|
|
2688
3484
|
}
|
|
2689
3485
|
function assertNoEvent(receipt, event) {
|
|
@@ -2844,6 +3640,7 @@ function _createComptrollerProxy() {
|
|
|
2844
3640
|
comptrollerProxyContract = _context.sent;
|
|
2845
3641
|
return _context.abrupt("return", {
|
|
2846
3642
|
comptrollerProxy: new ComptrollerLib(comptrollerProxyContract, signer),
|
|
3643
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2847
3644
|
receipt: comptrollerProxyContract.deployment
|
|
2848
3645
|
});
|
|
2849
3646
|
|
|
@@ -2876,14 +3673,14 @@ function _createMigrationRequest() {
|
|
|
2876
3673
|
case 3:
|
|
2877
3674
|
receipt = _context2.sent;
|
|
2878
3675
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2879
|
-
creator: signer,
|
|
2880
3676
|
comptrollerProxy: expect.any(String),
|
|
3677
|
+
creator: signer,
|
|
2881
3678
|
denominationAsset: denominationAsset,
|
|
2882
3679
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
|
2883
3680
|
});
|
|
2884
3681
|
return _context2.abrupt("return", {
|
|
2885
|
-
|
|
2886
|
-
|
|
3682
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
3683
|
+
receipt: receipt
|
|
2887
3684
|
});
|
|
2888
3685
|
|
|
2889
3686
|
case 6:
|
|
@@ -2902,29 +3699,29 @@ function createNewFund(_x3) {
|
|
|
2902
3699
|
|
|
2903
3700
|
function _createNewFund() {
|
|
2904
3701
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
2905
|
-
var signer, fundDeployer, denominationAsset, _ref3$sharesActionTim, sharesActionTimelock, _ref3$fundOwner, fundOwner, _ref3$fundName, fundName, _ref3$feeManagerConfi, feeManagerConfig, _ref3$policyManagerCo, policyManagerConfig, investment, receipt, comptrollerDeployedArgs, comptrollerProxy, newFundDeployedArgs, vaultProxy;
|
|
3702
|
+
var signer, fundDeployer, denominationAsset, _ref3$sharesActionTim, sharesActionTimelock, _ref3$fundOwner, fundOwner, _ref3$fundName, fundName, _ref3$fundSymbol, fundSymbol, _ref3$feeManagerConfi, feeManagerConfig, _ref3$policyManagerCo, policyManagerConfig, investment, receipt, comptrollerDeployedArgs, comptrollerProxy, newFundDeployedArgs, vaultProxy;
|
|
2906
3703
|
|
|
2907
3704
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2908
3705
|
while (1) {
|
|
2909
3706
|
switch (_context3.prev = _context3.next) {
|
|
2910
3707
|
case 0:
|
|
2911
|
-
signer = _ref3.signer, fundDeployer = _ref3.fundDeployer, denominationAsset = _ref3.denominationAsset, _ref3$sharesActionTim = _ref3.sharesActionTimelock, sharesActionTimelock = _ref3$sharesActionTim === void 0 ? 0 : _ref3$sharesActionTim, _ref3$fundOwner = _ref3.fundOwner, fundOwner = _ref3$fundOwner === void 0 ? randomAddress() : _ref3$fundOwner, _ref3$fundName = _ref3.fundName, fundName = _ref3$fundName === void 0 ? 'My Fund' : _ref3$fundName, _ref3$feeManagerConfi = _ref3.feeManagerConfig, feeManagerConfig = _ref3$feeManagerConfi === void 0 ? '0x' : _ref3$feeManagerConfi, _ref3$policyManagerCo = _ref3.policyManagerConfig, policyManagerConfig = _ref3$policyManagerCo === void 0 ? '0x' : _ref3$policyManagerCo, investment = _ref3.investment;
|
|
3708
|
+
signer = _ref3.signer, fundDeployer = _ref3.fundDeployer, denominationAsset = _ref3.denominationAsset, _ref3$sharesActionTim = _ref3.sharesActionTimelock, sharesActionTimelock = _ref3$sharesActionTim === void 0 ? 0 : _ref3$sharesActionTim, _ref3$fundOwner = _ref3.fundOwner, fundOwner = _ref3$fundOwner === void 0 ? randomAddress() : _ref3$fundOwner, _ref3$fundName = _ref3.fundName, fundName = _ref3$fundName === void 0 ? 'My Fund' : _ref3$fundName, _ref3$fundSymbol = _ref3.fundSymbol, fundSymbol = _ref3$fundSymbol === void 0 ? '' : _ref3$fundSymbol, _ref3$feeManagerConfi = _ref3.feeManagerConfig, feeManagerConfig = _ref3$feeManagerConfi === void 0 ? '0x' : _ref3$feeManagerConfi, _ref3$policyManagerCo = _ref3.policyManagerConfig, policyManagerConfig = _ref3$policyManagerCo === void 0 ? '0x' : _ref3$policyManagerCo, investment = _ref3.investment;
|
|
2912
3709
|
_context3.next = 3;
|
|
2913
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
|
3710
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
|
2914
3711
|
|
|
2915
3712
|
case 3:
|
|
2916
3713
|
receipt = _context3.sent;
|
|
2917
3714
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2918
|
-
creator: signer,
|
|
2919
3715
|
comptrollerProxy: expect.any(String),
|
|
3716
|
+
creator: signer,
|
|
2920
3717
|
denominationAsset: denominationAsset,
|
|
2921
3718
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
|
2922
3719
|
});
|
|
2923
3720
|
comptrollerProxy = new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
|
2924
3721
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
|
3722
|
+
comptrollerProxy: comptrollerProxy,
|
|
2925
3723
|
creator: signer,
|
|
2926
|
-
vaultProxy: expect.any(String)
|
|
2927
|
-
comptrollerProxy: comptrollerProxy
|
|
3724
|
+
vaultProxy: expect.any(String)
|
|
2928
3725
|
});
|
|
2929
3726
|
vaultProxy = new VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
|
2930
3727
|
|
|
@@ -2975,14 +3772,14 @@ function _createReconfigurationRequest() {
|
|
|
2975
3772
|
case 3:
|
|
2976
3773
|
receipt = _context4.sent;
|
|
2977
3774
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2978
|
-
creator: signer,
|
|
2979
3775
|
comptrollerProxy: expect.any(String),
|
|
3776
|
+
creator: signer,
|
|
2980
3777
|
denominationAsset: denominationAsset,
|
|
2981
3778
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
|
2982
3779
|
});
|
|
2983
3780
|
return _context4.abrupt("return", {
|
|
2984
|
-
|
|
2985
|
-
|
|
3781
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
3782
|
+
receipt: receipt
|
|
2986
3783
|
});
|
|
2987
3784
|
|
|
2988
3785
|
case 6:
|
|
@@ -3064,16 +3861,49 @@ function _setupGasRelayerPaymaster() {
|
|
|
3064
3861
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
|
3065
3862
|
}
|
|
3066
3863
|
|
|
3067
|
-
function
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3864
|
+
function vaultCallCreateNewList(_x) {
|
|
3865
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
|
3866
|
+
}
|
|
3867
|
+
|
|
3868
|
+
function _vaultCallCreateNewList() {
|
|
3869
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
3870
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
|
3871
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3872
|
+
while (1) {
|
|
3873
|
+
switch (_context.prev = _context.next) {
|
|
3874
|
+
case 0:
|
|
3875
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
|
3876
|
+
_context.next = 3;
|
|
3877
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, addressListRegistryCreateListSelector, encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
|
3878
|
+
|
|
3879
|
+
case 3:
|
|
3880
|
+
_context.next = 5;
|
|
3881
|
+
return addressListRegistry.getListCount();
|
|
3882
|
+
|
|
3883
|
+
case 5:
|
|
3884
|
+
listCount = _context.sent;
|
|
3885
|
+
return _context.abrupt("return", listCount.sub(1));
|
|
3886
|
+
|
|
3887
|
+
case 7:
|
|
3888
|
+
case "end":
|
|
3889
|
+
return _context.stop();
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
}, _callee);
|
|
3893
|
+
}));
|
|
3894
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
|
3072
3895
|
}
|
|
3073
|
-
|
|
3896
|
+
|
|
3897
|
+
function vaultCallCurveMinterMint(_ref2) {
|
|
3074
3898
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
|
3075
3899
|
minter = _ref2.minter,
|
|
3076
|
-
|
|
3900
|
+
gauge = _ref2.gauge;
|
|
3901
|
+
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintSelector, encodeArgs(['address'], [gauge]));
|
|
3902
|
+
}
|
|
3903
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
|
3904
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
|
3905
|
+
minter = _ref3.minter,
|
|
3906
|
+
gauges = _ref3.gauges;
|
|
3077
3907
|
var gaugesFormatted = new Array(8).fill(constants.AddressZero);
|
|
3078
3908
|
|
|
3079
3909
|
for (var i in gauges) {
|
|
@@ -3082,16 +3912,16 @@ function vaultCallCurveMinterMintMany(_ref2) {
|
|
|
3082
3912
|
|
|
3083
3913
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintManySelector, encodeArgs(['address[8]'], [gaugesFormatted]));
|
|
3084
3914
|
}
|
|
3085
|
-
function vaultCallCurveMinterToggleApproveMint(
|
|
3086
|
-
var comptrollerProxy =
|
|
3087
|
-
minter =
|
|
3088
|
-
account =
|
|
3915
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
|
3916
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
|
3917
|
+
minter = _ref4.minter,
|
|
3918
|
+
account = _ref4.account;
|
|
3089
3919
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterToggleApproveMintSelector, encodeArgs(['address'], [account]));
|
|
3090
3920
|
}
|
|
3091
|
-
function vaultCallStartAssetBypassTimelock(
|
|
3092
|
-
var comptrollerProxy =
|
|
3093
|
-
contract =
|
|
3094
|
-
asset =
|
|
3921
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
|
3922
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
|
3923
|
+
contract = _ref5.contract,
|
|
3924
|
+
asset = _ref5.asset;
|
|
3095
3925
|
return comptrollerProxy.vaultCallOnContract(contract, sighash(utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), encodeArgs(['address'], [asset]));
|
|
3096
3926
|
}
|
|
3097
3927
|
|
|
@@ -3147,8 +3977,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
|
3147
3977
|
// 50% discount
|
|
3148
3978
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
|
3149
3979
|
return _context2.abrupt("return", {
|
|
3150
|
-
|
|
3151
|
-
|
|
3980
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
|
3981
|
+
mlnValue: mlnValueOfBuyback
|
|
3152
3982
|
});
|
|
3153
3983
|
|
|
3154
3984
|
case 8:
|
|
@@ -3164,43 +3994,60 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
|
3164
3994
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3165
3995
|
|
|
3166
3996
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3997
|
+
|
|
3998
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
3167
3999
|
var whales = {
|
|
3168
|
-
|
|
3169
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
|
3170
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
4000
|
+
// primitives
|
|
3171
4001
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
|
3172
4002
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
3173
|
-
bnt: '
|
|
3174
|
-
|
|
4003
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
|
4004
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
4005
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
|
3175
4006
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
|
3176
|
-
dai: '
|
|
3177
|
-
knc: '
|
|
4007
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
4008
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
|
3178
4009
|
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
|
3179
4010
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
|
3180
4011
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
|
3181
4012
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
|
4013
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
|
3182
4014
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
|
3183
4015
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
4016
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
|
4017
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
|
3184
4018
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
|
3185
4019
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
|
3186
4020
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
|
3187
4021
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
|
3188
4022
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
|
3189
|
-
|
|
4023
|
+
// aTokens
|
|
4024
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
4025
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
|
4026
|
+
// cTokens
|
|
3190
4027
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
|
3191
|
-
cdai: '
|
|
4028
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
|
3192
4029
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
4030
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
|
4031
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
|
4032
|
+
// fTokens
|
|
4033
|
+
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
|
4034
|
+
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
|
4035
|
+
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
|
4036
|
+
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
|
4037
|
+
// ptTokens
|
|
4038
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
|
4039
|
+
// synths (unsupported)
|
|
3197
4040
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
|
3198
|
-
|
|
3199
|
-
|
|
4041
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
|
4042
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
|
4043
|
+
// misc
|
|
3200
4044
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
|
3201
|
-
|
|
3202
|
-
|
|
4045
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
|
4046
|
+
// Curve steth pool related
|
|
4047
|
+
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663'
|
|
3203
4048
|
};
|
|
4049
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
4050
|
+
|
|
3204
4051
|
function unlockWhale(_x) {
|
|
3205
4052
|
return _unlockWhale.apply(this, arguments);
|
|
3206
4053
|
}
|
|
@@ -3372,8 +4219,8 @@ function _relayTransaction() {
|
|
|
3372
4219
|
defaultMaxAcceptance = BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
|
3373
4220
|
|
|
3374
4221
|
mergedRelayRequest = {
|
|
3375
|
-
|
|
3376
|
-
|
|
4222
|
+
relayData: relayData,
|
|
4223
|
+
request: relayRequest
|
|
3377
4224
|
};
|
|
3378
4225
|
relayHub = new IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
|
3379
4226
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
|
@@ -3392,14 +4239,14 @@ var relayed = utils.EventFragment.fromString('TransactionRelayed(address indexed
|
|
|
3392
4239
|
var rejected = utils.EventFragment.fromString('TransactionRejectedByPaymaster(address indexed relayManager, address indexed paymaster, address indexed from, address to, address relayWorker, bytes4 selector, uint256 innerGasUsed, bytes reason)');
|
|
3393
4240
|
function assertDidRelay(receipt) {
|
|
3394
4241
|
return assertEvent(receipt, relayed, {
|
|
3395
|
-
|
|
3396
|
-
relayWorker: expect.any(String),
|
|
4242
|
+
charge: expect.anything(),
|
|
3397
4243
|
from: expect.any(String),
|
|
3398
|
-
to: expect.any(String),
|
|
3399
4244
|
paymaster: expect.any(String),
|
|
4245
|
+
relayManager: expect.any(String),
|
|
4246
|
+
relayWorker: expect.any(String),
|
|
3400
4247
|
selector: expect.any(String),
|
|
3401
4248
|
status: expect.anything(),
|
|
3402
|
-
|
|
4249
|
+
to: expect.any(String)
|
|
3403
4250
|
});
|
|
3404
4251
|
}
|
|
3405
4252
|
function assertDidRelaySuccessfully(receipt) {
|
|
@@ -3416,14 +4263,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
|
3416
4263
|
}
|
|
3417
4264
|
function assertPaymasterDidReject(receipt) {
|
|
3418
4265
|
return assertEvent(receipt, rejected, {
|
|
3419
|
-
relayManager: expect.any(String),
|
|
3420
|
-
paymaster: expect.any(String),
|
|
3421
4266
|
from: expect.any(String),
|
|
3422
|
-
|
|
4267
|
+
innerGasUsed: expect.anything(),
|
|
4268
|
+
paymaster: expect.any(String),
|
|
4269
|
+
reason: expect.any(String),
|
|
4270
|
+
relayManager: expect.any(String),
|
|
3423
4271
|
relayWorker: expect.any(String),
|
|
3424
4272
|
selector: expect.any(String),
|
|
3425
|
-
|
|
3426
|
-
reason: expect.any(String)
|
|
4273
|
+
to: expect.any(String)
|
|
3427
4274
|
});
|
|
3428
4275
|
}
|
|
3429
4276
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
@@ -3431,4 +4278,4 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
|
3431
4278
|
expect(utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
|
3432
4279
|
}
|
|
3433
4280
|
|
|
3434
|
-
export { CurveLiquidityGaugeV2, CurveMinter, CurveSwaps, ICompoundComptroller, UniswapV2Factory, aaveLend, aaveRedeem, addNewAssetsToFund, addTrackedAssetsToVault, assertDidRelay, assertDidRelaySuccessfully, assertDidRelayWithCharge, assertDidRelayWithError, assertEvent, assertNoEvent, assertPaymasterDidReject, assertPaymasterDidRejectForReason, buyShares, buySharesFunction, calcMlnValueAndBurnAmountForSharesBuyback, callOnExtension, callOnExternalPosition, compoundDebtPositionAddCollateral, compoundDebtPositionBorrow, compoundDebtPositionClaimComp, compoundDebtPositionRemoveCollateral, compoundDebtPositionRepayBorrow, compoundLend, compoundRedeem, createCompoundDebtPosition, createComptrollerProxy, createExternalPosition, createFundDeployer, createMigrationRequest, createMockExternalPosition, createNewFund, createReconfigurationRequest, createVaultProxy, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem,
|
|
4281
|
+
export { CurveLiquidityGaugeV2, CurveMinter, CurveRegistry, CurveSwaps, ICompoundComptroller, IUniswapV3NonFungibleTokenManager, UniswapV2Factory, UniswapV3FeeAmount, aaveLend, aaveRedeem, addNewAssetsToFund, addTrackedAssetsToVault, assertCompoundLend, assertCompoundRedeem, assertDidRelay, assertDidRelaySuccessfully, assertDidRelayWithCharge, assertDidRelayWithError, assertEvent, assertNoEvent, assertPaymasterDidReject, assertPaymasterDidRejectForReason, buyShares, buySharesFunction, calcMlnValueAndBurnAmountForSharesBuyback, callOnExtension, callOnExternalPosition, compoundClaim, compoundDebtPositionAddCollateral, compoundDebtPositionBorrow, compoundDebtPositionClaimComp, compoundDebtPositionRemoveCollateral, compoundDebtPositionRepayBorrow, compoundLend, compoundRedeem, createCompoundDebtPosition, createComptrollerProxy, createExternalPosition, createFundDeployer, createMigrationRequest, createMockExternalPosition, createNewFund, createReconfigurationRequest, createUniswapV3LiquidityPosition, createVaultProxy, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem, curveClaimRewards, curveLend, curveLendAndStake, curveRedeem, curveSethClaimRewards, curveSethLend, curveSethLendAndStake, curveSethRedeem, curveSethStake, curveSethUnstake, curveSethUnstakeAndRedeem, curveStake, curveStethClaimRewards, curveStethLend, curveStethLendAndStake, curveStethRedeem, curveStethStake, curveStethUnstake, curveStethUnstakeAndRedeem, curveTakeOrder, curveUnstake, curveUnstakeAndRedeem, deployProtocolFixture, generateFeeManagerConfigWithMockFees, generateMockFees, generateMockPolicies, generatePolicyManagerConfigWithMockPolicies, getAssetBalances, getAssetUnit, getNamedSigner, getUnnamedSigners, idleClaimRewards, idleLend, idleRedeem, mockExternalPositionAddDebtAssets, mockExternalPositionAddManagedAssets, mockExternalPositionRemoveDebtAssets, mockExternalPositionRemoveManagedAssets, mockGenericRemoveOnlySelector, mockGenericSwap, mockGenericSwapASelector, mockGenericSwapArgs, mockGenericSwapBSelector, mockGenericSwapDirectFromVaultSelector, mockGenericSwapViaApprovalSelector, olympusV2Stake, olympusV2Unstake, paraSwapV4GenerateDummyPaths, paraSwapV4TakeOrder, paraSwapV5GenerateDummyPaths, paraSwapV5TakeOrder, poolTogetherV4ClaimRewards, poolTogetherV4Lend, poolTogetherV4Redeem, reactivateExternalPosition, redeemSharesForSpecificAssets, redeemSharesInKind, relayTransaction, removeExternalPosition, removeTrackedAssetsFromVault, setupGasRelayerPaymaster, synthetixAssignExchangeDelegate, synthetixRedeem, synthetixTakeOrder, transactionTimestamp, uniswapV2Lend, uniswapV2Redeem, uniswapV2TakeOrder, uniswapV3LiquidityPositionAddLiquidity, uniswapV3LiquidityPositionCollect, uniswapV3LiquidityPositionGetMaxTick, uniswapV3LiquidityPositionGetMinTick, uniswapV3LiquidityPositionMint, uniswapV3LiquidityPositionPurge, uniswapV3LiquidityPositionRemoveLiquidity, uniswapV3OrderTokenPair, uniswapV3TakeOrder, unlockAllWhales, unlockWhale, unlockWhales, updateChainlinkAggregator, vaultCallCreateNewList, vaultCallCurveMinterMint, vaultCallCurveMinterMintMany, vaultCallCurveMinterToggleApproveMint, vaultCallStartAssetBypassTimelock, yearnVaultV2Lend, yearnVaultV2Redeem, zeroExV2TakeOrder };
|