@enzymefinance/testutils 4.0.0-next.1 → 4.0.0-next.6
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/dist/declarations/src/assertions.d.ts +2 -2
- package/dist/declarations/src/deployment.d.ts +168 -64
- 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 +3 -3
- 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 -3
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +14 -5
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +22 -22
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +40 -7
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +99 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +1 -1
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +4 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +108 -33
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +3 -3
- 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 +11 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +10 -10
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +1 -1
- 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 +15 -6
- package/dist/declarations/src/whales.d.ts +20 -18
- package/dist/enzymefinance-testutils.browser.cjs.js +1783 -763
- package/dist/enzymefinance-testutils.browser.esm.js +1746 -757
- package/dist/enzymefinance-testutils.cjs.dev.js +1783 -763
- package/dist/enzymefinance-testutils.cjs.prod.js +1783 -763
- package/dist/enzymefinance-testutils.esm.js +1746 -757
- package/package.json +5 -5
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +215 -111
- 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 +30 -12
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +33 -6
- package/src/scaffolding/extensions/external-positions/compound.ts +76 -96
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +132 -10
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +290 -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 +10 -11
- package/src/scaffolding/extensions/integrations/curve.ts +333 -68
- 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 -12
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +31 -27
- 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/whales.ts +30 -17
- package/tsconfig.json +2 -1
@@ -1,9 +1,8 @@
|
|
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, AssetFinalityResolver, CompoundAdapter, CompoundDebtPositionLib, CompoundDebtPositionParser, CompoundPriceFeed, ComptrollerLib, CumulativeSlippageTolerancePolicy, CurveExchangeAdapter, CurveLiquidityAaveAdapter, CurveLiquidityAdapter, CurveLiquidityEursAdapter, CurveLiquiditySethAdapter, CurveLiquidityStethAdapter, CurvePriceFeed, DepositWrapper, Dispatcher, EntranceRateBurnFee, EntranceRateDirectFee, ExitRateBurnFee, ExitRateDirectFee, ExternalPositionFactory, ExternalPositionManager, FeeManager, FundDeployer, FundValueCalculator, FundValueCalculatorRouter, FundValueCalculatorUsdWrapper, GasRelayPaymasterFactory, GuaranteedRedemptionPolicy, IdleAdapter, IdlePriceFeed, IntegrationManager, LidoStethPriceFeed, ManagementFee, MinAssetBalancesPostRedemptionPolicy, MinMaxInvestmentPolicy, OlympusV2Adapter, OnlyRemoveDustExternalPositionPolicy, OnlyUntrackDustOrPricelessAssetsPolicy, ParaSwapV4Adapter, ParaSwapV5Adapter, PerformanceFee, PolicyManager, PoolTogetherV4Adapter, PoolTogetherV4PriceFeed, ProtocolFeeReserveLib, ProtocolFeeTracker, RevertingPriceFeed, StakehoundEthPriceFeed, SynthetixAdapter, SynthetixPriceFeed, 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, uniswapV3LiquidityPositionInitArgs, uniswapV3LiquidityPositionAddLiquidityArgs, UniswapV3LiquidityPositionActionId, uniswapV3LiquidityPositionCollectArgs, UniswapV3LiquidityPositionLib, uniswapV3LiquidityPositionMintArgs, uniswapV3LiquidityPositionPurgeArgs, uniswapV3LiquidityPositionRemoveLiquidityArgs, feeManagerConfigArgs, FeeSettlementType, FeeHook, IFee, aaveLendArgs, callOnIntegrationArgs, lendSelector, aaveRedeemArgs, redeemSelector, compoundArgs, curveTakeOrderArgs, takeOrderSelector, curveClaimRewardsArgs, claimRewardsSelector, curveLendArgs, curveLendAndStakeArgs, lendAndStakeSelector, curveRedeemArgs, curveStakeArgs, stakeSelector, curveUnstakeArgs, unstakeSelector, curveUnstakeAndRedeemArgs, unstakeAndRedeemSelector, curveAaveLendArgs, curveAaveLendAndStakeArgs, curveAaveRedeemArgs, curveAaveStakeArgs, curveAaveUnstakeAndRedeemArgs, curveAaveUnstakeArgs, curveEursLendArgs, curveEursLendAndStakeArgs, curveEursRedeemArgs, curveEursStakeArgs, curveEursUnstakeAndRedeemArgs, curveEursUnstakeArgs, 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 } from '@enzymefinance/protocol/src';
|
7
6
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
8
7
|
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
9
8
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
@@ -104,74 +103,83 @@ function _deployProtocolFixture() {
|
|
104
103
|
config = fixture['Config'].linkedData; // prettier-ignore
|
105
104
|
|
106
105
|
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),
|
106
|
+
aaveAdapter: new AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
111
107
|
aavePriceFeed: new AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
108
|
+
addressListRegistry: new AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
109
|
+
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
110
|
+
allowedAdaptersPolicy: new AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
111
|
+
allowedAssetsForRedemptionPolicy: new AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
112
|
+
allowedDepositRecipientsPolicy: new AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
113
|
+
allowedExternalPositionTypesPolicy: new AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
114
|
+
allowedSharesTransferRecipientsPolicy: new AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
115
|
+
assetFinalityResolver: new AssetFinalityResolver(fixture['AssetFinalityResolver'].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
|
-
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
119
|
-
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
120
|
-
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
121
|
-
wdgldPriceFeed: new WdgldPriceFeed(fixture['WdgldPriceFeed'].address, deployer),
|
122
|
-
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
123
|
-
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
124
|
-
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
125
|
-
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
126
|
-
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
127
|
-
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
120
|
+
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
121
|
+
cumulativeSlippageTolerancePolicy: new CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
122
|
+
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
128
123
|
curveLiquidityAaveAdapter: new CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
124
|
+
curveLiquidityAdapter: new CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
129
125
|
curveLiquidityEursAdapter: new CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
130
126
|
curveLiquiditySethAdapter: new CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
131
127
|
curveLiquidityStethAdapter: new CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
136
|
-
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
137
|
-
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer),
|
138
|
-
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
139
|
-
uniswapV2Adapter: new UniswapV2Adapter(fixture['UniswapV2Adapter'].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),
|
128
|
+
curvePriceFeed: new CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
129
|
+
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
130
|
+
dispatcher: new Dispatcher(fixture['Dispatcher'].address, deployer),
|
144
131
|
entranceRateBurnFee: new EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
145
132
|
entranceRateDirectFee: new EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
146
133
|
exitRateBurnFee: new ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
147
134
|
exitRateDirectFee: new ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
135
|
+
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
136
|
+
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
137
|
+
feeManager: new FeeManager(fixture['FeeManager'].address, deployer),
|
138
|
+
fundDeployer: new FundDeployer(fixture['FundDeployer'].address, deployer),
|
139
|
+
fundValueCalculator: new FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
140
|
+
fundValueCalculatorRouter: new FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
141
|
+
fundValueCalculatorUsdWrapper: new FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
142
|
+
gasRelayPaymasterFactory: new GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
143
|
+
guaranteedRedemptionPolicy: new GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
144
|
+
idleAdapter: new IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
145
|
+
idlePriceFeed: new IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
146
|
+
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
147
|
+
lidoStethPriceFeed: new LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
148
148
|
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),
|
149
|
+
minAssetBalancesPostRedemptionPolicy: new MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
153
150
|
minMaxInvestmentPolicy: new MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
151
|
+
olympusV2Adapter: new OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
152
|
+
onlyRemoveDustExternalPositionPolicy: new OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
153
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
154
|
+
paraSwapV4Adapter: new ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
155
|
+
paraSwapV5Adapter: new ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
156
|
+
performanceFee: new PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
157
|
+
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
158
|
+
poolTogetherV4Adapter: new PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
159
|
+
poolTogetherV4PriceFeed: new PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
159
160
|
protocolFeeReserveLib: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
160
161
|
protocolFeeReserveProxy: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
161
162
|
protocolFeeTracker: new ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
163
|
+
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
164
|
+
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
165
|
+
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
166
|
+
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
167
|
+
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
168
|
+
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
169
|
+
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
170
|
+
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
171
|
+
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
172
|
+
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
173
|
+
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
174
|
+
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
175
|
+
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
176
|
+
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
169
177
|
};
|
170
178
|
return _context3.abrupt("return", {
|
171
|
-
deployer: deployer,
|
172
|
-
deployment: deployment,
|
173
179
|
accounts: accounts,
|
174
|
-
config: config
|
180
|
+
config: config,
|
181
|
+
deployer: deployer,
|
182
|
+
deployment: deployment
|
175
183
|
});
|
176
184
|
|
177
185
|
case 12:
|
@@ -184,30 +192,6 @@ function _deployProtocolFixture() {
|
|
184
192
|
return _deployProtocolFixture.apply(this, arguments);
|
185
193
|
}
|
186
194
|
|
187
|
-
// TODO: Remove this.
|
188
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
189
|
-
function defaultTestDeployment(_x2) {
|
190
|
-
return _defaultTestDeployment.apply(this, arguments);
|
191
|
-
}
|
192
|
-
|
193
|
-
function _defaultTestDeployment() {
|
194
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_) {
|
195
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
196
|
-
while (1) {
|
197
|
-
switch (_context4.prev = _context4.next) {
|
198
|
-
case 0:
|
199
|
-
throw new Error('Removed');
|
200
|
-
|
201
|
-
case 1:
|
202
|
-
case "end":
|
203
|
-
return _context4.stop();
|
204
|
-
}
|
205
|
-
}
|
206
|
-
}, _callee4);
|
207
|
-
}));
|
208
|
-
return _defaultTestDeployment.apply(this, arguments);
|
209
|
-
}
|
210
|
-
|
211
195
|
function addTrackedAssetsToVault(_ref) {
|
212
196
|
var signer = _ref.signer,
|
213
197
|
comptrollerProxy = _ref.comptrollerProxy,
|
@@ -240,12 +224,12 @@ function _addNewAssetsToFund() {
|
|
240
224
|
switch (_context.prev = _context.next) {
|
241
225
|
case 0:
|
242
226
|
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;
|
243
|
-
// First, add tracked assets
|
227
|
+
// First, add tracked assets
|
244
228
|
receipt = addTrackedAssetsToVault({
|
245
|
-
|
229
|
+
assets: assets,
|
246
230
|
comptrollerProxy: comptrollerProxy,
|
247
231
|
integrationManager: integrationManager,
|
248
|
-
|
232
|
+
signer: signer
|
249
233
|
}); // Then seed the vault with balances as necessary
|
250
234
|
|
251
235
|
_context.next = 4;
|
@@ -397,13 +381,13 @@ function createFundDeployer(_x) {
|
|
397
381
|
|
398
382
|
function _createFundDeployer() {
|
399
383
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
400
|
-
var deployer, assetFinalityResolver, externalPositionManager, dispatcher,
|
384
|
+
var deployer, assetFinalityResolver, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
401
385
|
|
402
386
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
403
387
|
while (1) {
|
404
388
|
switch (_context.prev = _context.next) {
|
405
389
|
case 0:
|
406
|
-
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher,
|
390
|
+
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, 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;
|
407
391
|
_context.next = 3;
|
408
392
|
return vaultLib.getMlnToken();
|
409
393
|
|
@@ -425,77 +409,116 @@ function _createFundDeployer() {
|
|
425
409
|
case 12:
|
426
410
|
nextFundDeployer = _context.sent;
|
427
411
|
_context.next = 15;
|
428
|
-
return
|
412
|
+
return PolicyManager.deploy(deployer, nextFundDeployer, gasRelayPaymasterFactory);
|
429
413
|
|
430
414
|
case 15:
|
415
|
+
nextPolicyManager = _context.sent;
|
416
|
+
_context.t0 = ExternalPositionManager;
|
417
|
+
_context.t1 = deployer;
|
418
|
+
_context.t2 = nextFundDeployer;
|
419
|
+
_context.next = 21;
|
420
|
+
return externalPositionManager.getExternalPositionFactory();
|
421
|
+
|
422
|
+
case 21:
|
423
|
+
_context.t3 = _context.sent;
|
424
|
+
_context.t4 = nextPolicyManager;
|
425
|
+
_context.next = 25;
|
426
|
+
return _context.t0.deploy.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4);
|
427
|
+
|
428
|
+
case 25:
|
429
|
+
nextExternalPositionManager = _context.sent;
|
430
|
+
_context.next = 28;
|
431
|
+
return FeeManager.deploy(deployer, nextFundDeployer);
|
432
|
+
|
433
|
+
case 28:
|
434
|
+
nextFeeManager = _context.sent;
|
435
|
+
_context.next = 31;
|
436
|
+
return IntegrationManager.deploy(deployer, nextFundDeployer, nextPolicyManager, valueInterpreter);
|
437
|
+
|
438
|
+
case 31:
|
439
|
+
nextIntegrationManager = _context.sent;
|
440
|
+
_context.next = 34;
|
441
|
+
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, assetFinalityResolver, gasRelayPaymasterFactory, mlnToken, wethToken);
|
442
|
+
|
443
|
+
case 34:
|
431
444
|
nextComptrollerLib = _context.sent;
|
432
|
-
_context.next =
|
445
|
+
_context.next = 37;
|
433
446
|
return nextFundDeployer.setComptrollerLib(nextComptrollerLib);
|
434
447
|
|
435
|
-
case
|
436
|
-
_context.next =
|
448
|
+
case 37:
|
449
|
+
_context.next = 39;
|
437
450
|
return ProtocolFeeTracker.deploy(deployer, nextFundDeployer);
|
438
451
|
|
439
|
-
case
|
452
|
+
case 39:
|
440
453
|
nextProtocolFeeTracker = _context.sent;
|
441
|
-
_context.next =
|
454
|
+
_context.next = 42;
|
442
455
|
return nextFundDeployer.setProtocolFeeTracker(nextProtocolFeeTracker);
|
443
456
|
|
444
|
-
case
|
445
|
-
_context.
|
446
|
-
_context.
|
447
|
-
_context.
|
448
|
-
_context.next =
|
457
|
+
case 42:
|
458
|
+
_context.t5 = VaultLib;
|
459
|
+
_context.t6 = deployer;
|
460
|
+
_context.t7 = externalPositionManager;
|
461
|
+
_context.next = 47;
|
449
462
|
return vaultLib.getGasRelayPaymasterFactory();
|
450
463
|
|
451
|
-
case
|
452
|
-
_context.
|
453
|
-
_context.next =
|
464
|
+
case 47:
|
465
|
+
_context.t8 = _context.sent;
|
466
|
+
_context.next = 50;
|
454
467
|
return vaultLib.getProtocolFeeReserve();
|
455
468
|
|
456
|
-
case
|
457
|
-
_context.
|
458
|
-
_context.
|
459
|
-
_context.next =
|
469
|
+
case 50:
|
470
|
+
_context.t9 = _context.sent;
|
471
|
+
_context.t10 = nextProtocolFeeTracker;
|
472
|
+
_context.next = 54;
|
460
473
|
return vaultLib.getMlnToken();
|
461
474
|
|
462
|
-
case
|
463
|
-
_context.
|
464
|
-
_context.next =
|
475
|
+
case 54:
|
476
|
+
_context.t11 = _context.sent;
|
477
|
+
_context.next = 57;
|
478
|
+
return vaultLib.getMlnBurner();
|
479
|
+
|
480
|
+
case 57:
|
481
|
+
_context.t12 = _context.sent;
|
482
|
+
_context.next = 60;
|
465
483
|
return vaultLib.getWethToken();
|
466
484
|
|
467
|
-
case
|
468
|
-
_context.
|
469
|
-
_context.next =
|
470
|
-
return
|
485
|
+
case 60:
|
486
|
+
_context.t13 = _context.sent;
|
487
|
+
_context.next = 63;
|
488
|
+
return vaultLib.getPositionsLimit();
|
489
|
+
|
490
|
+
case 63:
|
491
|
+
_context.t14 = _context.sent;
|
492
|
+
_context.next = 66;
|
493
|
+
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);
|
471
494
|
|
472
|
-
case
|
495
|
+
case 66:
|
473
496
|
nextVaultLib = _context.sent;
|
474
|
-
_context.next =
|
497
|
+
_context.next = 69;
|
475
498
|
return nextFundDeployer.setVaultLib(nextVaultLib);
|
476
499
|
|
477
|
-
case
|
500
|
+
case 69:
|
478
501
|
if (!setReleaseLive) {
|
479
|
-
_context.next =
|
502
|
+
_context.next = 72;
|
480
503
|
break;
|
481
504
|
}
|
482
505
|
|
483
|
-
_context.next =
|
506
|
+
_context.next = 72;
|
484
507
|
return nextFundDeployer.setReleaseLive();
|
485
508
|
|
486
|
-
case
|
509
|
+
case 72:
|
487
510
|
if (!setOnDispatcher) {
|
488
|
-
_context.next =
|
511
|
+
_context.next = 75;
|
489
512
|
break;
|
490
513
|
}
|
491
514
|
|
492
|
-
_context.next =
|
515
|
+
_context.next = 75;
|
493
516
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
494
517
|
|
495
|
-
case
|
518
|
+
case 75:
|
496
519
|
return _context.abrupt("return", nextFundDeployer);
|
497
520
|
|
498
|
-
case
|
521
|
+
case 76:
|
499
522
|
case "end":
|
500
523
|
return _context.stop();
|
501
524
|
}
|
@@ -541,297 +564,331 @@ function _callOnExtension() {
|
|
541
564
|
return _callOnExtension.apply(this, arguments);
|
542
565
|
}
|
543
566
|
|
544
|
-
function
|
567
|
+
function callOnExternalPosition(_x) {
|
568
|
+
return _callOnExternalPosition.apply(this, arguments);
|
569
|
+
}
|
570
|
+
|
571
|
+
function _callOnExternalPosition() {
|
572
|
+
_callOnExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
573
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, actionId, actionArgs, callArgs;
|
574
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
575
|
+
while (1) {
|
576
|
+
switch (_context.prev = _context.next) {
|
577
|
+
case 0:
|
578
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
579
|
+
callArgs = callOnExternalPositionArgs({
|
580
|
+
actionArgs: actionArgs,
|
581
|
+
actionId: actionId,
|
582
|
+
externalPositionProxy: externalPositionProxy
|
583
|
+
});
|
584
|
+
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
585
|
+
|
586
|
+
case 3:
|
587
|
+
case "end":
|
588
|
+
return _context.stop();
|
589
|
+
}
|
590
|
+
}
|
591
|
+
}, _callee);
|
592
|
+
}));
|
593
|
+
return _callOnExternalPosition.apply(this, arguments);
|
594
|
+
}
|
595
|
+
|
596
|
+
function createExternalPosition(_x2) {
|
545
597
|
return _createExternalPosition.apply(this, arguments);
|
546
598
|
}
|
547
599
|
|
548
600
|
function _createExternalPosition() {
|
549
|
-
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
550
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId,
|
601
|
+
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
602
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
551
603
|
|
552
|
-
return _regeneratorRuntime.wrap(function
|
604
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
553
605
|
while (1) {
|
554
|
-
switch (
|
606
|
+
switch (_context2.prev = _context2.next) {
|
555
607
|
case 0:
|
556
|
-
signer =
|
557
|
-
|
608
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
609
|
+
_context2.next = 3;
|
558
610
|
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
559
611
|
|
560
612
|
case 3:
|
561
|
-
receipt =
|
613
|
+
receipt = _context2.sent;
|
562
614
|
event = extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
563
615
|
externalPositionProxy = new IExternalPositionProxy(event[0].args.externalPosition, signer);
|
564
|
-
return
|
565
|
-
|
566
|
-
|
616
|
+
return _context2.abrupt("return", {
|
617
|
+
externalPositionProxy: externalPositionProxy,
|
618
|
+
receipt: receipt
|
567
619
|
});
|
568
620
|
|
569
621
|
case 7:
|
570
622
|
case "end":
|
571
|
-
return
|
623
|
+
return _context2.stop();
|
572
624
|
}
|
573
625
|
}
|
574
|
-
},
|
626
|
+
}, _callee2);
|
575
627
|
}));
|
576
628
|
return _createExternalPosition.apply(this, arguments);
|
577
629
|
}
|
578
630
|
|
579
|
-
function reactivateExternalPosition(
|
631
|
+
function reactivateExternalPosition(_x3) {
|
580
632
|
return _reactivateExternalPosition.apply(this, arguments);
|
581
633
|
}
|
582
634
|
|
583
635
|
function _reactivateExternalPosition() {
|
584
|
-
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
636
|
+
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
585
637
|
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
586
|
-
return _regeneratorRuntime.wrap(function
|
638
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
587
639
|
while (1) {
|
588
|
-
switch (
|
640
|
+
switch (_context3.prev = _context3.next) {
|
589
641
|
case 0:
|
590
|
-
signer =
|
642
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy;
|
591
643
|
callArgs = externalPositionReactivateArgs({
|
592
644
|
externalPositionProxy: externalPositionProxy
|
593
645
|
});
|
594
|
-
return
|
646
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.ReactivateExternalPosition, callArgs));
|
595
647
|
|
596
648
|
case 3:
|
597
649
|
case "end":
|
598
|
-
return
|
650
|
+
return _context3.stop();
|
599
651
|
}
|
600
652
|
}
|
601
|
-
},
|
653
|
+
}, _callee3);
|
602
654
|
}));
|
603
655
|
return _reactivateExternalPosition.apply(this, arguments);
|
604
656
|
}
|
605
657
|
|
606
|
-
function removeExternalPosition(
|
658
|
+
function removeExternalPosition(_x4) {
|
607
659
|
return _removeExternalPosition.apply(this, arguments);
|
608
660
|
}
|
609
661
|
|
610
662
|
function _removeExternalPosition() {
|
611
|
-
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
663
|
+
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
612
664
|
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
613
|
-
return _regeneratorRuntime.wrap(function
|
665
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
614
666
|
while (1) {
|
615
|
-
switch (
|
667
|
+
switch (_context4.prev = _context4.next) {
|
616
668
|
case 0:
|
617
|
-
signer =
|
669
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy;
|
618
670
|
callArgs = externalPositionRemoveArgs({
|
619
671
|
externalPositionProxy: externalPositionProxy
|
620
672
|
});
|
621
|
-
return
|
673
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.RemoveExternalPosition, callArgs));
|
622
674
|
|
623
675
|
case 3:
|
624
676
|
case "end":
|
625
|
-
return
|
677
|
+
return _context4.stop();
|
626
678
|
}
|
627
679
|
}
|
628
|
-
},
|
680
|
+
}, _callee4);
|
629
681
|
}));
|
630
682
|
return _removeExternalPosition.apply(this, arguments);
|
631
683
|
}
|
632
684
|
|
633
|
-
function
|
634
|
-
return
|
685
|
+
function compoundDebtPositionAddCollateral(_x) {
|
686
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
635
687
|
}
|
636
688
|
|
637
|
-
function
|
638
|
-
|
639
|
-
var
|
689
|
+
function _compoundDebtPositionAddCollateral() {
|
690
|
+
_compoundDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
691
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
640
692
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
641
693
|
while (1) {
|
642
694
|
switch (_context.prev = _context.next) {
|
643
695
|
case 0:
|
644
|
-
|
645
|
-
|
646
|
-
|
696
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
697
|
+
actionArgs = compoundExternalPositionActionArgs({
|
698
|
+
amounts: amounts,
|
699
|
+
assets: assets,
|
700
|
+
data: encodeArgs(['address[]'], [cTokens])
|
701
|
+
});
|
702
|
+
return _context.abrupt("return", callOnExternalPosition({
|
703
|
+
actionArgs: actionArgs,
|
704
|
+
actionId: CompoundDebtPositionActionId.AddCollateralAssets,
|
647
705
|
comptrollerProxy: comptrollerProxy,
|
648
706
|
externalPositionManager: externalPositionManager,
|
649
|
-
|
707
|
+
externalPositionProxy: externalPositionProxy,
|
708
|
+
signer: fundOwner
|
650
709
|
}));
|
651
710
|
|
652
|
-
case
|
711
|
+
case 3:
|
653
712
|
case "end":
|
654
713
|
return _context.stop();
|
655
714
|
}
|
656
715
|
}
|
657
716
|
}, _callee);
|
658
717
|
}));
|
659
|
-
return
|
718
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
660
719
|
}
|
661
720
|
|
662
|
-
function
|
663
|
-
return
|
721
|
+
function compoundDebtPositionBorrow(_x2) {
|
722
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
664
723
|
}
|
665
724
|
|
666
|
-
function
|
667
|
-
|
668
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts,
|
725
|
+
function _compoundDebtPositionBorrow() {
|
726
|
+
_compoundDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
727
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, assets, amounts, cTokens, actionArgs;
|
669
728
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
670
729
|
while (1) {
|
671
730
|
switch (_context2.prev = _context2.next) {
|
672
731
|
case 0:
|
673
|
-
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner,
|
732
|
+
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
674
733
|
actionArgs = compoundExternalPositionActionArgs({
|
675
|
-
assets: assets,
|
676
734
|
amounts: amounts,
|
735
|
+
assets: assets,
|
677
736
|
data: encodeArgs(['address[]'], [cTokens])
|
678
737
|
});
|
679
|
-
|
738
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
739
|
+
actionArgs: actionArgs,
|
740
|
+
actionId: CompoundDebtPositionActionId.BorrowAsset,
|
741
|
+
comptrollerProxy: comptrollerProxy,
|
742
|
+
externalPositionManager: externalPositionManager,
|
680
743
|
externalPositionProxy: externalPositionProxy,
|
681
|
-
|
682
|
-
|
683
|
-
});
|
684
|
-
addCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
685
|
-
return _context2.abrupt("return", addCollateralTx);
|
744
|
+
signer: fundOwner
|
745
|
+
}));
|
686
746
|
|
687
|
-
case
|
747
|
+
case 3:
|
688
748
|
case "end":
|
689
749
|
return _context2.stop();
|
690
750
|
}
|
691
751
|
}
|
692
752
|
}, _callee2);
|
693
753
|
}));
|
694
|
-
return
|
754
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
695
755
|
}
|
696
756
|
|
697
|
-
function
|
698
|
-
return
|
757
|
+
function compoundDebtPositionClaimComp(_x3) {
|
758
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
699
759
|
}
|
700
760
|
|
701
|
-
function
|
702
|
-
|
703
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
761
|
+
function _compoundDebtPositionClaimComp() {
|
762
|
+
_compoundDebtPositionClaimComp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
763
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs;
|
704
764
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
705
765
|
while (1) {
|
706
766
|
switch (_context3.prev = _context3.next) {
|
707
767
|
case 0:
|
708
|
-
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner,
|
768
|
+
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
709
769
|
actionArgs = compoundExternalPositionActionArgs({
|
710
|
-
|
711
|
-
|
712
|
-
data:
|
770
|
+
amounts: [],
|
771
|
+
assets: [],
|
772
|
+
data: '0x'
|
713
773
|
});
|
714
|
-
|
774
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
775
|
+
actionArgs: actionArgs,
|
776
|
+
actionId: CompoundDebtPositionActionId.ClaimComp,
|
777
|
+
comptrollerProxy: comptrollerProxy,
|
778
|
+
externalPositionManager: externalPositionManager,
|
715
779
|
externalPositionProxy: externalPositionProxy,
|
716
|
-
|
717
|
-
|
718
|
-
});
|
719
|
-
removeCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
720
|
-
return _context3.abrupt("return", removeCollateralTx);
|
780
|
+
signer: fundOwner
|
781
|
+
}));
|
721
782
|
|
722
|
-
case
|
783
|
+
case 3:
|
723
784
|
case "end":
|
724
785
|
return _context3.stop();
|
725
786
|
}
|
726
787
|
}
|
727
788
|
}, _callee3);
|
728
789
|
}));
|
729
|
-
return
|
790
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
730
791
|
}
|
731
792
|
|
732
|
-
function
|
733
|
-
return
|
793
|
+
function compoundDebtPositionRemoveCollateral(_x4) {
|
794
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
734
795
|
}
|
735
796
|
|
736
|
-
function
|
737
|
-
|
738
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
797
|
+
function _compoundDebtPositionRemoveCollateral() {
|
798
|
+
_compoundDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
799
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
739
800
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
740
801
|
while (1) {
|
741
802
|
switch (_context4.prev = _context4.next) {
|
742
803
|
case 0:
|
743
|
-
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner,
|
804
|
+
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
744
805
|
actionArgs = compoundExternalPositionActionArgs({
|
745
|
-
assets: assets,
|
746
806
|
amounts: amounts,
|
807
|
+
assets: assets,
|
747
808
|
data: encodeArgs(['address[]'], [cTokens])
|
748
809
|
});
|
749
|
-
|
810
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
811
|
+
actionArgs: actionArgs,
|
812
|
+
actionId: CompoundDebtPositionActionId.RemoveCollateralAssets,
|
813
|
+
comptrollerProxy: comptrollerProxy,
|
814
|
+
externalPositionManager: externalPositionManager,
|
750
815
|
externalPositionProxy: externalPositionProxy,
|
751
|
-
|
752
|
-
|
753
|
-
});
|
754
|
-
borrowTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
755
|
-
return _context4.abrupt("return", borrowTx);
|
816
|
+
signer: fundOwner
|
817
|
+
}));
|
756
818
|
|
757
|
-
case
|
819
|
+
case 3:
|
758
820
|
case "end":
|
759
821
|
return _context4.stop();
|
760
822
|
}
|
761
823
|
}
|
762
824
|
}, _callee4);
|
763
825
|
}));
|
764
|
-
return
|
826
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
765
827
|
}
|
766
828
|
|
767
|
-
function
|
768
|
-
return
|
829
|
+
function compoundDebtPositionRepayBorrow(_x5) {
|
830
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
769
831
|
}
|
770
832
|
|
771
|
-
function
|
772
|
-
|
773
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
833
|
+
function _compoundDebtPositionRepayBorrow() {
|
834
|
+
_compoundDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
835
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
774
836
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
775
837
|
while (1) {
|
776
838
|
switch (_context5.prev = _context5.next) {
|
777
839
|
case 0:
|
778
|
-
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, externalPositionProxy = _ref5.externalPositionProxy;
|
840
|
+
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
779
841
|
actionArgs = compoundExternalPositionActionArgs({
|
780
|
-
|
781
|
-
|
782
|
-
data: '
|
842
|
+
amounts: amounts,
|
843
|
+
assets: assets,
|
844
|
+
data: encodeArgs(['address[]'], [cTokens])
|
783
845
|
});
|
784
|
-
|
846
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
847
|
+
actionArgs: actionArgs,
|
848
|
+
actionId: CompoundDebtPositionActionId.RepayBorrowedAssets,
|
849
|
+
comptrollerProxy: comptrollerProxy,
|
850
|
+
externalPositionManager: externalPositionManager,
|
785
851
|
externalPositionProxy: externalPositionProxy,
|
786
|
-
|
787
|
-
|
788
|
-
});
|
789
|
-
claimCompTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
790
|
-
return _context5.abrupt("return", claimCompTx);
|
852
|
+
signer: fundOwner
|
853
|
+
}));
|
791
854
|
|
792
|
-
case
|
855
|
+
case 3:
|
793
856
|
case "end":
|
794
857
|
return _context5.stop();
|
795
858
|
}
|
796
859
|
}
|
797
860
|
}, _callee5);
|
798
861
|
}));
|
799
|
-
return
|
862
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
800
863
|
}
|
801
864
|
|
802
|
-
function
|
803
|
-
return
|
865
|
+
function createCompoundDebtPosition(_x6) {
|
866
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
804
867
|
}
|
805
868
|
|
806
|
-
function
|
807
|
-
|
808
|
-
var comptrollerProxy, externalPositionManager
|
869
|
+
function _createCompoundDebtPosition() {
|
870
|
+
_createCompoundDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
871
|
+
var signer, comptrollerProxy, externalPositionManager;
|
809
872
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
810
873
|
while (1) {
|
811
874
|
switch (_context6.prev = _context6.next) {
|
812
875
|
case 0:
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
externalPositionProxy: externalPositionProxy,
|
821
|
-
actionId: CompoundDebtPositionActionId.RepayBorrowedAssets,
|
822
|
-
encodedCallArgs: actionArgs
|
823
|
-
});
|
824
|
-
repayTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
825
|
-
return _context6.abrupt("return", repayTx);
|
876
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
877
|
+
return _context6.abrupt("return", createExternalPosition({
|
878
|
+
comptrollerProxy: comptrollerProxy,
|
879
|
+
externalPositionManager: externalPositionManager,
|
880
|
+
externalPositionTypeId: ExternalPositionType.CompoundDebtPosition,
|
881
|
+
signer: signer
|
882
|
+
}));
|
826
883
|
|
827
|
-
case
|
884
|
+
case 2:
|
828
885
|
case "end":
|
829
886
|
return _context6.stop();
|
830
887
|
}
|
831
888
|
}
|
832
889
|
}, _callee6);
|
833
890
|
}));
|
834
|
-
return
|
891
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
835
892
|
}
|
836
893
|
|
837
894
|
function createMockExternalPosition(_x) {
|
@@ -846,7 +903,7 @@ function _createMockExternalPosition() {
|
|
846
903
|
switch (_context.prev = _context.next) {
|
847
904
|
case 0:
|
848
905
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
849
|
-
_context.t0 = VaultLib
|
906
|
+
_context.t0 = VaultLib;
|
850
907
|
_context.next = 4;
|
851
908
|
return comptrollerProxy.getVaultProxy();
|
852
909
|
|
@@ -879,7 +936,7 @@ function _createMockExternalPosition() {
|
|
879
936
|
|
880
937
|
case 21:
|
881
938
|
_context.next = 23;
|
882
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId
|
939
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [typeId, '0x']));
|
883
940
|
|
884
941
|
case 23:
|
885
942
|
receipt = _context.sent;
|
@@ -889,11 +946,11 @@ function _createMockExternalPosition() {
|
|
889
946
|
case 26:
|
890
947
|
externalPositionProxy = _context.sent[0];
|
891
948
|
return _context.abrupt("return", {
|
892
|
-
typeId: typeId,
|
893
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
894
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
895
949
|
externalPositionProxy: externalPositionProxy,
|
896
|
-
|
950
|
+
mockExternalPositionParser: mockExternalPositionParser,
|
951
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
952
|
+
receipt: receipt,
|
953
|
+
typeId: typeId
|
897
954
|
});
|
898
955
|
|
899
956
|
case 28:
|
@@ -906,6 +963,416 @@ function _createMockExternalPosition() {
|
|
906
963
|
return _createMockExternalPosition.apply(this, arguments);
|
907
964
|
}
|
908
965
|
|
966
|
+
function mockExternalPositionAddDebtAssets(_x2) {
|
967
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
968
|
+
}
|
969
|
+
|
970
|
+
function _mockExternalPositionAddDebtAssets() {
|
971
|
+
_mockExternalPositionAddDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
972
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
973
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
974
|
+
while (1) {
|
975
|
+
switch (_context2.prev = _context2.next) {
|
976
|
+
case 0:
|
977
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
978
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
979
|
+
amounts: amounts,
|
980
|
+
assets: assets
|
981
|
+
});
|
982
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
983
|
+
actionArgs: actionArgs,
|
984
|
+
actionId: MockGenericExternalPositionActionId.AddDebtAssets,
|
985
|
+
comptrollerProxy: comptrollerProxy,
|
986
|
+
externalPositionManager: externalPositionManager,
|
987
|
+
externalPositionProxy: externalPositionProxy,
|
988
|
+
signer: signer
|
989
|
+
}));
|
990
|
+
|
991
|
+
case 3:
|
992
|
+
case "end":
|
993
|
+
return _context2.stop();
|
994
|
+
}
|
995
|
+
}
|
996
|
+
}, _callee2);
|
997
|
+
}));
|
998
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
999
|
+
}
|
1000
|
+
|
1001
|
+
function mockExternalPositionAddManagedAssets(_x3) {
|
1002
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
function _mockExternalPositionAddManagedAssets() {
|
1006
|
+
_mockExternalPositionAddManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
1007
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1008
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1009
|
+
while (1) {
|
1010
|
+
switch (_context3.prev = _context3.next) {
|
1011
|
+
case 0:
|
1012
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
1013
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1014
|
+
amounts: amounts,
|
1015
|
+
assets: assets
|
1016
|
+
});
|
1017
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
1018
|
+
actionArgs: actionArgs,
|
1019
|
+
actionId: MockGenericExternalPositionActionId.AddManagedAssets,
|
1020
|
+
comptrollerProxy: comptrollerProxy,
|
1021
|
+
externalPositionManager: externalPositionManager,
|
1022
|
+
externalPositionProxy: externalPositionProxy,
|
1023
|
+
signer: signer
|
1024
|
+
}));
|
1025
|
+
|
1026
|
+
case 3:
|
1027
|
+
case "end":
|
1028
|
+
return _context3.stop();
|
1029
|
+
}
|
1030
|
+
}
|
1031
|
+
}, _callee3);
|
1032
|
+
}));
|
1033
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
function mockExternalPositionRemoveDebtAssets(_x4) {
|
1037
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
function _mockExternalPositionRemoveDebtAssets() {
|
1041
|
+
_mockExternalPositionRemoveDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1042
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1043
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1044
|
+
while (1) {
|
1045
|
+
switch (_context4.prev = _context4.next) {
|
1046
|
+
case 0:
|
1047
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
1048
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1049
|
+
amounts: amounts,
|
1050
|
+
assets: assets
|
1051
|
+
});
|
1052
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
1053
|
+
actionArgs: actionArgs,
|
1054
|
+
actionId: MockGenericExternalPositionActionId.RemoveDebtAssets,
|
1055
|
+
comptrollerProxy: comptrollerProxy,
|
1056
|
+
externalPositionManager: externalPositionManager,
|
1057
|
+
externalPositionProxy: externalPositionProxy,
|
1058
|
+
signer: signer
|
1059
|
+
}));
|
1060
|
+
|
1061
|
+
case 3:
|
1062
|
+
case "end":
|
1063
|
+
return _context4.stop();
|
1064
|
+
}
|
1065
|
+
}
|
1066
|
+
}, _callee4);
|
1067
|
+
}));
|
1068
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
function mockExternalPositionRemoveManagedAssets(_x5) {
|
1072
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
function _mockExternalPositionRemoveManagedAssets() {
|
1076
|
+
_mockExternalPositionRemoveManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
1077
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1078
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1079
|
+
while (1) {
|
1080
|
+
switch (_context5.prev = _context5.next) {
|
1081
|
+
case 0:
|
1082
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
1083
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1084
|
+
amounts: amounts,
|
1085
|
+
assets: assets
|
1086
|
+
});
|
1087
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
1088
|
+
actionArgs: actionArgs,
|
1089
|
+
actionId: MockGenericExternalPositionActionId.RemoveManagedAssets,
|
1090
|
+
comptrollerProxy: comptrollerProxy,
|
1091
|
+
externalPositionManager: externalPositionManager,
|
1092
|
+
externalPositionProxy: externalPositionProxy,
|
1093
|
+
signer: signer
|
1094
|
+
}));
|
1095
|
+
|
1096
|
+
case 3:
|
1097
|
+
case "end":
|
1098
|
+
return _context5.stop();
|
1099
|
+
}
|
1100
|
+
}
|
1101
|
+
}, _callee5);
|
1102
|
+
}));
|
1103
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1104
|
+
}
|
1105
|
+
|
1106
|
+
var _templateObject$3;
|
1107
|
+
var UniswapV3FeeAmount;
|
1108
|
+
|
1109
|
+
(function (UniswapV3FeeAmount) {
|
1110
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
1111
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
1112
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
1113
|
+
})(UniswapV3FeeAmount || (UniswapV3FeeAmount = {}));
|
1114
|
+
|
1115
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
1116
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
1117
|
+
};
|
1118
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
1119
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
1120
|
+
};
|
1121
|
+
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"])));
|
1122
|
+
function createUniswapV3LiquidityPosition(_x) {
|
1123
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
function _createUniswapV3LiquidityPosition() {
|
1127
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1128
|
+
var signer, comptrollerProxy, externalPositionManager, token0, token1, initArgs, receipt, vaultProxy, externalPositions, externalPositionProxyAddress;
|
1129
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1130
|
+
while (1) {
|
1131
|
+
switch (_context.prev = _context.next) {
|
1132
|
+
case 0:
|
1133
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, token0 = _ref.token0, token1 = _ref.token1;
|
1134
|
+
initArgs = uniswapV3LiquidityPositionInitArgs({
|
1135
|
+
token0: token0,
|
1136
|
+
token1: token1
|
1137
|
+
});
|
1138
|
+
_context.next = 4;
|
1139
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [ExternalPositionType.UniswapV3LiquidityPosition, initArgs]));
|
1140
|
+
|
1141
|
+
case 4:
|
1142
|
+
receipt = _context.sent;
|
1143
|
+
_context.t0 = VaultLib;
|
1144
|
+
_context.next = 8;
|
1145
|
+
return comptrollerProxy.getVaultProxy();
|
1146
|
+
|
1147
|
+
case 8:
|
1148
|
+
_context.t1 = _context.sent;
|
1149
|
+
_context.t2 = signer;
|
1150
|
+
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
1151
|
+
_context.next = 13;
|
1152
|
+
return vaultProxy.getActiveExternalPositions.call();
|
1153
|
+
|
1154
|
+
case 13:
|
1155
|
+
externalPositions = _context.sent;
|
1156
|
+
externalPositionProxyAddress = externalPositions[externalPositions.length - 1];
|
1157
|
+
return _context.abrupt("return", {
|
1158
|
+
externalPositionProxyAddress: externalPositionProxyAddress,
|
1159
|
+
receipt: receipt
|
1160
|
+
});
|
1161
|
+
|
1162
|
+
case 16:
|
1163
|
+
case "end":
|
1164
|
+
return _context.stop();
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
}, _callee);
|
1168
|
+
}));
|
1169
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
1173
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
1177
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
1178
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
1179
|
+
|
1180
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1181
|
+
while (1) {
|
1182
|
+
switch (_context2.prev = _context2.next) {
|
1183
|
+
case 0:
|
1184
|
+
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;
|
1185
|
+
actionArgs = uniswapV3LiquidityPositionAddLiquidityArgs({
|
1186
|
+
amount0Desired: amount0Desired,
|
1187
|
+
amount0Min: amount0Min,
|
1188
|
+
amount1Desired: amount1Desired,
|
1189
|
+
amount1Min: amount1Min,
|
1190
|
+
nftId: nftId
|
1191
|
+
});
|
1192
|
+
callArgs = callOnExternalPositionArgs({
|
1193
|
+
actionArgs: actionArgs,
|
1194
|
+
actionId: UniswapV3LiquidityPositionActionId.AddLiquidity,
|
1195
|
+
externalPositionProxy: externalPositionProxy
|
1196
|
+
});
|
1197
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1198
|
+
|
1199
|
+
case 4:
|
1200
|
+
case "end":
|
1201
|
+
return _context2.stop();
|
1202
|
+
}
|
1203
|
+
}
|
1204
|
+
}, _callee2);
|
1205
|
+
}));
|
1206
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
1210
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1211
|
+
}
|
1212
|
+
|
1213
|
+
function _uniswapV3LiquidityPositionCollect() {
|
1214
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
1215
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
1216
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1217
|
+
while (1) {
|
1218
|
+
switch (_context3.prev = _context3.next) {
|
1219
|
+
case 0:
|
1220
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
1221
|
+
actionArgs = uniswapV3LiquidityPositionCollectArgs({
|
1222
|
+
nftId: nftId
|
1223
|
+
});
|
1224
|
+
callArgs = callOnExternalPositionArgs({
|
1225
|
+
actionArgs: actionArgs,
|
1226
|
+
actionId: UniswapV3LiquidityPositionActionId.Collect,
|
1227
|
+
externalPositionProxy: externalPositionProxy
|
1228
|
+
});
|
1229
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1230
|
+
|
1231
|
+
case 4:
|
1232
|
+
case "end":
|
1233
|
+
return _context3.stop();
|
1234
|
+
}
|
1235
|
+
}
|
1236
|
+
}, _callee3);
|
1237
|
+
}));
|
1238
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
1242
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
function _uniswapV3LiquidityPositionMint() {
|
1246
|
+
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1247
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1248
|
+
|
1249
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1250
|
+
while (1) {
|
1251
|
+
switch (_context4.prev = _context4.next) {
|
1252
|
+
case 0:
|
1253
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, 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;
|
1254
|
+
actionArgs = uniswapV3LiquidityPositionMintArgs({
|
1255
|
+
amount0Desired: amount0Desired,
|
1256
|
+
amount0Min: amount0Min,
|
1257
|
+
amount1Desired: amount1Desired,
|
1258
|
+
amount1Min: amount1Min,
|
1259
|
+
fee: fee,
|
1260
|
+
tickLower: tickLower,
|
1261
|
+
tickUpper: tickUpper
|
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
|
+
|
909
1376
|
function generateFeeManagerConfigWithMockFees(_x) {
|
910
1377
|
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
911
1378
|
}
|
@@ -1010,8 +1477,8 @@ function _aaveLend() {
|
|
1010
1477
|
});
|
1011
1478
|
callArgs = callOnIntegrationArgs({
|
1012
1479
|
adapter: aaveAdapter,
|
1013
|
-
|
1014
|
-
|
1480
|
+
encodedCallArgs: lendArgs,
|
1481
|
+
selector: lendSelector
|
1015
1482
|
});
|
1016
1483
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1017
1484
|
return _context.abrupt("return", lendTx);
|
@@ -1045,8 +1512,8 @@ function _aaveRedeem() {
|
|
1045
1512
|
});
|
1046
1513
|
callArgs = callOnIntegrationArgs({
|
1047
1514
|
adapter: aaveAdapter,
|
1048
|
-
|
1049
|
-
|
1515
|
+
encodedCallArgs: redeemArgs,
|
1516
|
+
selector: redeemSelector
|
1050
1517
|
});
|
1051
1518
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1052
1519
|
return _context2.abrupt("return", redeemTx);
|
@@ -1078,13 +1545,13 @@ function _compoundLend() {
|
|
1078
1545
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, cToken = _ref.cToken, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? utils.parseEther('1') : _ref$tokenAmount, _ref$cTokenAmount = _ref.cTokenAmount, cTokenAmount = _ref$cTokenAmount === void 0 ? utils.parseEther('1') : _ref$cTokenAmount;
|
1079
1546
|
lendArgs = compoundArgs({
|
1080
1547
|
cToken: cToken,
|
1081
|
-
|
1082
|
-
|
1548
|
+
minIncomingAssetAmount: cTokenAmount,
|
1549
|
+
outgoingAssetAmount: tokenAmount
|
1083
1550
|
});
|
1084
1551
|
callArgs = callOnIntegrationArgs({
|
1085
1552
|
adapter: compoundAdapter,
|
1086
|
-
|
1087
|
-
|
1553
|
+
encodedCallArgs: lendArgs,
|
1554
|
+
selector: lendSelector
|
1088
1555
|
});
|
1089
1556
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1090
1557
|
return _context.abrupt("return", lendTx);
|
@@ -1107,601 +1574,825 @@ function _compoundRedeem() {
|
|
1107
1574
|
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
1108
1575
|
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref2$tokenAmount, tokenAmount, _ref2$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
1109
1576
|
|
1110
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1577
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1578
|
+
while (1) {
|
1579
|
+
switch (_context2.prev = _context2.next) {
|
1580
|
+
case 0:
|
1581
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, _ref2$tokenAmount = _ref2.tokenAmount, tokenAmount = _ref2$tokenAmount === void 0 ? utils.parseEther('1') : _ref2$tokenAmount, _ref2$cTokenAmount = _ref2.cTokenAmount, cTokenAmount = _ref2$cTokenAmount === void 0 ? utils.parseEther('1') : _ref2$cTokenAmount;
|
1582
|
+
redeemArgs = compoundArgs({
|
1583
|
+
cToken: resolveAddress(cToken),
|
1584
|
+
minIncomingAssetAmount: tokenAmount,
|
1585
|
+
outgoingAssetAmount: cTokenAmount
|
1586
|
+
});
|
1587
|
+
callArgs = callOnIntegrationArgs({
|
1588
|
+
adapter: compoundAdapter,
|
1589
|
+
encodedCallArgs: redeemArgs,
|
1590
|
+
selector: redeemSelector
|
1591
|
+
});
|
1592
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1593
|
+
return _context2.abrupt("return", redeemTx);
|
1594
|
+
|
1595
|
+
case 5:
|
1596
|
+
case "end":
|
1597
|
+
return _context2.stop();
|
1598
|
+
}
|
1599
|
+
}
|
1600
|
+
}, _callee2);
|
1601
|
+
}));
|
1602
|
+
return _compoundRedeem.apply(this, arguments);
|
1603
|
+
}
|
1604
|
+
|
1605
|
+
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
1606
|
+
var CurveLiquidityGaugeV2 = contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
1607
|
+
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
|
1608
|
+
|
1609
|
+
var CurveSwaps = contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
1610
|
+
var CurveMinter = contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
1611
|
+
|
1612
|
+
function curveTakeOrder(_x) {
|
1613
|
+
return _curveTakeOrder.apply(this, arguments);
|
1614
|
+
} // combined liquidity
|
1615
|
+
|
1616
|
+
function _curveTakeOrder() {
|
1617
|
+
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1618
|
+
var comptrollerProxy, integrationManager, fundOwner, curveExchangeAdapter, pool, outgoingAsset, _ref$outgoingAssetAmo, outgoingAssetAmount, incomingAsset, _ref$minIncomingAsset, minIncomingAssetAmount, takeOrderArgs, callArgs;
|
1619
|
+
|
1620
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1621
|
+
while (1) {
|
1622
|
+
switch (_context.prev = _context.next) {
|
1623
|
+
case 0:
|
1624
|
+
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;
|
1625
|
+
takeOrderArgs = curveTakeOrderArgs({
|
1626
|
+
incomingAsset: incomingAsset,
|
1627
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1628
|
+
outgoingAsset: outgoingAsset,
|
1629
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
1630
|
+
pool: pool
|
1631
|
+
});
|
1632
|
+
callArgs = callOnIntegrationArgs({
|
1633
|
+
adapter: curveExchangeAdapter,
|
1634
|
+
encodedCallArgs: takeOrderArgs,
|
1635
|
+
selector: takeOrderSelector
|
1636
|
+
});
|
1637
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1638
|
+
|
1639
|
+
case 4:
|
1640
|
+
case "end":
|
1641
|
+
return _context.stop();
|
1642
|
+
}
|
1643
|
+
}
|
1644
|
+
}, _callee);
|
1645
|
+
}));
|
1646
|
+
return _curveTakeOrder.apply(this, arguments);
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
function curveClaimRewards(_ref2) {
|
1650
|
+
var comptrollerProxy = _ref2.comptrollerProxy,
|
1651
|
+
integrationManager = _ref2.integrationManager,
|
1652
|
+
fundOwner = _ref2.fundOwner,
|
1653
|
+
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
1654
|
+
gaugeToken = _ref2.gaugeToken;
|
1655
|
+
var callArgs = callOnIntegrationArgs({
|
1656
|
+
adapter: curveLiquidityAdapter,
|
1657
|
+
encodedCallArgs: curveClaimRewardsArgs({
|
1658
|
+
gaugeToken: gaugeToken
|
1659
|
+
}),
|
1660
|
+
selector: claimRewardsSelector
|
1661
|
+
});
|
1662
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1663
|
+
}
|
1664
|
+
function curveLend(_x2) {
|
1665
|
+
return _curveLend.apply(this, arguments);
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
function _curveLend() {
|
1669
|
+
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
1670
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
1671
|
+
|
1672
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1673
|
+
while (1) {
|
1674
|
+
switch (_context2.prev = _context2.next) {
|
1675
|
+
case 0:
|
1676
|
+
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;
|
1677
|
+
callArgs = callOnIntegrationArgs({
|
1678
|
+
adapter: curveLiquidityAdapter,
|
1679
|
+
encodedCallArgs: curveLendArgs({
|
1680
|
+
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
1681
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1682
|
+
pool: pool,
|
1683
|
+
useUnderlyings: useUnderlyings
|
1684
|
+
}),
|
1685
|
+
selector: lendSelector
|
1686
|
+
});
|
1687
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1688
|
+
|
1689
|
+
case 3:
|
1690
|
+
case "end":
|
1691
|
+
return _context2.stop();
|
1692
|
+
}
|
1693
|
+
}
|
1694
|
+
}, _callee2);
|
1695
|
+
}));
|
1696
|
+
return _curveLend.apply(this, arguments);
|
1697
|
+
}
|
1698
|
+
|
1699
|
+
function curveLendAndStake(_x3) {
|
1700
|
+
return _curveLendAndStake.apply(this, arguments);
|
1701
|
+
}
|
1702
|
+
|
1703
|
+
function _curveLendAndStake() {
|
1704
|
+
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
1705
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingGaugeToken, _ref4$minIncomingGaug, minIncomingGaugeTokenAmount, useUnderlyings, callArgs;
|
1706
|
+
|
1707
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1708
|
+
while (1) {
|
1709
|
+
switch (_context3.prev = _context3.next) {
|
1710
|
+
case 0:
|
1711
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingGaugeToken = _ref4.incomingGaugeToken, _ref4$minIncomingGaug = _ref4.minIncomingGaugeTokenAmount, minIncomingGaugeTokenAmount = _ref4$minIncomingGaug === void 0 ? BigNumber.from(1) : _ref4$minIncomingGaug, useUnderlyings = _ref4.useUnderlyings;
|
1712
|
+
callArgs = callOnIntegrationArgs({
|
1713
|
+
adapter: curveLiquidityAdapter,
|
1714
|
+
encodedCallArgs: curveLendAndStakeArgs({
|
1715
|
+
incomingGaugeToken: incomingGaugeToken,
|
1716
|
+
minIncomingGaugeTokenAmount: minIncomingGaugeTokenAmount,
|
1717
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1718
|
+
pool: pool,
|
1719
|
+
useUnderlyings: useUnderlyings
|
1720
|
+
}),
|
1721
|
+
selector: lendAndStakeSelector
|
1722
|
+
});
|
1723
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1724
|
+
|
1725
|
+
case 3:
|
1726
|
+
case "end":
|
1727
|
+
return _context3.stop();
|
1728
|
+
}
|
1729
|
+
}
|
1730
|
+
}, _callee3);
|
1731
|
+
}));
|
1732
|
+
return _curveLendAndStake.apply(this, arguments);
|
1733
|
+
}
|
1734
|
+
|
1735
|
+
function curveRedeem(_x4) {
|
1736
|
+
return _curveRedeem.apply(this, arguments);
|
1737
|
+
}
|
1738
|
+
|
1739
|
+
function _curveRedeem() {
|
1740
|
+
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref5) {
|
1741
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
1742
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1743
|
+
while (1) {
|
1744
|
+
switch (_context4.prev = _context4.next) {
|
1745
|
+
case 0:
|
1746
|
+
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;
|
1747
|
+
callArgs = callOnIntegrationArgs({
|
1748
|
+
adapter: curveLiquidityAdapter,
|
1749
|
+
encodedCallArgs: curveRedeemArgs({
|
1750
|
+
incomingAssetData: incomingAssetData,
|
1751
|
+
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
1752
|
+
pool: pool,
|
1753
|
+
redeemType: redeemType,
|
1754
|
+
useUnderlyings: useUnderlyings
|
1755
|
+
}),
|
1756
|
+
selector: redeemSelector
|
1757
|
+
});
|
1758
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1759
|
+
|
1760
|
+
case 3:
|
1761
|
+
case "end":
|
1762
|
+
return _context4.stop();
|
1763
|
+
}
|
1764
|
+
}
|
1765
|
+
}, _callee4);
|
1766
|
+
}));
|
1767
|
+
return _curveRedeem.apply(this, arguments);
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
function curveStake(_x5) {
|
1771
|
+
return _curveStake.apply(this, arguments);
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
function _curveStake() {
|
1775
|
+
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref6) {
|
1776
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingGaugeToken, amount, callArgs;
|
1777
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1778
|
+
while (1) {
|
1779
|
+
switch (_context5.prev = _context5.next) {
|
1780
|
+
case 0:
|
1781
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingGaugeToken = _ref6.incomingGaugeToken, amount = _ref6.amount;
|
1782
|
+
callArgs = callOnIntegrationArgs({
|
1783
|
+
adapter: curveLiquidityAdapter,
|
1784
|
+
encodedCallArgs: curveStakeArgs({
|
1785
|
+
amount: amount,
|
1786
|
+
incomingGaugeToken: incomingGaugeToken,
|
1787
|
+
pool: pool
|
1788
|
+
}),
|
1789
|
+
selector: stakeSelector
|
1790
|
+
});
|
1791
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1792
|
+
|
1793
|
+
case 3:
|
1794
|
+
case "end":
|
1795
|
+
return _context5.stop();
|
1796
|
+
}
|
1797
|
+
}
|
1798
|
+
}, _callee5);
|
1799
|
+
}));
|
1800
|
+
return _curveStake.apply(this, arguments);
|
1801
|
+
}
|
1802
|
+
|
1803
|
+
function curveUnstake(_x6) {
|
1804
|
+
return _curveUnstake.apply(this, arguments);
|
1805
|
+
}
|
1806
|
+
|
1807
|
+
function _curveUnstake() {
|
1808
|
+
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref7) {
|
1809
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingGaugeToken, amount, callArgs;
|
1810
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
1111
1811
|
while (1) {
|
1112
|
-
switch (
|
1812
|
+
switch (_context6.prev = _context6.next) {
|
1113
1813
|
case 0:
|
1114
|
-
comptrollerProxy =
|
1115
|
-
redeemArgs = compoundArgs({
|
1116
|
-
cToken: resolveAddress(cToken),
|
1117
|
-
outgoingAssetAmount: cTokenAmount,
|
1118
|
-
minIncomingAssetAmount: tokenAmount
|
1119
|
-
});
|
1814
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingGaugeToken = _ref7.outgoingGaugeToken, amount = _ref7.amount;
|
1120
1815
|
callArgs = callOnIntegrationArgs({
|
1121
|
-
adapter:
|
1122
|
-
|
1123
|
-
|
1816
|
+
adapter: curveLiquidityAdapter,
|
1817
|
+
encodedCallArgs: curveUnstakeArgs({
|
1818
|
+
amount: amount,
|
1819
|
+
outgoingGaugeToken: outgoingGaugeToken,
|
1820
|
+
pool: pool
|
1821
|
+
}),
|
1822
|
+
selector: unstakeSelector
|
1124
1823
|
});
|
1125
|
-
|
1126
|
-
return _context2.abrupt("return", redeemTx);
|
1824
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1127
1825
|
|
1128
|
-
case
|
1826
|
+
case 3:
|
1129
1827
|
case "end":
|
1130
|
-
return
|
1828
|
+
return _context6.stop();
|
1131
1829
|
}
|
1132
1830
|
}
|
1133
|
-
},
|
1831
|
+
}, _callee6);
|
1134
1832
|
}));
|
1135
|
-
return
|
1833
|
+
return _curveUnstake.apply(this, arguments);
|
1136
1834
|
}
|
1137
1835
|
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
var CurveSwaps = contract()(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
1142
|
-
var CurveMinter = contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
1143
|
-
|
1144
|
-
function curveTakeOrder(_x) {
|
1145
|
-
return _curveTakeOrder.apply(this, arguments);
|
1836
|
+
function curveUnstakeAndRedeem(_x7) {
|
1837
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
1146
1838
|
} // aave pool
|
1147
1839
|
|
1148
|
-
function
|
1149
|
-
|
1150
|
-
var comptrollerProxy, integrationManager,
|
1151
|
-
|
1152
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1840
|
+
function _curveUnstakeAndRedeem() {
|
1841
|
+
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref8) {
|
1842
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingGaugeToken, outgoingGaugeTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
1843
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
1153
1844
|
while (1) {
|
1154
|
-
switch (
|
1845
|
+
switch (_context7.prev = _context7.next) {
|
1155
1846
|
case 0:
|
1156
|
-
comptrollerProxy =
|
1157
|
-
takeOrderArgs = curveTakeOrderArgs({
|
1158
|
-
pool: pool,
|
1159
|
-
outgoingAsset: outgoingAsset,
|
1160
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
1161
|
-
incomingAsset: incomingAsset,
|
1162
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
1163
|
-
});
|
1847
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingGaugeToken = _ref8.outgoingGaugeToken, outgoingGaugeTokenAmount = _ref8.outgoingGaugeTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
1164
1848
|
callArgs = callOnIntegrationArgs({
|
1165
|
-
adapter:
|
1166
|
-
|
1167
|
-
|
1849
|
+
adapter: curveLiquidityAdapter,
|
1850
|
+
encodedCallArgs: curveUnstakeAndRedeemArgs({
|
1851
|
+
incomingAssetData: incomingAssetData,
|
1852
|
+
outgoingGaugeToken: outgoingGaugeToken,
|
1853
|
+
outgoingGaugeTokenAmount: outgoingGaugeTokenAmount,
|
1854
|
+
pool: pool,
|
1855
|
+
redeemType: redeemType,
|
1856
|
+
useUnderlyings: useUnderlyings
|
1857
|
+
}),
|
1858
|
+
selector: unstakeAndRedeemSelector
|
1168
1859
|
});
|
1169
|
-
return
|
1860
|
+
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1170
1861
|
|
1171
|
-
case
|
1862
|
+
case 3:
|
1172
1863
|
case "end":
|
1173
|
-
return
|
1864
|
+
return _context7.stop();
|
1174
1865
|
}
|
1175
1866
|
}
|
1176
|
-
},
|
1867
|
+
}, _callee7);
|
1177
1868
|
}));
|
1178
|
-
return
|
1869
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
1179
1870
|
}
|
1180
1871
|
|
1181
|
-
function curveAaveClaimRewards(
|
1182
|
-
var comptrollerProxy =
|
1183
|
-
integrationManager =
|
1184
|
-
fundOwner =
|
1185
|
-
curveLiquidityAaveAdapter =
|
1872
|
+
function curveAaveClaimRewards(_ref9) {
|
1873
|
+
var comptrollerProxy = _ref9.comptrollerProxy,
|
1874
|
+
integrationManager = _ref9.integrationManager,
|
1875
|
+
fundOwner = _ref9.fundOwner,
|
1876
|
+
curveLiquidityAaveAdapter = _ref9.curveLiquidityAaveAdapter;
|
1186
1877
|
var callArgs = callOnIntegrationArgs({
|
1187
1878
|
adapter: curveLiquidityAaveAdapter,
|
1188
|
-
|
1189
|
-
|
1879
|
+
encodedCallArgs: constants.HashZero,
|
1880
|
+
selector: claimRewardsSelector
|
1190
1881
|
});
|
1191
1882
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1192
1883
|
}
|
1193
|
-
function curveAaveLend(
|
1194
|
-
var comptrollerProxy =
|
1195
|
-
integrationManager =
|
1196
|
-
fundOwner =
|
1197
|
-
curveLiquidityAaveAdapter =
|
1198
|
-
|
1199
|
-
outgoingAaveDaiAmount =
|
1200
|
-
|
1201
|
-
outgoingAaveUsdcAmount =
|
1202
|
-
|
1203
|
-
outgoingAaveUsdtAmount =
|
1204
|
-
|
1205
|
-
minIncomingLPTokenAmount =
|
1206
|
-
|
1207
|
-
useUnderlyings =
|
1884
|
+
function curveAaveLend(_ref10) {
|
1885
|
+
var comptrollerProxy = _ref10.comptrollerProxy,
|
1886
|
+
integrationManager = _ref10.integrationManager,
|
1887
|
+
fundOwner = _ref10.fundOwner,
|
1888
|
+
curveLiquidityAaveAdapter = _ref10.curveLiquidityAaveAdapter,
|
1889
|
+
_ref10$outgoingAaveDa = _ref10.outgoingAaveDaiAmount,
|
1890
|
+
outgoingAaveDaiAmount = _ref10$outgoingAaveDa === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveDa,
|
1891
|
+
_ref10$outgoingAaveUs = _ref10.outgoingAaveUsdcAmount,
|
1892
|
+
outgoingAaveUsdcAmount = _ref10$outgoingAaveUs === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveUs,
|
1893
|
+
_ref10$outgoingAaveUs2 = _ref10.outgoingAaveUsdtAmount,
|
1894
|
+
outgoingAaveUsdtAmount = _ref10$outgoingAaveUs2 === void 0 ? BigNumber.from(0) : _ref10$outgoingAaveUs2,
|
1895
|
+
_ref10$minIncomingLPT = _ref10.minIncomingLPTokenAmount,
|
1896
|
+
minIncomingLPTokenAmount = _ref10$minIncomingLPT === void 0 ? BigNumber.from(1) : _ref10$minIncomingLPT,
|
1897
|
+
_ref10$useUnderlyings = _ref10.useUnderlyings,
|
1898
|
+
useUnderlyings = _ref10$useUnderlyings === void 0 ? false : _ref10$useUnderlyings;
|
1208
1899
|
var callArgs = callOnIntegrationArgs({
|
1209
1900
|
adapter: curveLiquidityAaveAdapter,
|
1210
|
-
selector: lendSelector,
|
1211
1901
|
encodedCallArgs: curveAaveLendArgs({
|
1902
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1212
1903
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1213
1904
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1214
1905
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1215
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1216
1906
|
useUnderlyings: useUnderlyings
|
1217
|
-
})
|
1907
|
+
}),
|
1908
|
+
selector: lendSelector
|
1218
1909
|
});
|
1219
1910
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1220
1911
|
}
|
1221
|
-
function curveAaveLendAndStake(
|
1222
|
-
var comptrollerProxy =
|
1223
|
-
integrationManager =
|
1224
|
-
fundOwner =
|
1225
|
-
curveLiquidityAaveAdapter =
|
1226
|
-
|
1227
|
-
outgoingAaveDaiAmount =
|
1228
|
-
|
1229
|
-
outgoingAaveUsdcAmount =
|
1230
|
-
|
1231
|
-
outgoingAaveUsdtAmount =
|
1232
|
-
|
1233
|
-
minIncomingLiquidityGaugeTokenAmount =
|
1234
|
-
|
1235
|
-
useUnderlyings =
|
1912
|
+
function curveAaveLendAndStake(_ref11) {
|
1913
|
+
var comptrollerProxy = _ref11.comptrollerProxy,
|
1914
|
+
integrationManager = _ref11.integrationManager,
|
1915
|
+
fundOwner = _ref11.fundOwner,
|
1916
|
+
curveLiquidityAaveAdapter = _ref11.curveLiquidityAaveAdapter,
|
1917
|
+
_ref11$outgoingAaveDa = _ref11.outgoingAaveDaiAmount,
|
1918
|
+
outgoingAaveDaiAmount = _ref11$outgoingAaveDa === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveDa,
|
1919
|
+
_ref11$outgoingAaveUs = _ref11.outgoingAaveUsdcAmount,
|
1920
|
+
outgoingAaveUsdcAmount = _ref11$outgoingAaveUs === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveUs,
|
1921
|
+
_ref11$outgoingAaveUs2 = _ref11.outgoingAaveUsdtAmount,
|
1922
|
+
outgoingAaveUsdtAmount = _ref11$outgoingAaveUs2 === void 0 ? BigNumber.from(0) : _ref11$outgoingAaveUs2,
|
1923
|
+
_ref11$minIncomingLiq = _ref11.minIncomingLiquidityGaugeTokenAmount,
|
1924
|
+
minIncomingLiquidityGaugeTokenAmount = _ref11$minIncomingLiq === void 0 ? BigNumber.from(1) : _ref11$minIncomingLiq,
|
1925
|
+
_ref11$useUnderlyings = _ref11.useUnderlyings,
|
1926
|
+
useUnderlyings = _ref11$useUnderlyings === void 0 ? false : _ref11$useUnderlyings;
|
1236
1927
|
var callArgs = callOnIntegrationArgs({
|
1237
1928
|
adapter: curveLiquidityAaveAdapter,
|
1238
|
-
selector: lendAndStakeSelector,
|
1239
1929
|
encodedCallArgs: curveAaveLendAndStakeArgs({
|
1930
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1240
1931
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1241
1932
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1242
1933
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1243
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1244
1934
|
useUnderlyings: useUnderlyings
|
1245
|
-
})
|
1935
|
+
}),
|
1936
|
+
selector: lendAndStakeSelector
|
1246
1937
|
});
|
1247
1938
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1248
1939
|
}
|
1249
|
-
function curveAaveRedeem(
|
1250
|
-
var comptrollerProxy =
|
1251
|
-
integrationManager =
|
1252
|
-
fundOwner =
|
1253
|
-
curveLiquidityAaveAdapter =
|
1254
|
-
outgoingLPTokenAmount =
|
1255
|
-
|
1256
|
-
minIncomingAaveDaiAmount =
|
1257
|
-
|
1258
|
-
minIncomingAaveUsdcAmount =
|
1259
|
-
|
1260
|
-
minIncomingAaveUsdtAmount =
|
1261
|
-
|
1262
|
-
receiveSingleAsset =
|
1263
|
-
|
1264
|
-
useUnderlyings =
|
1940
|
+
function curveAaveRedeem(_ref12) {
|
1941
|
+
var comptrollerProxy = _ref12.comptrollerProxy,
|
1942
|
+
integrationManager = _ref12.integrationManager,
|
1943
|
+
fundOwner = _ref12.fundOwner,
|
1944
|
+
curveLiquidityAaveAdapter = _ref12.curveLiquidityAaveAdapter,
|
1945
|
+
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
1946
|
+
_ref12$minIncomingAav = _ref12.minIncomingAaveDaiAmount,
|
1947
|
+
minIncomingAaveDaiAmount = _ref12$minIncomingAav === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav,
|
1948
|
+
_ref12$minIncomingAav2 = _ref12.minIncomingAaveUsdcAmount,
|
1949
|
+
minIncomingAaveUsdcAmount = _ref12$minIncomingAav2 === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav2,
|
1950
|
+
_ref12$minIncomingAav3 = _ref12.minIncomingAaveUsdtAmount,
|
1951
|
+
minIncomingAaveUsdtAmount = _ref12$minIncomingAav3 === void 0 ? BigNumber.from(1) : _ref12$minIncomingAav3,
|
1952
|
+
_ref12$receiveSingleA = _ref12.receiveSingleAsset,
|
1953
|
+
receiveSingleAsset = _ref12$receiveSingleA === void 0 ? false : _ref12$receiveSingleA,
|
1954
|
+
_ref12$useUnderlyings = _ref12.useUnderlyings,
|
1955
|
+
useUnderlyings = _ref12$useUnderlyings === void 0 ? false : _ref12$useUnderlyings;
|
1265
1956
|
var callArgs = callOnIntegrationArgs({
|
1266
1957
|
adapter: curveLiquidityAaveAdapter,
|
1267
|
-
selector: redeemSelector,
|
1268
1958
|
encodedCallArgs: curveAaveRedeemArgs({
|
1269
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1270
1959
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1271
1960
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1272
1961
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1962
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1273
1963
|
receiveSingleAsset: receiveSingleAsset,
|
1274
1964
|
useUnderlyings: useUnderlyings
|
1275
|
-
})
|
1965
|
+
}),
|
1966
|
+
selector: redeemSelector
|
1276
1967
|
});
|
1277
1968
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1278
1969
|
}
|
1279
|
-
function curveAaveStake(
|
1280
|
-
var comptrollerProxy =
|
1281
|
-
integrationManager =
|
1282
|
-
fundOwner =
|
1283
|
-
curveLiquidityAaveAdapter =
|
1284
|
-
outgoingLPTokenAmount =
|
1970
|
+
function curveAaveStake(_ref13) {
|
1971
|
+
var comptrollerProxy = _ref13.comptrollerProxy,
|
1972
|
+
integrationManager = _ref13.integrationManager,
|
1973
|
+
fundOwner = _ref13.fundOwner,
|
1974
|
+
curveLiquidityAaveAdapter = _ref13.curveLiquidityAaveAdapter,
|
1975
|
+
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
1285
1976
|
var callArgs = callOnIntegrationArgs({
|
1286
1977
|
adapter: curveLiquidityAaveAdapter,
|
1287
|
-
selector: stakeSelector,
|
1288
1978
|
encodedCallArgs: curveAaveStakeArgs({
|
1289
1979
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1290
|
-
})
|
1980
|
+
}),
|
1981
|
+
selector: stakeSelector
|
1291
1982
|
});
|
1292
1983
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1293
1984
|
}
|
1294
|
-
function curveAaveUnstakeAndRedeem(
|
1295
|
-
var comptrollerProxy =
|
1296
|
-
integrationManager =
|
1297
|
-
fundOwner =
|
1298
|
-
curveLiquidityAaveAdapter =
|
1299
|
-
outgoingLiquidityGaugeTokenAmount =
|
1300
|
-
|
1301
|
-
minIncomingAaveDaiAmount =
|
1302
|
-
|
1303
|
-
minIncomingAaveUsdcAmount =
|
1304
|
-
|
1305
|
-
minIncomingAaveUsdtAmount =
|
1306
|
-
|
1307
|
-
receiveSingleAsset =
|
1308
|
-
|
1309
|
-
useUnderlyings =
|
1985
|
+
function curveAaveUnstakeAndRedeem(_ref14) {
|
1986
|
+
var comptrollerProxy = _ref14.comptrollerProxy,
|
1987
|
+
integrationManager = _ref14.integrationManager,
|
1988
|
+
fundOwner = _ref14.fundOwner,
|
1989
|
+
curveLiquidityAaveAdapter = _ref14.curveLiquidityAaveAdapter,
|
1990
|
+
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
1991
|
+
_ref14$minIncomingAav = _ref14.minIncomingAaveDaiAmount,
|
1992
|
+
minIncomingAaveDaiAmount = _ref14$minIncomingAav === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav,
|
1993
|
+
_ref14$minIncomingAav2 = _ref14.minIncomingAaveUsdcAmount,
|
1994
|
+
minIncomingAaveUsdcAmount = _ref14$minIncomingAav2 === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav2,
|
1995
|
+
_ref14$minIncomingAav3 = _ref14.minIncomingAaveUsdtAmount,
|
1996
|
+
minIncomingAaveUsdtAmount = _ref14$minIncomingAav3 === void 0 ? BigNumber.from(1) : _ref14$minIncomingAav3,
|
1997
|
+
_ref14$receiveSingleA = _ref14.receiveSingleAsset,
|
1998
|
+
receiveSingleAsset = _ref14$receiveSingleA === void 0 ? false : _ref14$receiveSingleA,
|
1999
|
+
_ref14$useUnderlyings = _ref14.useUnderlyings,
|
2000
|
+
useUnderlyings = _ref14$useUnderlyings === void 0 ? false : _ref14$useUnderlyings;
|
1310
2001
|
var callArgs = callOnIntegrationArgs({
|
1311
2002
|
adapter: curveLiquidityAaveAdapter,
|
1312
|
-
selector: unstakeAndRedeemSelector,
|
1313
2003
|
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
1314
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1315
2004
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1316
2005
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1317
2006
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
2007
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1318
2008
|
receiveSingleAsset: receiveSingleAsset,
|
1319
2009
|
useUnderlyings: useUnderlyings
|
1320
|
-
})
|
2010
|
+
}),
|
2011
|
+
selector: unstakeAndRedeemSelector
|
1321
2012
|
});
|
1322
2013
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1323
2014
|
}
|
1324
|
-
function curveAaveUnstake(
|
1325
|
-
var comptrollerProxy =
|
1326
|
-
integrationManager =
|
1327
|
-
fundOwner =
|
1328
|
-
curveLiquidityAaveAdapter =
|
1329
|
-
outgoingLiquidityGaugeTokenAmount =
|
2015
|
+
function curveAaveUnstake(_ref15) {
|
2016
|
+
var comptrollerProxy = _ref15.comptrollerProxy,
|
2017
|
+
integrationManager = _ref15.integrationManager,
|
2018
|
+
fundOwner = _ref15.fundOwner,
|
2019
|
+
curveLiquidityAaveAdapter = _ref15.curveLiquidityAaveAdapter,
|
2020
|
+
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
1330
2021
|
var callArgs = callOnIntegrationArgs({
|
1331
2022
|
adapter: curveLiquidityAaveAdapter,
|
1332
|
-
selector: unstakeSelector,
|
1333
2023
|
encodedCallArgs: curveAaveUnstakeArgs({
|
1334
2024
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1335
|
-
})
|
2025
|
+
}),
|
2026
|
+
selector: unstakeSelector
|
1336
2027
|
});
|
1337
2028
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1338
2029
|
} // eurs pool
|
1339
2030
|
|
1340
|
-
function curveEursClaimRewards(
|
1341
|
-
var comptrollerProxy =
|
1342
|
-
integrationManager =
|
1343
|
-
fundOwner =
|
1344
|
-
curveLiquidityEursAdapter =
|
2031
|
+
function curveEursClaimRewards(_ref16) {
|
2032
|
+
var comptrollerProxy = _ref16.comptrollerProxy,
|
2033
|
+
integrationManager = _ref16.integrationManager,
|
2034
|
+
fundOwner = _ref16.fundOwner,
|
2035
|
+
curveLiquidityEursAdapter = _ref16.curveLiquidityEursAdapter;
|
1345
2036
|
var callArgs = callOnIntegrationArgs({
|
1346
2037
|
adapter: curveLiquidityEursAdapter,
|
1347
|
-
|
1348
|
-
|
2038
|
+
encodedCallArgs: constants.HashZero,
|
2039
|
+
selector: claimRewardsSelector
|
1349
2040
|
});
|
1350
2041
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1351
2042
|
}
|
1352
|
-
function curveEursLend(
|
1353
|
-
var comptrollerProxy =
|
1354
|
-
integrationManager =
|
1355
|
-
fundOwner =
|
1356
|
-
curveLiquidityEursAdapter =
|
1357
|
-
outgoingEursAmount =
|
1358
|
-
outgoingSeurAmount =
|
1359
|
-
minIncomingLPTokenAmount =
|
2043
|
+
function curveEursLend(_ref17) {
|
2044
|
+
var comptrollerProxy = _ref17.comptrollerProxy,
|
2045
|
+
integrationManager = _ref17.integrationManager,
|
2046
|
+
fundOwner = _ref17.fundOwner,
|
2047
|
+
curveLiquidityEursAdapter = _ref17.curveLiquidityEursAdapter,
|
2048
|
+
outgoingEursAmount = _ref17.outgoingEursAmount,
|
2049
|
+
outgoingSeurAmount = _ref17.outgoingSeurAmount,
|
2050
|
+
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
1360
2051
|
var callArgs = callOnIntegrationArgs({
|
1361
2052
|
adapter: curveLiquidityEursAdapter,
|
1362
|
-
selector: lendSelector,
|
1363
2053
|
encodedCallArgs: curveEursLendArgs({
|
2054
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1364
2055
|
outgoingEursAmount: outgoingEursAmount,
|
1365
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1366
|
-
|
1367
|
-
|
2056
|
+
outgoingSeurAmount: outgoingSeurAmount
|
2057
|
+
}),
|
2058
|
+
selector: lendSelector
|
1368
2059
|
});
|
1369
2060
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1370
2061
|
}
|
1371
|
-
function curveEursLendAndStake(
|
1372
|
-
var comptrollerProxy =
|
1373
|
-
integrationManager =
|
1374
|
-
fundOwner =
|
1375
|
-
curveLiquidityEursAdapter =
|
1376
|
-
outgoingEursAmount =
|
1377
|
-
outgoingSeurAmount =
|
1378
|
-
minIncomingLiquidityGaugeTokenAmount =
|
2062
|
+
function curveEursLendAndStake(_ref18) {
|
2063
|
+
var comptrollerProxy = _ref18.comptrollerProxy,
|
2064
|
+
integrationManager = _ref18.integrationManager,
|
2065
|
+
fundOwner = _ref18.fundOwner,
|
2066
|
+
curveLiquidityEursAdapter = _ref18.curveLiquidityEursAdapter,
|
2067
|
+
outgoingEursAmount = _ref18.outgoingEursAmount,
|
2068
|
+
outgoingSeurAmount = _ref18.outgoingSeurAmount,
|
2069
|
+
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
1379
2070
|
var callArgs = callOnIntegrationArgs({
|
1380
2071
|
adapter: curveLiquidityEursAdapter,
|
1381
|
-
selector: lendAndStakeSelector,
|
1382
2072
|
encodedCallArgs: curveEursLendAndStakeArgs({
|
2073
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1383
2074
|
outgoingEursAmount: outgoingEursAmount,
|
1384
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1385
|
-
|
1386
|
-
|
2075
|
+
outgoingSeurAmount: outgoingSeurAmount
|
2076
|
+
}),
|
2077
|
+
selector: lendAndStakeSelector
|
1387
2078
|
});
|
1388
2079
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1389
2080
|
}
|
1390
|
-
function curveEursRedeem(
|
1391
|
-
var comptrollerProxy =
|
1392
|
-
integrationManager =
|
1393
|
-
fundOwner =
|
1394
|
-
curveLiquidityEursAdapter =
|
1395
|
-
outgoingLPTokenAmount =
|
1396
|
-
minIncomingEursAmount =
|
1397
|
-
minIncomingSeurAmount =
|
1398
|
-
receiveSingleAsset =
|
2081
|
+
function curveEursRedeem(_ref19) {
|
2082
|
+
var comptrollerProxy = _ref19.comptrollerProxy,
|
2083
|
+
integrationManager = _ref19.integrationManager,
|
2084
|
+
fundOwner = _ref19.fundOwner,
|
2085
|
+
curveLiquidityEursAdapter = _ref19.curveLiquidityEursAdapter,
|
2086
|
+
outgoingLPTokenAmount = _ref19.outgoingLPTokenAmount,
|
2087
|
+
minIncomingEursAmount = _ref19.minIncomingEursAmount,
|
2088
|
+
minIncomingSeurAmount = _ref19.minIncomingSeurAmount,
|
2089
|
+
receiveSingleAsset = _ref19.receiveSingleAsset;
|
1399
2090
|
var callArgs = callOnIntegrationArgs({
|
1400
2091
|
adapter: curveLiquidityEursAdapter,
|
1401
|
-
selector: redeemSelector,
|
1402
2092
|
encodedCallArgs: curveEursRedeemArgs({
|
1403
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1404
2093
|
minIncomingEursAmount: minIncomingEursAmount,
|
1405
2094
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
2095
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1406
2096
|
receiveSingleAsset: receiveSingleAsset
|
1407
|
-
})
|
2097
|
+
}),
|
2098
|
+
selector: redeemSelector
|
1408
2099
|
});
|
1409
2100
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1410
2101
|
}
|
1411
|
-
function curveEursStake(
|
1412
|
-
var comptrollerProxy =
|
1413
|
-
integrationManager =
|
1414
|
-
fundOwner =
|
1415
|
-
curveLiquidityEursAdapter =
|
1416
|
-
outgoingLPTokenAmount =
|
2102
|
+
function curveEursStake(_ref20) {
|
2103
|
+
var comptrollerProxy = _ref20.comptrollerProxy,
|
2104
|
+
integrationManager = _ref20.integrationManager,
|
2105
|
+
fundOwner = _ref20.fundOwner,
|
2106
|
+
curveLiquidityEursAdapter = _ref20.curveLiquidityEursAdapter,
|
2107
|
+
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
1417
2108
|
var callArgs = callOnIntegrationArgs({
|
1418
2109
|
adapter: curveLiquidityEursAdapter,
|
1419
|
-
selector: stakeSelector,
|
1420
2110
|
encodedCallArgs: curveEursStakeArgs({
|
1421
2111
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1422
|
-
})
|
2112
|
+
}),
|
2113
|
+
selector: stakeSelector
|
1423
2114
|
});
|
1424
2115
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1425
2116
|
}
|
1426
|
-
function curveEursUnstakeAndRedeem(
|
1427
|
-
var comptrollerProxy =
|
1428
|
-
integrationManager =
|
1429
|
-
fundOwner =
|
1430
|
-
curveLiquidityEursAdapter =
|
1431
|
-
outgoingLiquidityGaugeTokenAmount =
|
1432
|
-
minIncomingEursAmount =
|
1433
|
-
minIncomingSeurAmount =
|
1434
|
-
receiveSingleAsset =
|
2117
|
+
function curveEursUnstakeAndRedeem(_ref21) {
|
2118
|
+
var comptrollerProxy = _ref21.comptrollerProxy,
|
2119
|
+
integrationManager = _ref21.integrationManager,
|
2120
|
+
fundOwner = _ref21.fundOwner,
|
2121
|
+
curveLiquidityEursAdapter = _ref21.curveLiquidityEursAdapter,
|
2122
|
+
outgoingLiquidityGaugeTokenAmount = _ref21.outgoingLiquidityGaugeTokenAmount,
|
2123
|
+
minIncomingEursAmount = _ref21.minIncomingEursAmount,
|
2124
|
+
minIncomingSeurAmount = _ref21.minIncomingSeurAmount,
|
2125
|
+
receiveSingleAsset = _ref21.receiveSingleAsset;
|
1435
2126
|
var callArgs = callOnIntegrationArgs({
|
1436
2127
|
adapter: curveLiquidityEursAdapter,
|
1437
|
-
selector: unstakeAndRedeemSelector,
|
1438
2128
|
encodedCallArgs: curveEursUnstakeAndRedeemArgs({
|
1439
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1440
2129
|
minIncomingEursAmount: minIncomingEursAmount,
|
1441
2130
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
2131
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1442
2132
|
receiveSingleAsset: receiveSingleAsset
|
1443
|
-
})
|
2133
|
+
}),
|
2134
|
+
selector: unstakeAndRedeemSelector
|
1444
2135
|
});
|
1445
2136
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1446
2137
|
}
|
1447
|
-
function curveEursUnstake(
|
1448
|
-
var comptrollerProxy =
|
1449
|
-
integrationManager =
|
1450
|
-
fundOwner =
|
1451
|
-
curveLiquidityEursAdapter =
|
1452
|
-
outgoingLiquidityGaugeTokenAmount =
|
2138
|
+
function curveEursUnstake(_ref22) {
|
2139
|
+
var comptrollerProxy = _ref22.comptrollerProxy,
|
2140
|
+
integrationManager = _ref22.integrationManager,
|
2141
|
+
fundOwner = _ref22.fundOwner,
|
2142
|
+
curveLiquidityEursAdapter = _ref22.curveLiquidityEursAdapter,
|
2143
|
+
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
1453
2144
|
var callArgs = callOnIntegrationArgs({
|
1454
2145
|
adapter: curveLiquidityEursAdapter,
|
1455
|
-
selector: unstakeSelector,
|
1456
2146
|
encodedCallArgs: curveEursUnstakeArgs({
|
1457
2147
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1458
|
-
})
|
2148
|
+
}),
|
2149
|
+
selector: unstakeSelector
|
1459
2150
|
});
|
1460
2151
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1461
2152
|
} // sETH pool
|
1462
2153
|
|
1463
|
-
function curveSethClaimRewards(
|
1464
|
-
var comptrollerProxy =
|
1465
|
-
integrationManager =
|
1466
|
-
fundOwner =
|
1467
|
-
curveLiquiditySethAdapter =
|
2154
|
+
function curveSethClaimRewards(_ref23) {
|
2155
|
+
var comptrollerProxy = _ref23.comptrollerProxy,
|
2156
|
+
integrationManager = _ref23.integrationManager,
|
2157
|
+
fundOwner = _ref23.fundOwner,
|
2158
|
+
curveLiquiditySethAdapter = _ref23.curveLiquiditySethAdapter;
|
1468
2159
|
var callArgs = callOnIntegrationArgs({
|
1469
2160
|
adapter: curveLiquiditySethAdapter,
|
1470
|
-
|
1471
|
-
|
2161
|
+
encodedCallArgs: constants.HashZero,
|
2162
|
+
selector: claimRewardsSelector
|
1472
2163
|
});
|
1473
2164
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1474
2165
|
}
|
1475
|
-
function curveSethLend(
|
1476
|
-
var comptrollerProxy =
|
1477
|
-
integrationManager =
|
1478
|
-
fundOwner =
|
1479
|
-
curveLiquiditySethAdapter =
|
1480
|
-
outgoingWethAmount =
|
1481
|
-
outgoingSethAmount =
|
1482
|
-
minIncomingLPTokenAmount =
|
2166
|
+
function curveSethLend(_ref24) {
|
2167
|
+
var comptrollerProxy = _ref24.comptrollerProxy,
|
2168
|
+
integrationManager = _ref24.integrationManager,
|
2169
|
+
fundOwner = _ref24.fundOwner,
|
2170
|
+
curveLiquiditySethAdapter = _ref24.curveLiquiditySethAdapter,
|
2171
|
+
outgoingWethAmount = _ref24.outgoingWethAmount,
|
2172
|
+
outgoingSethAmount = _ref24.outgoingSethAmount,
|
2173
|
+
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
1483
2174
|
var callArgs = callOnIntegrationArgs({
|
1484
2175
|
adapter: curveLiquiditySethAdapter,
|
1485
|
-
selector: lendSelector,
|
1486
2176
|
encodedCallArgs: curveSethLendArgs({
|
1487
|
-
|
2177
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1488
2178
|
outgoingSethAmount: outgoingSethAmount,
|
1489
|
-
|
1490
|
-
})
|
2179
|
+
outgoingWethAmount: outgoingWethAmount
|
2180
|
+
}),
|
2181
|
+
selector: lendSelector
|
1491
2182
|
});
|
1492
2183
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1493
2184
|
}
|
1494
|
-
function curveSethLendAndStake(
|
1495
|
-
var comptrollerProxy =
|
1496
|
-
integrationManager =
|
1497
|
-
fundOwner =
|
1498
|
-
curveLiquiditySethAdapter =
|
1499
|
-
outgoingWethAmount =
|
1500
|
-
outgoingSethAmount =
|
1501
|
-
minIncomingLiquidityGaugeTokenAmount =
|
2185
|
+
function curveSethLendAndStake(_ref25) {
|
2186
|
+
var comptrollerProxy = _ref25.comptrollerProxy,
|
2187
|
+
integrationManager = _ref25.integrationManager,
|
2188
|
+
fundOwner = _ref25.fundOwner,
|
2189
|
+
curveLiquiditySethAdapter = _ref25.curveLiquiditySethAdapter,
|
2190
|
+
outgoingWethAmount = _ref25.outgoingWethAmount,
|
2191
|
+
outgoingSethAmount = _ref25.outgoingSethAmount,
|
2192
|
+
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
1502
2193
|
var callArgs = callOnIntegrationArgs({
|
1503
2194
|
adapter: curveLiquiditySethAdapter,
|
1504
|
-
selector: lendAndStakeSelector,
|
1505
2195
|
encodedCallArgs: curveSethLendAndStakeArgs({
|
1506
|
-
|
2196
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1507
2197
|
outgoingSethAmount: outgoingSethAmount,
|
1508
|
-
|
1509
|
-
})
|
2198
|
+
outgoingWethAmount: outgoingWethAmount
|
2199
|
+
}),
|
2200
|
+
selector: lendAndStakeSelector
|
1510
2201
|
});
|
1511
2202
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1512
2203
|
}
|
1513
|
-
function curveSethRedeem(
|
1514
|
-
var comptrollerProxy =
|
1515
|
-
integrationManager =
|
1516
|
-
fundOwner =
|
1517
|
-
curveLiquiditySethAdapter =
|
1518
|
-
outgoingLPTokenAmount =
|
1519
|
-
minIncomingWethAmount =
|
1520
|
-
minIncomingSethAmount =
|
1521
|
-
receiveSingleAsset =
|
2204
|
+
function curveSethRedeem(_ref26) {
|
2205
|
+
var comptrollerProxy = _ref26.comptrollerProxy,
|
2206
|
+
integrationManager = _ref26.integrationManager,
|
2207
|
+
fundOwner = _ref26.fundOwner,
|
2208
|
+
curveLiquiditySethAdapter = _ref26.curveLiquiditySethAdapter,
|
2209
|
+
outgoingLPTokenAmount = _ref26.outgoingLPTokenAmount,
|
2210
|
+
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
2211
|
+
minIncomingSethAmount = _ref26.minIncomingSethAmount,
|
2212
|
+
receiveSingleAsset = _ref26.receiveSingleAsset;
|
1522
2213
|
var callArgs = callOnIntegrationArgs({
|
1523
2214
|
adapter: curveLiquiditySethAdapter,
|
1524
|
-
selector: redeemSelector,
|
1525
2215
|
encodedCallArgs: curveSethRedeemArgs({
|
1526
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1527
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1528
2216
|
minIncomingSethAmount: minIncomingSethAmount,
|
2217
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2218
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1529
2219
|
receiveSingleAsset: receiveSingleAsset
|
1530
|
-
})
|
2220
|
+
}),
|
2221
|
+
selector: redeemSelector
|
1531
2222
|
});
|
1532
2223
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1533
2224
|
}
|
1534
|
-
function curveSethStake(
|
1535
|
-
var comptrollerProxy =
|
1536
|
-
integrationManager =
|
1537
|
-
fundOwner =
|
1538
|
-
curveLiquiditySethAdapter =
|
1539
|
-
outgoingLPTokenAmount =
|
2225
|
+
function curveSethStake(_ref27) {
|
2226
|
+
var comptrollerProxy = _ref27.comptrollerProxy,
|
2227
|
+
integrationManager = _ref27.integrationManager,
|
2228
|
+
fundOwner = _ref27.fundOwner,
|
2229
|
+
curveLiquiditySethAdapter = _ref27.curveLiquiditySethAdapter,
|
2230
|
+
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
1540
2231
|
var callArgs = callOnIntegrationArgs({
|
1541
2232
|
adapter: curveLiquiditySethAdapter,
|
1542
|
-
selector: stakeSelector,
|
1543
2233
|
encodedCallArgs: curveSethStakeArgs({
|
1544
2234
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1545
|
-
})
|
2235
|
+
}),
|
2236
|
+
selector: stakeSelector
|
1546
2237
|
});
|
1547
2238
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1548
2239
|
}
|
1549
|
-
function curveSethUnstakeAndRedeem(
|
1550
|
-
var comptrollerProxy =
|
1551
|
-
integrationManager =
|
1552
|
-
fundOwner =
|
1553
|
-
curveLiquiditySethAdapter =
|
1554
|
-
outgoingLiquidityGaugeTokenAmount =
|
1555
|
-
minIncomingWethAmount =
|
1556
|
-
minIncomingSethAmount =
|
1557
|
-
receiveSingleAsset =
|
2240
|
+
function curveSethUnstakeAndRedeem(_ref28) {
|
2241
|
+
var comptrollerProxy = _ref28.comptrollerProxy,
|
2242
|
+
integrationManager = _ref28.integrationManager,
|
2243
|
+
fundOwner = _ref28.fundOwner,
|
2244
|
+
curveLiquiditySethAdapter = _ref28.curveLiquiditySethAdapter,
|
2245
|
+
outgoingLiquidityGaugeTokenAmount = _ref28.outgoingLiquidityGaugeTokenAmount,
|
2246
|
+
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
2247
|
+
minIncomingSethAmount = _ref28.minIncomingSethAmount,
|
2248
|
+
receiveSingleAsset = _ref28.receiveSingleAsset;
|
1558
2249
|
var callArgs = callOnIntegrationArgs({
|
1559
2250
|
adapter: curveLiquiditySethAdapter,
|
1560
|
-
selector: unstakeAndRedeemSelector,
|
1561
2251
|
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
1562
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1563
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1564
2252
|
minIncomingSethAmount: minIncomingSethAmount,
|
2253
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2254
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1565
2255
|
receiveSingleAsset: receiveSingleAsset
|
1566
|
-
})
|
2256
|
+
}),
|
2257
|
+
selector: unstakeAndRedeemSelector
|
1567
2258
|
});
|
1568
2259
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1569
2260
|
}
|
1570
|
-
function curveSethUnstake(
|
1571
|
-
var comptrollerProxy =
|
1572
|
-
integrationManager =
|
1573
|
-
fundOwner =
|
1574
|
-
curveLiquiditySethAdapter =
|
1575
|
-
outgoingLiquidityGaugeTokenAmount =
|
2261
|
+
function curveSethUnstake(_ref29) {
|
2262
|
+
var comptrollerProxy = _ref29.comptrollerProxy,
|
2263
|
+
integrationManager = _ref29.integrationManager,
|
2264
|
+
fundOwner = _ref29.fundOwner,
|
2265
|
+
curveLiquiditySethAdapter = _ref29.curveLiquiditySethAdapter,
|
2266
|
+
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
1576
2267
|
var callArgs = callOnIntegrationArgs({
|
1577
2268
|
adapter: curveLiquiditySethAdapter,
|
1578
|
-
selector: unstakeSelector,
|
1579
2269
|
encodedCallArgs: curveSethUnstakeArgs({
|
1580
2270
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1581
|
-
})
|
2271
|
+
}),
|
2272
|
+
selector: unstakeSelector
|
1582
2273
|
});
|
1583
2274
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1584
2275
|
} // stETH pool
|
1585
2276
|
|
1586
|
-
function curveStethClaimRewards(
|
1587
|
-
var comptrollerProxy =
|
1588
|
-
integrationManager =
|
1589
|
-
fundOwner =
|
1590
|
-
curveLiquidityStethAdapter =
|
2277
|
+
function curveStethClaimRewards(_ref30) {
|
2278
|
+
var comptrollerProxy = _ref30.comptrollerProxy,
|
2279
|
+
integrationManager = _ref30.integrationManager,
|
2280
|
+
fundOwner = _ref30.fundOwner,
|
2281
|
+
curveLiquidityStethAdapter = _ref30.curveLiquidityStethAdapter;
|
1591
2282
|
var callArgs = callOnIntegrationArgs({
|
1592
2283
|
adapter: curveLiquidityStethAdapter,
|
1593
|
-
|
1594
|
-
|
2284
|
+
encodedCallArgs: constants.HashZero,
|
2285
|
+
selector: claimRewardsSelector
|
1595
2286
|
});
|
1596
2287
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1597
2288
|
}
|
1598
|
-
function curveStethLend(
|
1599
|
-
var comptrollerProxy =
|
1600
|
-
integrationManager =
|
1601
|
-
fundOwner =
|
1602
|
-
curveLiquidityStethAdapter =
|
1603
|
-
outgoingWethAmount =
|
1604
|
-
outgoingStethAmount =
|
1605
|
-
minIncomingLPTokenAmount =
|
2289
|
+
function curveStethLend(_ref31) {
|
2290
|
+
var comptrollerProxy = _ref31.comptrollerProxy,
|
2291
|
+
integrationManager = _ref31.integrationManager,
|
2292
|
+
fundOwner = _ref31.fundOwner,
|
2293
|
+
curveLiquidityStethAdapter = _ref31.curveLiquidityStethAdapter,
|
2294
|
+
outgoingWethAmount = _ref31.outgoingWethAmount,
|
2295
|
+
outgoingStethAmount = _ref31.outgoingStethAmount,
|
2296
|
+
minIncomingLPTokenAmount = _ref31.minIncomingLPTokenAmount;
|
1606
2297
|
var callArgs = callOnIntegrationArgs({
|
1607
2298
|
adapter: curveLiquidityStethAdapter,
|
1608
|
-
selector: lendSelector,
|
1609
2299
|
encodedCallArgs: curveStethLendArgs({
|
1610
|
-
|
2300
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1611
2301
|
outgoingStethAmount: outgoingStethAmount,
|
1612
|
-
|
1613
|
-
})
|
2302
|
+
outgoingWethAmount: outgoingWethAmount
|
2303
|
+
}),
|
2304
|
+
selector: lendSelector
|
1614
2305
|
});
|
1615
2306
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1616
2307
|
}
|
1617
|
-
function curveStethLendAndStake(
|
1618
|
-
var comptrollerProxy =
|
1619
|
-
integrationManager =
|
1620
|
-
fundOwner =
|
1621
|
-
curveLiquidityStethAdapter =
|
1622
|
-
outgoingWethAmount =
|
1623
|
-
outgoingStethAmount =
|
1624
|
-
minIncomingLiquidityGaugeTokenAmount =
|
2308
|
+
function curveStethLendAndStake(_ref32) {
|
2309
|
+
var comptrollerProxy = _ref32.comptrollerProxy,
|
2310
|
+
integrationManager = _ref32.integrationManager,
|
2311
|
+
fundOwner = _ref32.fundOwner,
|
2312
|
+
curveLiquidityStethAdapter = _ref32.curveLiquidityStethAdapter,
|
2313
|
+
outgoingWethAmount = _ref32.outgoingWethAmount,
|
2314
|
+
outgoingStethAmount = _ref32.outgoingStethAmount,
|
2315
|
+
minIncomingLiquidityGaugeTokenAmount = _ref32.minIncomingLiquidityGaugeTokenAmount;
|
1625
2316
|
var callArgs = callOnIntegrationArgs({
|
1626
2317
|
adapter: curveLiquidityStethAdapter,
|
1627
|
-
selector: lendAndStakeSelector,
|
1628
2318
|
encodedCallArgs: curveStethLendAndStakeArgs({
|
1629
|
-
|
2319
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1630
2320
|
outgoingStethAmount: outgoingStethAmount,
|
1631
|
-
|
1632
|
-
})
|
2321
|
+
outgoingWethAmount: outgoingWethAmount
|
2322
|
+
}),
|
2323
|
+
selector: lendAndStakeSelector
|
1633
2324
|
});
|
1634
2325
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1635
2326
|
}
|
1636
|
-
function curveStethRedeem(
|
1637
|
-
var comptrollerProxy =
|
1638
|
-
integrationManager =
|
1639
|
-
fundOwner =
|
1640
|
-
curveLiquidityStethAdapter =
|
1641
|
-
outgoingLPTokenAmount =
|
1642
|
-
minIncomingWethAmount =
|
1643
|
-
minIncomingStethAmount =
|
1644
|
-
receiveSingleAsset =
|
2327
|
+
function curveStethRedeem(_ref33) {
|
2328
|
+
var comptrollerProxy = _ref33.comptrollerProxy,
|
2329
|
+
integrationManager = _ref33.integrationManager,
|
2330
|
+
fundOwner = _ref33.fundOwner,
|
2331
|
+
curveLiquidityStethAdapter = _ref33.curveLiquidityStethAdapter,
|
2332
|
+
outgoingLPTokenAmount = _ref33.outgoingLPTokenAmount,
|
2333
|
+
minIncomingWethAmount = _ref33.minIncomingWethAmount,
|
2334
|
+
minIncomingStethAmount = _ref33.minIncomingStethAmount,
|
2335
|
+
receiveSingleAsset = _ref33.receiveSingleAsset;
|
1645
2336
|
var callArgs = callOnIntegrationArgs({
|
1646
2337
|
adapter: curveLiquidityStethAdapter,
|
1647
|
-
selector: redeemSelector,
|
1648
2338
|
encodedCallArgs: curveStethRedeemArgs({
|
1649
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1650
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1651
2339
|
minIncomingStethAmount: minIncomingStethAmount,
|
2340
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2341
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1652
2342
|
receiveSingleAsset: receiveSingleAsset
|
1653
|
-
})
|
2343
|
+
}),
|
2344
|
+
selector: redeemSelector
|
1654
2345
|
});
|
1655
2346
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1656
2347
|
}
|
1657
|
-
function curveStethStake(
|
1658
|
-
var comptrollerProxy =
|
1659
|
-
integrationManager =
|
1660
|
-
fundOwner =
|
1661
|
-
curveLiquidityStethAdapter =
|
1662
|
-
outgoingLPTokenAmount =
|
2348
|
+
function curveStethStake(_ref34) {
|
2349
|
+
var comptrollerProxy = _ref34.comptrollerProxy,
|
2350
|
+
integrationManager = _ref34.integrationManager,
|
2351
|
+
fundOwner = _ref34.fundOwner,
|
2352
|
+
curveLiquidityStethAdapter = _ref34.curveLiquidityStethAdapter,
|
2353
|
+
outgoingLPTokenAmount = _ref34.outgoingLPTokenAmount;
|
1663
2354
|
var callArgs = callOnIntegrationArgs({
|
1664
2355
|
adapter: curveLiquidityStethAdapter,
|
1665
|
-
selector: stakeSelector,
|
1666
2356
|
encodedCallArgs: curveStethStakeArgs({
|
1667
2357
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1668
|
-
})
|
2358
|
+
}),
|
2359
|
+
selector: stakeSelector
|
1669
2360
|
});
|
1670
2361
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1671
2362
|
}
|
1672
|
-
function curveStethUnstakeAndRedeem(
|
1673
|
-
var comptrollerProxy =
|
1674
|
-
integrationManager =
|
1675
|
-
fundOwner =
|
1676
|
-
curveLiquidityStethAdapter =
|
1677
|
-
outgoingLiquidityGaugeTokenAmount =
|
1678
|
-
minIncomingWethAmount =
|
1679
|
-
minIncomingStethAmount =
|
1680
|
-
receiveSingleAsset =
|
2363
|
+
function curveStethUnstakeAndRedeem(_ref35) {
|
2364
|
+
var comptrollerProxy = _ref35.comptrollerProxy,
|
2365
|
+
integrationManager = _ref35.integrationManager,
|
2366
|
+
fundOwner = _ref35.fundOwner,
|
2367
|
+
curveLiquidityStethAdapter = _ref35.curveLiquidityStethAdapter,
|
2368
|
+
outgoingLiquidityGaugeTokenAmount = _ref35.outgoingLiquidityGaugeTokenAmount,
|
2369
|
+
minIncomingWethAmount = _ref35.minIncomingWethAmount,
|
2370
|
+
minIncomingStethAmount = _ref35.minIncomingStethAmount,
|
2371
|
+
receiveSingleAsset = _ref35.receiveSingleAsset;
|
1681
2372
|
var callArgs = callOnIntegrationArgs({
|
1682
2373
|
adapter: curveLiquidityStethAdapter,
|
1683
|
-
selector: unstakeAndRedeemSelector,
|
1684
2374
|
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
1685
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1686
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1687
2375
|
minIncomingStethAmount: minIncomingStethAmount,
|
2376
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2377
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1688
2378
|
receiveSingleAsset: receiveSingleAsset
|
1689
|
-
})
|
2379
|
+
}),
|
2380
|
+
selector: unstakeAndRedeemSelector
|
1690
2381
|
});
|
1691
2382
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1692
2383
|
}
|
1693
|
-
function curveStethUnstake(
|
1694
|
-
var comptrollerProxy =
|
1695
|
-
integrationManager =
|
1696
|
-
fundOwner =
|
1697
|
-
curveLiquidityStethAdapter =
|
1698
|
-
outgoingLiquidityGaugeTokenAmount =
|
2384
|
+
function curveStethUnstake(_ref36) {
|
2385
|
+
var comptrollerProxy = _ref36.comptrollerProxy,
|
2386
|
+
integrationManager = _ref36.integrationManager,
|
2387
|
+
fundOwner = _ref36.fundOwner,
|
2388
|
+
curveLiquidityStethAdapter = _ref36.curveLiquidityStethAdapter,
|
2389
|
+
outgoingLiquidityGaugeTokenAmount = _ref36.outgoingLiquidityGaugeTokenAmount;
|
1699
2390
|
var callArgs = callOnIntegrationArgs({
|
1700
2391
|
adapter: curveLiquidityStethAdapter,
|
1701
|
-
selector: unstakeSelector,
|
1702
2392
|
encodedCallArgs: curveStethUnstakeArgs({
|
1703
2393
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1704
|
-
})
|
2394
|
+
}),
|
2395
|
+
selector: unstakeSelector
|
1705
2396
|
});
|
1706
2397
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1707
2398
|
}
|
@@ -1720,10 +2411,10 @@ function _idleClaimRewards() {
|
|
1720
2411
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
1721
2412
|
callArgs = callOnIntegrationArgs({
|
1722
2413
|
adapter: idleAdapter,
|
1723
|
-
selector: claimRewardsSelector,
|
1724
2414
|
encodedCallArgs: idleClaimRewardsArgs({
|
1725
2415
|
idleToken: idleToken
|
1726
|
-
})
|
2416
|
+
}),
|
2417
|
+
selector: claimRewardsSelector
|
1727
2418
|
});
|
1728
2419
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1729
2420
|
|
@@ -1752,12 +2443,12 @@ function _idleLend() {
|
|
1752
2443
|
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;
|
1753
2444
|
callArgs = callOnIntegrationArgs({
|
1754
2445
|
adapter: idleAdapter,
|
1755
|
-
selector: lendSelector,
|
1756
2446
|
encodedCallArgs: idleLendArgs({
|
1757
2447
|
idleToken: idleToken,
|
1758
|
-
|
1759
|
-
|
1760
|
-
})
|
2448
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
2449
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
2450
|
+
}),
|
2451
|
+
selector: lendSelector
|
1761
2452
|
});
|
1762
2453
|
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1763
2454
|
|
@@ -1786,12 +2477,12 @@ function _idleRedeem() {
|
|
1786
2477
|
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;
|
1787
2478
|
callArgs = callOnIntegrationArgs({
|
1788
2479
|
adapter: idleAdapter,
|
1789
|
-
selector: redeemSelector,
|
1790
2480
|
encodedCallArgs: idleRedeemArgs({
|
1791
2481
|
idleToken: idleToken,
|
1792
|
-
|
1793
|
-
|
1794
|
-
})
|
2482
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2483
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
2484
|
+
}),
|
2485
|
+
selector: redeemSelector
|
1795
2486
|
});
|
1796
2487
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1797
2488
|
|
@@ -1862,17 +2553,17 @@ function _mockGenericSwap() {
|
|
1862
2553
|
|
1863
2554
|
case 9:
|
1864
2555
|
swapArgs = mockGenericSwapArgs({
|
1865
|
-
|
1866
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2556
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
1867
2557
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
1868
2558
|
incomingAssets: incomingAssets,
|
2559
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
1869
2560
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
1870
|
-
|
2561
|
+
spendAssets: spendAssets
|
1871
2562
|
});
|
1872
2563
|
callArgs = callOnIntegrationArgs({
|
1873
2564
|
adapter: mockGenericAdapter,
|
1874
|
-
|
1875
|
-
|
2565
|
+
encodedCallArgs: swapArgs,
|
2566
|
+
selector: selector
|
1876
2567
|
});
|
1877
2568
|
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1878
2569
|
_context.next = 14;
|
@@ -1891,14 +2582,80 @@ function _mockGenericSwap() {
|
|
1891
2582
|
return _mockGenericSwap.apply(this, arguments);
|
1892
2583
|
}
|
1893
2584
|
|
2585
|
+
function olympusV2Stake(_x) {
|
2586
|
+
return _olympusV2Stake.apply(this, arguments);
|
2587
|
+
}
|
2588
|
+
|
2589
|
+
function _olympusV2Stake() {
|
2590
|
+
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2591
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
2592
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2593
|
+
while (1) {
|
2594
|
+
switch (_context.prev = _context.next) {
|
2595
|
+
case 0:
|
2596
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
2597
|
+
stakeArgs = olympusV2StakeArgs({
|
2598
|
+
amount: amount
|
2599
|
+
});
|
2600
|
+
callArgs = callOnIntegrationArgs({
|
2601
|
+
adapter: olympusV2Adapter,
|
2602
|
+
encodedCallArgs: stakeArgs,
|
2603
|
+
selector: stakeSelector
|
2604
|
+
});
|
2605
|
+
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2606
|
+
return _context.abrupt("return", stakeTx);
|
2607
|
+
|
2608
|
+
case 5:
|
2609
|
+
case "end":
|
2610
|
+
return _context.stop();
|
2611
|
+
}
|
2612
|
+
}
|
2613
|
+
}, _callee);
|
2614
|
+
}));
|
2615
|
+
return _olympusV2Stake.apply(this, arguments);
|
2616
|
+
}
|
2617
|
+
|
2618
|
+
function olympusV2Unstake(_x2) {
|
2619
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2620
|
+
}
|
2621
|
+
|
2622
|
+
function _olympusV2Unstake() {
|
2623
|
+
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2624
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
2625
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2626
|
+
while (1) {
|
2627
|
+
switch (_context2.prev = _context2.next) {
|
2628
|
+
case 0:
|
2629
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
2630
|
+
unstakeArgs = olympusV2UnstakeArgs({
|
2631
|
+
amount: amount
|
2632
|
+
});
|
2633
|
+
callArgs = callOnIntegrationArgs({
|
2634
|
+
adapter: olympusV2Adapter,
|
2635
|
+
encodedCallArgs: unstakeArgs,
|
2636
|
+
selector: unstakeSelector
|
2637
|
+
});
|
2638
|
+
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2639
|
+
return _context2.abrupt("return", unstakeTx);
|
2640
|
+
|
2641
|
+
case 5:
|
2642
|
+
case "end":
|
2643
|
+
return _context2.stop();
|
2644
|
+
}
|
2645
|
+
}
|
2646
|
+
}, _callee2);
|
2647
|
+
}));
|
2648
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2649
|
+
}
|
2650
|
+
|
1894
2651
|
function paraSwapV4GenerateDummyPaths(_ref) {
|
1895
2652
|
var toTokens = _ref.toTokens;
|
1896
2653
|
return toTokens.map(function (toToken) {
|
1897
2654
|
return {
|
1898
|
-
to: toToken,
|
1899
|
-
totalNetworkFee: 0,
|
1900
2655
|
// Not supported in our protocol
|
1901
|
-
routes: []
|
2656
|
+
routes: [],
|
2657
|
+
to: toToken,
|
2658
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
1902
2659
|
|
1903
2660
|
};
|
1904
2661
|
});
|
@@ -1917,16 +2674,16 @@ function _paraSwapV4TakeOrder() {
|
|
1917
2674
|
case 0:
|
1918
2675
|
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;
|
1919
2676
|
takeOrderArgs = paraSwapV4TakeOrderArgs({
|
1920
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
1921
2677
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2678
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1922
2679
|
outgoingAsset: outgoingAsset,
|
1923
2680
|
outgoingAssetAmount: outgoingAssetAmount,
|
1924
2681
|
paths: paths
|
1925
2682
|
});
|
1926
2683
|
callArgs = callOnIntegrationArgs({
|
1927
2684
|
adapter: paraSwapV4Adapter,
|
1928
|
-
|
1929
|
-
|
2685
|
+
encodedCallArgs: takeOrderArgs,
|
2686
|
+
selector: takeOrderSelector
|
1930
2687
|
});
|
1931
2688
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1932
2689
|
|
@@ -1940,6 +2697,161 @@ function _paraSwapV4TakeOrder() {
|
|
1940
2697
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
1941
2698
|
}
|
1942
2699
|
|
2700
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
2701
|
+
var toTokens = _ref.toTokens;
|
2702
|
+
return toTokens.map(function (toToken) {
|
2703
|
+
return {
|
2704
|
+
// Not supported in our protocol
|
2705
|
+
adapters: [],
|
2706
|
+
to: toToken,
|
2707
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2708
|
+
|
2709
|
+
};
|
2710
|
+
});
|
2711
|
+
}
|
2712
|
+
function paraSwapV5TakeOrder(_x) {
|
2713
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2714
|
+
}
|
2715
|
+
|
2716
|
+
function _paraSwapV5TakeOrder() {
|
2717
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
2718
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
2719
|
+
|
2720
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2721
|
+
while (1) {
|
2722
|
+
switch (_context.prev = _context.next) {
|
2723
|
+
case 0:
|
2724
|
+
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;
|
2725
|
+
takeOrderArgs = paraSwapV5TakeOrderArgs({
|
2726
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2727
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2728
|
+
outgoingAsset: outgoingAsset,
|
2729
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
2730
|
+
paths: paths,
|
2731
|
+
uuid: uuid
|
2732
|
+
});
|
2733
|
+
callArgs = callOnIntegrationArgs({
|
2734
|
+
adapter: paraSwapV5Adapter,
|
2735
|
+
encodedCallArgs: takeOrderArgs,
|
2736
|
+
selector: takeOrderSelector
|
2737
|
+
});
|
2738
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2739
|
+
|
2740
|
+
case 4:
|
2741
|
+
case "end":
|
2742
|
+
return _context.stop();
|
2743
|
+
}
|
2744
|
+
}
|
2745
|
+
}, _callee);
|
2746
|
+
}));
|
2747
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2748
|
+
}
|
2749
|
+
|
2750
|
+
function poolTogetherV4Lend(_x) {
|
2751
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2752
|
+
}
|
2753
|
+
|
2754
|
+
function _poolTogetherV4Lend() {
|
2755
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2756
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
2757
|
+
|
2758
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2759
|
+
while (1) {
|
2760
|
+
switch (_context.prev = _context.next) {
|
2761
|
+
case 0:
|
2762
|
+
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;
|
2763
|
+
lendArgs = poolTogetherV4LendArgs({
|
2764
|
+
amount: amount,
|
2765
|
+
ptToken: ptToken
|
2766
|
+
});
|
2767
|
+
callArgs = callOnIntegrationArgs({
|
2768
|
+
adapter: poolTogetherV4Adapter,
|
2769
|
+
encodedCallArgs: lendArgs,
|
2770
|
+
selector: lendSelector
|
2771
|
+
});
|
2772
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2773
|
+
return _context.abrupt("return", lendTx);
|
2774
|
+
|
2775
|
+
case 5:
|
2776
|
+
case "end":
|
2777
|
+
return _context.stop();
|
2778
|
+
}
|
2779
|
+
}
|
2780
|
+
}, _callee);
|
2781
|
+
}));
|
2782
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2783
|
+
}
|
2784
|
+
|
2785
|
+
function poolTogetherV4Redeem(_x2) {
|
2786
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2787
|
+
}
|
2788
|
+
|
2789
|
+
function _poolTogetherV4Redeem() {
|
2790
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2791
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
2792
|
+
|
2793
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2794
|
+
while (1) {
|
2795
|
+
switch (_context2.prev = _context2.next) {
|
2796
|
+
case 0:
|
2797
|
+
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;
|
2798
|
+
redeemArgs = poolTogetherV4RedeemArgs({
|
2799
|
+
amount: amount,
|
2800
|
+
ptToken: ptToken
|
2801
|
+
});
|
2802
|
+
callArgs = callOnIntegrationArgs({
|
2803
|
+
adapter: poolTogetherV4Adapter,
|
2804
|
+
encodedCallArgs: redeemArgs,
|
2805
|
+
selector: redeemSelector
|
2806
|
+
});
|
2807
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2808
|
+
return _context2.abrupt("return", redeemTx);
|
2809
|
+
|
2810
|
+
case 5:
|
2811
|
+
case "end":
|
2812
|
+
return _context2.stop();
|
2813
|
+
}
|
2814
|
+
}
|
2815
|
+
}, _callee2);
|
2816
|
+
}));
|
2817
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2818
|
+
}
|
2819
|
+
|
2820
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
2821
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2822
|
+
}
|
2823
|
+
|
2824
|
+
function _poolTogetherV4ClaimRewards() {
|
2825
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2826
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
2827
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2828
|
+
while (1) {
|
2829
|
+
switch (_context3.prev = _context3.next) {
|
2830
|
+
case 0:
|
2831
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
2832
|
+
claimRewardsArgs = poolTogetherV4ClaimRewardsArgs({
|
2833
|
+
drawIds: drawIds,
|
2834
|
+
prizeDistributor: prizeDistributor,
|
2835
|
+
winningPicks: winningPicks
|
2836
|
+
});
|
2837
|
+
callArgs = callOnIntegrationArgs({
|
2838
|
+
adapter: poolTogetherV4Adapter,
|
2839
|
+
encodedCallArgs: claimRewardsArgs,
|
2840
|
+
selector: claimRewardsSelector
|
2841
|
+
});
|
2842
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2843
|
+
return _context3.abrupt("return", claimTx);
|
2844
|
+
|
2845
|
+
case 5:
|
2846
|
+
case "end":
|
2847
|
+
return _context3.stop();
|
2848
|
+
}
|
2849
|
+
}
|
2850
|
+
}, _callee3);
|
2851
|
+
}));
|
2852
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2853
|
+
}
|
2854
|
+
|
1943
2855
|
function synthetixAssignExchangeDelegate(_x) {
|
1944
2856
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
1945
2857
|
}
|
@@ -1997,26 +2909,58 @@ function _synthetixResolveAddress() {
|
|
1997
2909
|
return _synthetixResolveAddress.apply(this, arguments);
|
1998
2910
|
}
|
1999
2911
|
|
2000
|
-
function
|
2912
|
+
function synthetixRedeem(_x3) {
|
2913
|
+
return _synthetixRedeem.apply(this, arguments);
|
2914
|
+
}
|
2915
|
+
|
2916
|
+
function _synthetixRedeem() {
|
2917
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2918
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
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, signer = _ref3.signer, synthetixAdapter = _ref3.synthetixAdapter, synths = _ref3.synths;
|
2924
|
+
redeemArgs = synthetixRedeemArgs({
|
2925
|
+
synths: synths
|
2926
|
+
});
|
2927
|
+
callArgs = callOnIntegrationArgs({
|
2928
|
+
adapter: synthetixAdapter,
|
2929
|
+
encodedCallArgs: redeemArgs,
|
2930
|
+
selector: redeemSelector
|
2931
|
+
});
|
2932
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2933
|
+
|
2934
|
+
case 4:
|
2935
|
+
case "end":
|
2936
|
+
return _context3.stop();
|
2937
|
+
}
|
2938
|
+
}
|
2939
|
+
}, _callee3);
|
2940
|
+
}));
|
2941
|
+
return _synthetixRedeem.apply(this, arguments);
|
2942
|
+
}
|
2943
|
+
|
2944
|
+
function synthetixTakeOrder(_x4) {
|
2001
2945
|
return _synthetixTakeOrder.apply(this, arguments);
|
2002
2946
|
}
|
2003
2947
|
|
2004
2948
|
function _synthetixTakeOrder() {
|
2005
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
2006
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
2949
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
2950
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref4$outgoingAssetAm, outgoingAssetAmount, incomingAsset, _ref4$minIncomingAsse, minIncomingAssetAmount, _ref4$seedFund, seedFund, takeOrderArgs, callArgs;
|
2007
2951
|
|
2008
|
-
return _regeneratorRuntime.wrap(function
|
2952
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
2009
2953
|
while (1) {
|
2010
|
-
switch (
|
2954
|
+
switch (_context4.prev = _context4.next) {
|
2011
2955
|
case 0:
|
2012
|
-
comptrollerProxy =
|
2956
|
+
comptrollerProxy = _ref4.comptrollerProxy, vaultProxy = _ref4.vaultProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, synthetixAdapter = _ref4.synthetixAdapter, outgoingAsset = _ref4.outgoingAsset, _ref4$outgoingAssetAm = _ref4.outgoingAssetAmount, outgoingAssetAmount = _ref4$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref4$outgoingAssetAm, incomingAsset = _ref4.incomingAsset, _ref4$minIncomingAsse = _ref4.minIncomingAssetAmount, minIncomingAssetAmount = _ref4$minIncomingAsse === void 0 ? utils.parseEther('1') : _ref4$minIncomingAsse, _ref4$seedFund = _ref4.seedFund, seedFund = _ref4$seedFund === void 0 ? false : _ref4$seedFund;
|
2013
2957
|
|
2014
2958
|
if (!seedFund) {
|
2015
|
-
|
2959
|
+
_context4.next = 4;
|
2016
2960
|
break;
|
2017
2961
|
}
|
2018
2962
|
|
2019
|
-
|
2963
|
+
_context4.next = 4;
|
2020
2964
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
2021
2965
|
|
2022
2966
|
case 4:
|
@@ -2026,23 +2970,23 @@ function _synthetixTakeOrder() {
|
|
2026
2970
|
outgoingAsset: outgoingAsset,
|
2027
2971
|
outgoingAssetAmount: outgoingAssetAmount
|
2028
2972
|
});
|
2029
|
-
|
2973
|
+
_context4.next = 7;
|
2030
2974
|
return callOnIntegrationArgs({
|
2031
2975
|
adapter: synthetixAdapter,
|
2032
|
-
|
2033
|
-
|
2976
|
+
encodedCallArgs: takeOrderArgs,
|
2977
|
+
selector: takeOrderSelector
|
2034
2978
|
});
|
2035
2979
|
|
2036
2980
|
case 7:
|
2037
|
-
callArgs =
|
2038
|
-
return
|
2981
|
+
callArgs = _context4.sent;
|
2982
|
+
return _context4.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2039
2983
|
|
2040
2984
|
case 9:
|
2041
2985
|
case "end":
|
2042
|
-
return
|
2986
|
+
return _context4.stop();
|
2043
2987
|
}
|
2044
2988
|
}
|
2045
|
-
},
|
2989
|
+
}, _callee4);
|
2046
2990
|
}));
|
2047
2991
|
return _synthetixTakeOrder.apply(this, arguments);
|
2048
2992
|
}
|
@@ -2055,13 +2999,13 @@ function uniswapV2Lend(_x) {
|
|
2055
2999
|
|
2056
3000
|
function _uniswapV2Lend() {
|
2057
3001
|
_uniswapV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2058
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
3002
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, minPoolTokenAmount, _ref$seedFund, seedFund, lendArgs, callArgs, lendTx;
|
2059
3003
|
|
2060
3004
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2061
3005
|
while (1) {
|
2062
3006
|
switch (_context.prev = _context.next) {
|
2063
3007
|
case 0:
|
2064
|
-
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner,
|
3008
|
+
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV2LiquidityAdapter = _ref.uniswapV2LiquidityAdapter, tokenA = _ref.tokenA, tokenB = _ref.tokenB, amountADesired = _ref.amountADesired, amountBDesired = _ref.amountBDesired, amountAMin = _ref.amountAMin, amountBMin = _ref.amountBMin, minPoolTokenAmount = _ref.minPoolTokenAmount, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
2065
3009
|
|
2066
3010
|
if (!seedFund) {
|
2067
3011
|
_context.next = 6;
|
@@ -2077,18 +3021,18 @@ function _uniswapV2Lend() {
|
|
2077
3021
|
|
2078
3022
|
case 6:
|
2079
3023
|
lendArgs = uniswapV2LendArgs({
|
2080
|
-
tokenA: tokenA,
|
2081
|
-
tokenB: tokenB,
|
2082
3024
|
amountADesired: amountADesired,
|
2083
|
-
amountBDesired: amountBDesired,
|
2084
3025
|
amountAMin: amountAMin,
|
3026
|
+
amountBDesired: amountBDesired,
|
2085
3027
|
amountBMin: amountBMin,
|
2086
|
-
minPoolTokenAmount: minPoolTokenAmount
|
3028
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
3029
|
+
tokenA: tokenA,
|
3030
|
+
tokenB: tokenB
|
2087
3031
|
});
|
2088
3032
|
callArgs = callOnIntegrationArgs({
|
2089
|
-
adapter:
|
2090
|
-
|
2091
|
-
|
3033
|
+
adapter: uniswapV2LiquidityAdapter,
|
3034
|
+
encodedCallArgs: lendArgs,
|
3035
|
+
selector: lendSelector
|
2092
3036
|
});
|
2093
3037
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2094
3038
|
_context.next = 11;
|
@@ -2113,23 +3057,23 @@ function uniswapV2Redeem(_x2) {
|
|
2113
3057
|
|
2114
3058
|
function _uniswapV2Redeem() {
|
2115
3059
|
_uniswapV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2116
|
-
var comptrollerProxy, integrationManager, fundOwner,
|
3060
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, poolTokenAmount, tokenA, tokenB, amountAMin, amountBMin, redeemArgs, callArgs, redeemTx;
|
2117
3061
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2118
3062
|
while (1) {
|
2119
3063
|
switch (_context2.prev = _context2.next) {
|
2120
3064
|
case 0:
|
2121
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner,
|
3065
|
+
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;
|
2122
3066
|
redeemArgs = uniswapV2RedeemArgs({
|
3067
|
+
amountAMin: amountAMin,
|
3068
|
+
amountBMin: amountBMin,
|
2123
3069
|
poolTokenAmount: poolTokenAmount,
|
2124
3070
|
tokenA: tokenA,
|
2125
|
-
tokenB: tokenB
|
2126
|
-
amountAMin: amountAMin,
|
2127
|
-
amountBMin: amountBMin
|
3071
|
+
tokenB: tokenB
|
2128
3072
|
});
|
2129
3073
|
callArgs = callOnIntegrationArgs({
|
2130
|
-
adapter:
|
2131
|
-
|
2132
|
-
|
3074
|
+
adapter: uniswapV2LiquidityAdapter,
|
3075
|
+
encodedCallArgs: redeemArgs,
|
3076
|
+
selector: redeemSelector
|
2133
3077
|
});
|
2134
3078
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2135
3079
|
_context2.next = 6;
|
@@ -2154,13 +3098,13 @@ function uniswapV2TakeOrder(_x3) {
|
|
2154
3098
|
|
2155
3099
|
function _uniswapV2TakeOrder() {
|
2156
3100
|
_uniswapV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2157
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
3101
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2ExchangeAdapter, path, outgoingAssetAmount, minIncomingAssetAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
2158
3102
|
|
2159
3103
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2160
3104
|
while (1) {
|
2161
3105
|
switch (_context3.prev = _context3.next) {
|
2162
3106
|
case 0:
|
2163
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner,
|
3107
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, uniswapV2ExchangeAdapter = _ref3.uniswapV2ExchangeAdapter, path = _ref3.path, outgoingAssetAmount = _ref3.outgoingAssetAmount, minIncomingAssetAmount = _ref3.minIncomingAssetAmount, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
2164
3108
|
|
2165
3109
|
if (!seedFund) {
|
2166
3110
|
_context3.next = 4;
|
@@ -2172,14 +3116,14 @@ function _uniswapV2TakeOrder() {
|
|
2172
3116
|
|
2173
3117
|
case 4:
|
2174
3118
|
takeOrderArgs = uniswapV2TakeOrderArgs({
|
2175
|
-
|
3119
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2176
3120
|
outgoingAssetAmount: outgoingAssetAmount,
|
2177
|
-
|
3121
|
+
path: path
|
2178
3122
|
});
|
2179
3123
|
callArgs = callOnIntegrationArgs({
|
2180
|
-
adapter:
|
2181
|
-
|
2182
|
-
|
3124
|
+
adapter: uniswapV2ExchangeAdapter,
|
3125
|
+
encodedCallArgs: takeOrderArgs,
|
3126
|
+
selector: takeOrderSelector
|
2183
3127
|
});
|
2184
3128
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2185
3129
|
|
@@ -2199,7 +3143,7 @@ function uniswapV3TakeOrder(_x) {
|
|
2199
3143
|
|
2200
3144
|
function _uniswapV3TakeOrder() {
|
2201
3145
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2202
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
3146
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
2203
3147
|
|
2204
3148
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2205
3149
|
while (1) {
|
@@ -2208,35 +3152,33 @@ function _uniswapV3TakeOrder() {
|
|
2208
3152
|
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;
|
2209
3153
|
|
2210
3154
|
if (!seedFund) {
|
2211
|
-
_context.next =
|
3155
|
+
_context.next = 7;
|
2212
3156
|
break;
|
2213
3157
|
}
|
2214
3158
|
|
2215
|
-
_context.
|
2216
|
-
_context.next = 5;
|
3159
|
+
_context.next = 4;
|
2217
3160
|
return comptrollerProxy.getVaultProxy();
|
2218
3161
|
|
2219
|
-
case
|
2220
|
-
|
2221
|
-
_context.
|
2222
|
-
|
2223
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
3162
|
+
case 4:
|
3163
|
+
vaultProxy = _context.sent;
|
3164
|
+
_context.next = 7;
|
3165
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
2224
3166
|
|
2225
|
-
case
|
3167
|
+
case 7:
|
2226
3168
|
takeOrderArgs = uniswapV3TakeOrderArgs({
|
2227
|
-
|
2228
|
-
pathFees: pathFees,
|
3169
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2229
3170
|
outgoingAssetAmount: outgoingAssetAmount,
|
2230
|
-
|
3171
|
+
pathAddresses: pathAddresses,
|
3172
|
+
pathFees: pathFees
|
2231
3173
|
});
|
2232
3174
|
callArgs = callOnIntegrationArgs({
|
2233
3175
|
adapter: uniswapV3Adapter,
|
2234
|
-
|
2235
|
-
|
3176
|
+
encodedCallArgs: takeOrderArgs,
|
3177
|
+
selector: takeOrderSelector
|
2236
3178
|
});
|
2237
3179
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2238
3180
|
|
2239
|
-
case
|
3181
|
+
case 10:
|
2240
3182
|
case "end":
|
2241
3183
|
return _context.stop();
|
2242
3184
|
}
|
@@ -2261,12 +3203,12 @@ function _yearnVaultV2Lend() {
|
|
2261
3203
|
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;
|
2262
3204
|
callArgs = callOnIntegrationArgs({
|
2263
3205
|
adapter: yearnVaultV2Adapter,
|
2264
|
-
selector: lendSelector,
|
2265
3206
|
encodedCallArgs: yearnVaultV2LendArgs({
|
2266
|
-
|
3207
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
2267
3208
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
2268
|
-
|
2269
|
-
})
|
3209
|
+
yVault: yVault
|
3210
|
+
}),
|
3211
|
+
selector: lendSelector
|
2270
3212
|
});
|
2271
3213
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2272
3214
|
|
@@ -2295,13 +3237,13 @@ function _yearnVaultV2Redeem() {
|
|
2295
3237
|
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;
|
2296
3238
|
callArgs = callOnIntegrationArgs({
|
2297
3239
|
adapter: yearnVaultV2Adapter,
|
2298
|
-
selector: redeemSelector,
|
2299
3240
|
encodedCallArgs: yearnVaultV2RedeemArgs({
|
2300
|
-
yVault: yVault,
|
2301
3241
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
2302
3242
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2303
|
-
slippageToleranceBps: slippageToleranceBps
|
2304
|
-
|
3243
|
+
slippageToleranceBps: slippageToleranceBps,
|
3244
|
+
yVault: yVault
|
3245
|
+
}),
|
3246
|
+
selector: redeemSelector
|
2305
3247
|
});
|
2306
3248
|
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2307
3249
|
|
@@ -2333,8 +3275,8 @@ function _zeroExV2TakeOrder() {
|
|
2333
3275
|
});
|
2334
3276
|
callArgs = callOnIntegrationArgs({
|
2335
3277
|
adapter: zeroExV2Adapter,
|
2336
|
-
|
2337
|
-
|
3278
|
+
encodedCallArgs: takeOrderArgs,
|
3279
|
+
selector: takeOrderSelector
|
2338
3280
|
});
|
2339
3281
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2340
3282
|
|
@@ -2477,7 +3419,8 @@ function assertEvent(receipt, event, match) {
|
|
2477
3419
|
var events = extractEvent(receipt, event);
|
2478
3420
|
expect(events.length).toBe(1);
|
2479
3421
|
expect(receipt).toHaveEmittedWith(event, match);
|
2480
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
3422
|
+
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
|
3423
|
+
|
2481
3424
|
return args;
|
2482
3425
|
}
|
2483
3426
|
function assertNoEvent(receipt, event) {
|
@@ -2638,6 +3581,7 @@ function _createComptrollerProxy() {
|
|
2638
3581
|
comptrollerProxyContract = _context.sent;
|
2639
3582
|
return _context.abrupt("return", {
|
2640
3583
|
comptrollerProxy: new ComptrollerLib(comptrollerProxyContract, signer),
|
3584
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
2641
3585
|
receipt: comptrollerProxyContract.deployment
|
2642
3586
|
});
|
2643
3587
|
|
@@ -2670,14 +3614,14 @@ function _createMigrationRequest() {
|
|
2670
3614
|
case 3:
|
2671
3615
|
receipt = _context2.sent;
|
2672
3616
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2673
|
-
creator: signer,
|
2674
3617
|
comptrollerProxy: expect.any(String),
|
3618
|
+
creator: signer,
|
2675
3619
|
denominationAsset: denominationAsset,
|
2676
3620
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2677
3621
|
});
|
2678
3622
|
return _context2.abrupt("return", {
|
2679
|
-
|
2680
|
-
|
3623
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3624
|
+
receipt: receipt
|
2681
3625
|
});
|
2682
3626
|
|
2683
3627
|
case 6:
|
@@ -2696,29 +3640,29 @@ function createNewFund(_x3) {
|
|
2696
3640
|
|
2697
3641
|
function _createNewFund() {
|
2698
3642
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2699
|
-
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;
|
3643
|
+
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;
|
2700
3644
|
|
2701
3645
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2702
3646
|
while (1) {
|
2703
3647
|
switch (_context3.prev = _context3.next) {
|
2704
3648
|
case 0:
|
2705
|
-
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;
|
3649
|
+
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;
|
2706
3650
|
_context3.next = 3;
|
2707
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
3651
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
2708
3652
|
|
2709
3653
|
case 3:
|
2710
3654
|
receipt = _context3.sent;
|
2711
3655
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2712
|
-
creator: signer,
|
2713
3656
|
comptrollerProxy: expect.any(String),
|
3657
|
+
creator: signer,
|
2714
3658
|
denominationAsset: denominationAsset,
|
2715
3659
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2716
3660
|
});
|
2717
3661
|
comptrollerProxy = new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
2718
3662
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
3663
|
+
comptrollerProxy: comptrollerProxy,
|
2719
3664
|
creator: signer,
|
2720
|
-
vaultProxy: expect.any(String)
|
2721
|
-
comptrollerProxy: comptrollerProxy
|
3665
|
+
vaultProxy: expect.any(String)
|
2722
3666
|
});
|
2723
3667
|
vaultProxy = new VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
2724
3668
|
|
@@ -2769,14 +3713,14 @@ function _createReconfigurationRequest() {
|
|
2769
3713
|
case 3:
|
2770
3714
|
receipt = _context4.sent;
|
2771
3715
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2772
|
-
creator: signer,
|
2773
3716
|
comptrollerProxy: expect.any(String),
|
3717
|
+
creator: signer,
|
2774
3718
|
denominationAsset: denominationAsset,
|
2775
3719
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2776
3720
|
});
|
2777
3721
|
return _context4.abrupt("return", {
|
2778
|
-
|
2779
|
-
|
3722
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3723
|
+
receipt: receipt
|
2780
3724
|
});
|
2781
3725
|
|
2782
3726
|
case 6:
|
@@ -2858,16 +3802,49 @@ function _setupGasRelayerPaymaster() {
|
|
2858
3802
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
2859
3803
|
}
|
2860
3804
|
|
2861
|
-
function
|
2862
|
-
|
2863
|
-
|
2864
|
-
|
2865
|
-
|
3805
|
+
function vaultCallCreateNewList(_x) {
|
3806
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
3807
|
+
}
|
3808
|
+
|
3809
|
+
function _vaultCallCreateNewList() {
|
3810
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
3811
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
3812
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
3813
|
+
while (1) {
|
3814
|
+
switch (_context.prev = _context.next) {
|
3815
|
+
case 0:
|
3816
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
3817
|
+
_context.next = 3;
|
3818
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, addressListRegistryCreateListSelector, encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
3819
|
+
|
3820
|
+
case 3:
|
3821
|
+
_context.next = 5;
|
3822
|
+
return addressListRegistry.getListCount();
|
3823
|
+
|
3824
|
+
case 5:
|
3825
|
+
listCount = _context.sent;
|
3826
|
+
return _context.abrupt("return", listCount.sub(1));
|
3827
|
+
|
3828
|
+
case 7:
|
3829
|
+
case "end":
|
3830
|
+
return _context.stop();
|
3831
|
+
}
|
3832
|
+
}
|
3833
|
+
}, _callee);
|
3834
|
+
}));
|
3835
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
2866
3836
|
}
|
2867
|
-
|
3837
|
+
|
3838
|
+
function vaultCallCurveMinterMint(_ref2) {
|
2868
3839
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
2869
3840
|
minter = _ref2.minter,
|
2870
|
-
|
3841
|
+
gauge = _ref2.gauge;
|
3842
|
+
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintSelector, encodeArgs(['address'], [gauge]));
|
3843
|
+
}
|
3844
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
3845
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
3846
|
+
minter = _ref3.minter,
|
3847
|
+
gauges = _ref3.gauges;
|
2871
3848
|
var gaugesFormatted = new Array(8).fill(constants.AddressZero);
|
2872
3849
|
|
2873
3850
|
for (var i in gauges) {
|
@@ -2876,16 +3853,16 @@ function vaultCallCurveMinterMintMany(_ref2) {
|
|
2876
3853
|
|
2877
3854
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintManySelector, encodeArgs(['address[8]'], [gaugesFormatted]));
|
2878
3855
|
}
|
2879
|
-
function vaultCallCurveMinterToggleApproveMint(
|
2880
|
-
var comptrollerProxy =
|
2881
|
-
minter =
|
2882
|
-
account =
|
3856
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
3857
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
3858
|
+
minter = _ref4.minter,
|
3859
|
+
account = _ref4.account;
|
2883
3860
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterToggleApproveMintSelector, encodeArgs(['address'], [account]));
|
2884
3861
|
}
|
2885
|
-
function vaultCallStartAssetBypassTimelock(
|
2886
|
-
var comptrollerProxy =
|
2887
|
-
contract =
|
2888
|
-
asset =
|
3862
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
3863
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
3864
|
+
contract = _ref5.contract,
|
3865
|
+
asset = _ref5.asset;
|
2889
3866
|
return comptrollerProxy.vaultCallOnContract(contract, sighash(utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), encodeArgs(['address'], [asset]));
|
2890
3867
|
}
|
2891
3868
|
|
@@ -2941,8 +3918,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2941
3918
|
// 50% discount
|
2942
3919
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
2943
3920
|
return _context2.abrupt("return", {
|
2944
|
-
|
2945
|
-
|
3921
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
3922
|
+
mlnValue: mlnValueOfBuyback
|
2946
3923
|
});
|
2947
3924
|
|
2948
3925
|
case 8:
|
@@ -2958,43 +3935,55 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2958
3935
|
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; }
|
2959
3936
|
|
2960
3937
|
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; }
|
3938
|
+
|
3939
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
2961
3940
|
var whales = {
|
2962
|
-
|
2963
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
2964
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3941
|
+
// primitives
|
2965
3942
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
2966
3943
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
2967
|
-
bnt: '
|
2968
|
-
|
3944
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
3945
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3946
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
2969
3947
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
2970
|
-
dai: '
|
2971
|
-
knc: '
|
3948
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3949
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
2972
3950
|
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
2973
3951
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
2974
3952
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
2975
3953
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
3954
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
2976
3955
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
2977
3956
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
3957
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
3958
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
2978
3959
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
2979
3960
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
2980
3961
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
2981
3962
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
2982
3963
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
2983
|
-
|
3964
|
+
// aTokens
|
3965
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3966
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
3967
|
+
// cTokens
|
2984
3968
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
2985
|
-
cdai: '
|
3969
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
2986
3970
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
3971
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
3972
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
3973
|
+
// ptTokens
|
3974
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
3975
|
+
// synths
|
2991
3976
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
2992
|
-
seur: '
|
2993
|
-
|
3977
|
+
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
3978
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
3979
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
3980
|
+
// misc
|
2994
3981
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
2995
3982
|
eurs: '0x98ed26de6451db36246672df78ae7c50f2c76f6d',
|
2996
|
-
|
3983
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621'
|
2997
3984
|
};
|
3985
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
3986
|
+
|
2998
3987
|
function unlockWhale(_x) {
|
2999
3988
|
return _unlockWhale.apply(this, arguments);
|
3000
3989
|
}
|
@@ -3166,8 +4155,8 @@ function _relayTransaction() {
|
|
3166
4155
|
defaultMaxAcceptance = BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
3167
4156
|
|
3168
4157
|
mergedRelayRequest = {
|
3169
|
-
|
3170
|
-
|
4158
|
+
relayData: relayData,
|
4159
|
+
request: relayRequest
|
3171
4160
|
};
|
3172
4161
|
relayHub = new IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
3173
4162
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
@@ -3186,14 +4175,14 @@ var relayed = utils.EventFragment.fromString('TransactionRelayed(address indexed
|
|
3186
4175
|
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)');
|
3187
4176
|
function assertDidRelay(receipt) {
|
3188
4177
|
return assertEvent(receipt, relayed, {
|
3189
|
-
|
3190
|
-
relayWorker: expect.any(String),
|
4178
|
+
charge: expect.anything(),
|
3191
4179
|
from: expect.any(String),
|
3192
|
-
to: expect.any(String),
|
3193
4180
|
paymaster: expect.any(String),
|
4181
|
+
relayManager: expect.any(String),
|
4182
|
+
relayWorker: expect.any(String),
|
3194
4183
|
selector: expect.any(String),
|
3195
4184
|
status: expect.anything(),
|
3196
|
-
|
4185
|
+
to: expect.any(String)
|
3197
4186
|
});
|
3198
4187
|
}
|
3199
4188
|
function assertDidRelaySuccessfully(receipt) {
|
@@ -3210,14 +4199,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
3210
4199
|
}
|
3211
4200
|
function assertPaymasterDidReject(receipt) {
|
3212
4201
|
return assertEvent(receipt, rejected, {
|
3213
|
-
relayManager: expect.any(String),
|
3214
|
-
paymaster: expect.any(String),
|
3215
4202
|
from: expect.any(String),
|
3216
|
-
|
4203
|
+
innerGasUsed: expect.anything(),
|
4204
|
+
paymaster: expect.any(String),
|
4205
|
+
reason: expect.any(String),
|
4206
|
+
relayManager: expect.any(String),
|
3217
4207
|
relayWorker: expect.any(String),
|
3218
4208
|
selector: expect.any(String),
|
3219
|
-
|
3220
|
-
reason: expect.any(String)
|
4209
|
+
to: expect.any(String)
|
3221
4210
|
});
|
3222
4211
|
}
|
3223
4212
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
@@ -3225,4 +4214,4 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
3225
4214
|
expect(utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
3226
4215
|
}
|
3227
4216
|
|
3228
|
-
export { CurveLiquidityGaugeV2, CurveMinter, CurveSwaps, ICompoundComptroller, UniswapV2Factory, aaveLend, aaveRedeem,
|
4217
|
+
export { CurveLiquidityGaugeV2, CurveMinter, CurveRegistry, CurveSwaps, ICompoundComptroller, IUniswapV3NonFungibleTokenManager, UniswapV2Factory, UniswapV3FeeAmount, 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, createUniswapV3LiquidityPosition, createVaultProxy, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem, curveClaimRewards, curveEursClaimRewards, curveEursLend, curveEursLendAndStake, curveEursRedeem, curveEursStake, curveEursUnstake, curveEursUnstakeAndRedeem, 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, synthetixResolveAddress, 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 };
|