@enzymefinance/testutils 4.0.0-next.5 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/declarations/src/deployment.d.ts +34 -27
- package/dist/declarations/src/scaffolding/assets.d.ts +1 -1
- package/dist/declarations/src/scaffolding/core.d.ts +2 -3
- package/dist/declarations/src/scaffolding/extensions/external-positions/aave-debt.d.ts +51 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +2 -1
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +4 -1
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +12 -11
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +2 -2
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +30 -2
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +63 -229
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +1 -1
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +17 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +5 -10
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +2 -2
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +1 -1
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +8 -8
- package/dist/declarations/src/whales.d.ts +12 -5
- package/dist/enzymefinance-testutils.browser.cjs.js +826 -721
- package/dist/enzymefinance-testutils.browser.esm.js +809 -692
- package/dist/enzymefinance-testutils.cjs.dev.js +826 -721
- package/dist/enzymefinance-testutils.cjs.prod.js +826 -721
- package/dist/enzymefinance-testutils.esm.js +809 -692
- package/package.json +6 -6
- package/src/deployment.ts +39 -31
- package/src/scaffolding/assets.ts +1 -1
- package/src/scaffolding/core.ts +3 -9
- package/src/scaffolding/extensions/external-positions/aave-debt.ts +179 -0
- package/src/scaffolding/extensions/external-positions/actions.ts +6 -1
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +7 -10
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +18 -24
- package/src/scaffolding/extensions/integrations/compound.ts +163 -2
- package/src/scaffolding/extensions/integrations/curve.ts +152 -783
- package/src/scaffolding/extensions/integrations/index.ts +1 -1
- package/src/scaffolding/extensions/integrations/olympusV2.ts +71 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +6 -25
- package/src/types.d.ts +1 -0
- package/src/whales.ts +14 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +0 -23
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +0 -70
@@ -1,9 +1,10 @@
|
|
1
1
|
import _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator';
|
2
2
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
3
|
-
import { AaveAdapter, AavePriceFeed, AddressListRegistry, AllowedAdapterIncomingAssetsPolicy, AllowedAdaptersPolicy, AllowedAssetsForRedemptionPolicy, AllowedDepositRecipientsPolicy, AllowedExternalPositionTypesPolicy, AllowedSharesTransferRecipientsPolicy,
|
3
|
+
import { AaveAdapter, AaveDebtPositionLib, AaveDebtPositionParser, AavePriceFeed, AddressListRegistry, AllowedAdapterIncomingAssetsPolicy, AllowedAdaptersPolicy, AllowedAssetsForRedemptionPolicy, AllowedDepositRecipientsPolicy, AllowedExternalPositionTypesPolicy, AllowedSharesTransferRecipientsPolicy, CompoundAdapter, CompoundDebtPositionLib, CompoundDebtPositionParser, CompoundPriceFeed, ComptrollerLib, ConvexCurveLpStakingAdapter, ConvexCurveLpStakingWrapperFactory, ConvexCurveLpStakingWrapperPriceFeed, CumulativeSlippageTolerancePolicy, CurveExchangeAdapter, CurveLiquidityAdapter, CurvePriceFeed, DepositWrapper, Dispatcher, EntranceRateBurnFee, EntranceRateDirectFee, ExitRateBurnFee, ExitRateDirectFee, ExternalPositionFactory, ExternalPositionManager, FeeManager, FundDeployer, FundValueCalculator, FundValueCalculatorRouter, FundValueCalculatorUsdWrapper, FuseAdapter, FusePriceFeed, GasRelayPaymasterFactory, IdleAdapter, IdlePriceFeed, IntegrationManager, LidoStethPriceFeed, ManagementFee, MinAssetBalancesPostRedemptionPolicy, MinMaxInvestmentPolicy, OlympusV2Adapter, OnlyRemoveDustExternalPositionPolicy, OnlyUntrackDustOrPricelessAssetsPolicy, ParaSwapV5Adapter, PerformanceFee, PolicyManager, PoolTogetherV4Adapter, PoolTogetherV4PriceFeed, ProtocolFeeReserveLib, ProtocolFeeTracker, RevertingPriceFeed, SynthetixAdapter, UniswapV2ExchangeAdapter, UniswapV2LiquidityAdapter, UniswapV2PoolPriceFeed, UniswapV3Adapter, UnpermissionedActionsWrapper, UsdEthSimulatedAggregator, ValueInterpreter, VaultLib, YearnVaultV2Adapter, YearnVaultV2PriceFeed, ZeroExV2Adapter, IntegrationManagerActionId, addTrackedAssetsToVaultArgs, removeTrackedAssetsFromVaultArgs, StandardToken, callOnExternalPositionArgs, ExternalPositionManagerActionId, IExternalPositionProxy, encodeArgs, externalPositionReactivateArgs, externalPositionRemoveArgs, compoundExternalPositionActionArgs, CompoundDebtPositionActionId, ExternalPositionType, MockGenericExternalPositionParser, MockGenericExternalPositionLib, mockGenericExternalPositionActionArgs, MockGenericExternalPositionActionId, aaveDebtPositionAddCollateralArgs, AaveDebtPositionActionId, aaveDebtPositionBorrowArgs, aaveDebtPositionClaimRewardsArgs, aaveDebtPositionRemoveCollateralArgs, aaveDebtPositionRepayBorrowArgs, uniswapV3LiquidityPositionAddLiquidityArgs, UniswapV3LiquidityPositionActionId, uniswapV3LiquidityPositionCollectArgs, UniswapV3LiquidityPositionLib, uniswapV3LiquidityPositionMintArgs, uniswapV3LiquidityPositionPurgeArgs, uniswapV3LiquidityPositionRemoveLiquidityArgs, feeManagerConfigArgs, FeeSettlementType, FeeHook, IFee, aaveLendArgs, callOnIntegrationArgs, lendSelector, aaveRedeemArgs, redeemSelector, compoundClaimRewardsArgs, claimRewardsSelector, compoundArgs, curveTakeOrderArgs, takeOrderSelector, curveClaimRewardsArgs, curveLendArgs, curveLendAndStakeArgs, lendAndStakeSelector, curveRedeemArgs, curveStakeArgs, stakeSelector, curveUnstakeArgs, unstakeSelector, curveUnstakeAndRedeemArgs, unstakeAndRedeemSelector, idleClaimRewardsArgs, idleLendArgs, idleRedeemArgs, sighash, olympusV2StakeArgs, olympusV2UnstakeArgs, 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
6
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
7
|
+
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
7
8
|
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
8
9
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
9
10
|
|
@@ -104,6 +105,8 @@ function _deployProtocolFixture() {
|
|
104
105
|
|
105
106
|
deployment = {
|
106
107
|
aaveAdapter: new AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
108
|
+
aaveDebtPositionLib: new AaveDebtPositionLib(fixture['AaveDebtPositionLib'].address, deployer),
|
109
|
+
aaveDebtPositionParser: new AaveDebtPositionParser(fixture['AaveDebtPositionParser'].address, deployer),
|
107
110
|
aavePriceFeed: new AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
108
111
|
addressListRegistry: new AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
109
112
|
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
@@ -112,18 +115,17 @@ function _deployProtocolFixture() {
|
|
112
115
|
allowedDepositRecipientsPolicy: new AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
113
116
|
allowedExternalPositionTypesPolicy: new AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
114
117
|
allowedSharesTransferRecipientsPolicy: new AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
115
|
-
assetFinalityResolver: new AssetFinalityResolver(fixture['AssetFinalityResolver'].address, deployer),
|
116
118
|
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
117
119
|
compoundDebtPositionLib: new CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
118
120
|
compoundDebtPositionParser: new CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
119
121
|
compoundPriceFeed: new CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
120
122
|
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
123
|
+
convexCurveLpStakingAdapter: new ConvexCurveLpStakingAdapter(fixture['ConvexCurveLpStakingAdapter'].address, deployer),
|
124
|
+
convexCurveLpStakingWrapperFactory: new ConvexCurveLpStakingWrapperFactory(fixture['ConvexCurveLpStakingWrapperFactory'].address, deployer),
|
125
|
+
convexCurveLpStakingWrapperPriceFeed: new ConvexCurveLpStakingWrapperPriceFeed(fixture['ConvexCurveLpStakingWrapperPriceFeed'].address, deployer),
|
121
126
|
cumulativeSlippageTolerancePolicy: new CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
122
127
|
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
123
|
-
|
124
|
-
curveLiquidityEursAdapter: new CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
125
|
-
curveLiquiditySethAdapter: new CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
126
|
-
curveLiquidityStethAdapter: new CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
128
|
+
curveLiquidityAdapter: new CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
127
129
|
curvePriceFeed: new CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
128
130
|
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
129
131
|
dispatcher: new Dispatcher(fixture['Dispatcher'].address, deployer),
|
@@ -138,8 +140,9 @@ function _deployProtocolFixture() {
|
|
138
140
|
fundValueCalculator: new FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
139
141
|
fundValueCalculatorRouter: new FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
140
142
|
fundValueCalculatorUsdWrapper: new FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
143
|
+
fuseAdapter: new FuseAdapter(fixture['FuseAdapter'].address, deployer),
|
144
|
+
fusePriceFeed: new FusePriceFeed(fixture['FusePriceFeed'].address, deployer),
|
141
145
|
gasRelayPaymasterFactory: new GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
142
|
-
guaranteedRedemptionPolicy: new GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
143
146
|
idleAdapter: new IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
144
147
|
idlePriceFeed: new IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
145
148
|
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
@@ -147,9 +150,9 @@ function _deployProtocolFixture() {
|
|
147
150
|
managementFee: new ManagementFee(fixture['ManagementFee'].address, deployer),
|
148
151
|
minAssetBalancesPostRedemptionPolicy: new MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
149
152
|
minMaxInvestmentPolicy: new MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
153
|
+
olympusV2Adapter: new OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
150
154
|
onlyRemoveDustExternalPositionPolicy: new OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
151
155
|
onlyUntrackDustOrPricelessAssetsPolicy: new OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
152
|
-
paraSwapV4Adapter: new ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
153
156
|
paraSwapV5Adapter: new ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
154
157
|
performanceFee: new PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
155
158
|
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
@@ -159,14 +162,13 @@ function _deployProtocolFixture() {
|
|
159
162
|
protocolFeeReserveProxy: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
160
163
|
protocolFeeTracker: new ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
161
164
|
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
162
|
-
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
163
165
|
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
164
|
-
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
165
166
|
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
166
167
|
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
167
168
|
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
168
169
|
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
169
170
|
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
171
|
+
usdEthSimulatedAggregator: new UsdEthSimulatedAggregator(fixture['UsdEthSimulatedAggregator'].address, deployer),
|
170
172
|
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
171
173
|
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
172
174
|
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
@@ -222,7 +224,7 @@ function _addNewAssetsToFund() {
|
|
222
224
|
switch (_context.prev = _context.next) {
|
223
225
|
case 0:
|
224
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;
|
225
|
-
// First, add tracked assets
|
227
|
+
// First, add tracked assets
|
226
228
|
receipt = addTrackedAssetsToVault({
|
227
229
|
assets: assets,
|
228
230
|
comptrollerProxy: comptrollerProxy,
|
@@ -379,13 +381,13 @@ function createFundDeployer(_x) {
|
|
379
381
|
|
380
382
|
function _createFundDeployer() {
|
381
383
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
382
|
-
var deployer,
|
384
|
+
var deployer, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
383
385
|
|
384
386
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
385
387
|
while (1) {
|
386
388
|
switch (_context.prev = _context.next) {
|
387
389
|
case 0:
|
388
|
-
deployer = _ref.deployer,
|
390
|
+
deployer = _ref.deployer, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
389
391
|
_context.next = 3;
|
390
392
|
return vaultLib.getMlnToken();
|
391
393
|
|
@@ -436,7 +438,7 @@ function _createFundDeployer() {
|
|
436
438
|
case 31:
|
437
439
|
nextIntegrationManager = _context.sent;
|
438
440
|
_context.next = 34;
|
439
|
-
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager,
|
441
|
+
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, gasRelayPaymasterFactory, mlnToken, wethToken);
|
440
442
|
|
441
443
|
case 34:
|
442
444
|
nextComptrollerLib = _context.sent;
|
@@ -473,40 +475,50 @@ function _createFundDeployer() {
|
|
473
475
|
case 54:
|
474
476
|
_context.t11 = _context.sent;
|
475
477
|
_context.next = 57;
|
476
|
-
return vaultLib.
|
478
|
+
return vaultLib.getMlnBurner();
|
477
479
|
|
478
480
|
case 57:
|
479
481
|
_context.t12 = _context.sent;
|
480
482
|
_context.next = 60;
|
481
|
-
return
|
483
|
+
return vaultLib.getWethToken();
|
482
484
|
|
483
485
|
case 60:
|
484
|
-
|
486
|
+
_context.t13 = _context.sent;
|
485
487
|
_context.next = 63;
|
486
|
-
return
|
488
|
+
return vaultLib.getPositionsLimit();
|
487
489
|
|
488
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);
|
494
|
+
|
495
|
+
case 66:
|
496
|
+
nextVaultLib = _context.sent;
|
497
|
+
_context.next = 69;
|
498
|
+
return nextFundDeployer.setVaultLib(nextVaultLib);
|
499
|
+
|
500
|
+
case 69:
|
489
501
|
if (!setReleaseLive) {
|
490
|
-
_context.next =
|
502
|
+
_context.next = 72;
|
491
503
|
break;
|
492
504
|
}
|
493
505
|
|
494
|
-
_context.next =
|
506
|
+
_context.next = 72;
|
495
507
|
return nextFundDeployer.setReleaseLive();
|
496
508
|
|
497
|
-
case
|
509
|
+
case 72:
|
498
510
|
if (!setOnDispatcher) {
|
499
|
-
_context.next =
|
511
|
+
_context.next = 75;
|
500
512
|
break;
|
501
513
|
}
|
502
514
|
|
503
|
-
_context.next =
|
515
|
+
_context.next = 75;
|
504
516
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
505
517
|
|
506
|
-
case
|
518
|
+
case 75:
|
507
519
|
return _context.abrupt("return", nextFundDeployer);
|
508
520
|
|
509
|
-
case
|
521
|
+
case 76:
|
510
522
|
case "end":
|
511
523
|
return _context.stop();
|
512
524
|
}
|
@@ -587,15 +599,15 @@ function createExternalPosition(_x2) {
|
|
587
599
|
|
588
600
|
function _createExternalPosition() {
|
589
601
|
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
590
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
602
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, _ref2$callOnExternalP, callOnExternalPositionData, receipt, event, externalPositionProxy;
|
591
603
|
|
592
604
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
593
605
|
while (1) {
|
594
606
|
switch (_context2.prev = _context2.next) {
|
595
607
|
case 0:
|
596
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
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, _ref2$callOnExternalP = _ref2.callOnExternalPositionData, callOnExternalPositionData = _ref2$callOnExternalP === void 0 ? '0x' : _ref2$callOnExternalP;
|
597
609
|
_context2.next = 3;
|
598
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
610
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes', 'bytes'], [externalPositionTypeId, initializationData, callOnExternalPositionData]));
|
599
611
|
|
600
612
|
case 3:
|
601
613
|
receipt = _context2.sent;
|
@@ -924,7 +936,12 @@ function _createMockExternalPosition() {
|
|
924
936
|
|
925
937
|
case 21:
|
926
938
|
_context.next = 23;
|
927
|
-
return
|
939
|
+
return createExternalPosition({
|
940
|
+
comptrollerProxy: comptrollerProxy,
|
941
|
+
externalPositionManager: externalPositionManager,
|
942
|
+
externalPositionTypeId: typeId,
|
943
|
+
signer: fundOwner
|
944
|
+
});
|
928
945
|
|
929
946
|
case 23:
|
930
947
|
receipt = _context.sent;
|
@@ -1091,6 +1108,209 @@ function _mockExternalPositionRemoveManagedAssets() {
|
|
1091
1108
|
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1092
1109
|
}
|
1093
1110
|
|
1111
|
+
function aaveDebtPositionAddCollateral(_x) {
|
1112
|
+
return _aaveDebtPositionAddCollateral.apply(this, arguments);
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
function _aaveDebtPositionAddCollateral() {
|
1116
|
+
_aaveDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1117
|
+
var comptrollerProxy, externalPositionManager, signer, aTokens, amounts, externalPositionProxy, actionArgs;
|
1118
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1119
|
+
while (1) {
|
1120
|
+
switch (_context.prev = _context.next) {
|
1121
|
+
case 0:
|
1122
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, signer = _ref.signer, aTokens = _ref.aTokens, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy;
|
1123
|
+
actionArgs = aaveDebtPositionAddCollateralArgs({
|
1124
|
+
aTokens: aTokens,
|
1125
|
+
amounts: amounts
|
1126
|
+
});
|
1127
|
+
return _context.abrupt("return", callOnExternalPosition({
|
1128
|
+
actionArgs: actionArgs,
|
1129
|
+
actionId: AaveDebtPositionActionId.AddCollateralAssets,
|
1130
|
+
comptrollerProxy: comptrollerProxy,
|
1131
|
+
externalPositionManager: externalPositionManager,
|
1132
|
+
externalPositionProxy: externalPositionProxy,
|
1133
|
+
signer: signer
|
1134
|
+
}));
|
1135
|
+
|
1136
|
+
case 3:
|
1137
|
+
case "end":
|
1138
|
+
return _context.stop();
|
1139
|
+
}
|
1140
|
+
}
|
1141
|
+
}, _callee);
|
1142
|
+
}));
|
1143
|
+
return _aaveDebtPositionAddCollateral.apply(this, arguments);
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
function aaveDebtPositionBorrow(_x2) {
|
1147
|
+
return _aaveDebtPositionBorrow.apply(this, arguments);
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
function _aaveDebtPositionBorrow() {
|
1151
|
+
_aaveDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
1152
|
+
var comptrollerProxy, externalPositionManager, signer, tokens, amounts, externalPositionProxy, actionArgs;
|
1153
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1154
|
+
while (1) {
|
1155
|
+
switch (_context2.prev = _context2.next) {
|
1156
|
+
case 0:
|
1157
|
+
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, signer = _ref2.signer, tokens = _ref2.tokens, amounts = _ref2.amounts, externalPositionProxy = _ref2.externalPositionProxy;
|
1158
|
+
actionArgs = aaveDebtPositionBorrowArgs({
|
1159
|
+
amounts: amounts,
|
1160
|
+
tokens: tokens
|
1161
|
+
});
|
1162
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
1163
|
+
actionArgs: actionArgs,
|
1164
|
+
actionId: AaveDebtPositionActionId.BorrowAsset,
|
1165
|
+
comptrollerProxy: comptrollerProxy,
|
1166
|
+
externalPositionManager: externalPositionManager,
|
1167
|
+
externalPositionProxy: externalPositionProxy,
|
1168
|
+
signer: signer
|
1169
|
+
}));
|
1170
|
+
|
1171
|
+
case 3:
|
1172
|
+
case "end":
|
1173
|
+
return _context2.stop();
|
1174
|
+
}
|
1175
|
+
}
|
1176
|
+
}, _callee2);
|
1177
|
+
}));
|
1178
|
+
return _aaveDebtPositionBorrow.apply(this, arguments);
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
function aaveDebtPositionClaimRewards(_x3) {
|
1182
|
+
return _aaveDebtPositionClaimRewards.apply(this, arguments);
|
1183
|
+
}
|
1184
|
+
|
1185
|
+
function _aaveDebtPositionClaimRewards() {
|
1186
|
+
_aaveDebtPositionClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
1187
|
+
var comptrollerProxy, externalPositionManager, signer, assets, externalPositionProxy, actionArgs;
|
1188
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1189
|
+
while (1) {
|
1190
|
+
switch (_context3.prev = _context3.next) {
|
1191
|
+
case 0:
|
1192
|
+
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, signer = _ref3.signer, assets = _ref3.assets, externalPositionProxy = _ref3.externalPositionProxy;
|
1193
|
+
actionArgs = aaveDebtPositionClaimRewardsArgs({
|
1194
|
+
assets: assets
|
1195
|
+
});
|
1196
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
1197
|
+
actionArgs: actionArgs,
|
1198
|
+
actionId: AaveDebtPositionActionId.ClaimRewards,
|
1199
|
+
comptrollerProxy: comptrollerProxy,
|
1200
|
+
externalPositionManager: externalPositionManager,
|
1201
|
+
externalPositionProxy: externalPositionProxy,
|
1202
|
+
signer: signer
|
1203
|
+
}));
|
1204
|
+
|
1205
|
+
case 3:
|
1206
|
+
case "end":
|
1207
|
+
return _context3.stop();
|
1208
|
+
}
|
1209
|
+
}
|
1210
|
+
}, _callee3);
|
1211
|
+
}));
|
1212
|
+
return _aaveDebtPositionClaimRewards.apply(this, arguments);
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
function aaveDebtPositionRemoveCollateral(_x4) {
|
1216
|
+
return _aaveDebtPositionRemoveCollateral.apply(this, arguments);
|
1217
|
+
}
|
1218
|
+
|
1219
|
+
function _aaveDebtPositionRemoveCollateral() {
|
1220
|
+
_aaveDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1221
|
+
var comptrollerProxy, externalPositionManager, signer, aTokens, amounts, externalPositionProxy, actionArgs;
|
1222
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1223
|
+
while (1) {
|
1224
|
+
switch (_context4.prev = _context4.next) {
|
1225
|
+
case 0:
|
1226
|
+
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, signer = _ref4.signer, aTokens = _ref4.aTokens, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy;
|
1227
|
+
actionArgs = aaveDebtPositionRemoveCollateralArgs({
|
1228
|
+
aTokens: aTokens,
|
1229
|
+
amounts: amounts
|
1230
|
+
});
|
1231
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
1232
|
+
actionArgs: actionArgs,
|
1233
|
+
actionId: AaveDebtPositionActionId.RemoveCollateralAssets,
|
1234
|
+
comptrollerProxy: comptrollerProxy,
|
1235
|
+
externalPositionManager: externalPositionManager,
|
1236
|
+
externalPositionProxy: externalPositionProxy,
|
1237
|
+
signer: signer
|
1238
|
+
}));
|
1239
|
+
|
1240
|
+
case 3:
|
1241
|
+
case "end":
|
1242
|
+
return _context4.stop();
|
1243
|
+
}
|
1244
|
+
}
|
1245
|
+
}, _callee4);
|
1246
|
+
}));
|
1247
|
+
return _aaveDebtPositionRemoveCollateral.apply(this, arguments);
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
function aaveDebtPositionRepayBorrow(_x5) {
|
1251
|
+
return _aaveDebtPositionRepayBorrow.apply(this, arguments);
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
function _aaveDebtPositionRepayBorrow() {
|
1255
|
+
_aaveDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
1256
|
+
var comptrollerProxy, externalPositionManager, signer, tokens, amounts, externalPositionProxy, actionArgs;
|
1257
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1258
|
+
while (1) {
|
1259
|
+
switch (_context5.prev = _context5.next) {
|
1260
|
+
case 0:
|
1261
|
+
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, signer = _ref5.signer, tokens = _ref5.tokens, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy;
|
1262
|
+
actionArgs = aaveDebtPositionRepayBorrowArgs({
|
1263
|
+
amounts: amounts,
|
1264
|
+
tokens: tokens
|
1265
|
+
});
|
1266
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
1267
|
+
actionArgs: actionArgs,
|
1268
|
+
actionId: AaveDebtPositionActionId.RepayBorrowedAssets,
|
1269
|
+
comptrollerProxy: comptrollerProxy,
|
1270
|
+
externalPositionManager: externalPositionManager,
|
1271
|
+
externalPositionProxy: externalPositionProxy,
|
1272
|
+
signer: signer
|
1273
|
+
}));
|
1274
|
+
|
1275
|
+
case 3:
|
1276
|
+
case "end":
|
1277
|
+
return _context5.stop();
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
}, _callee5);
|
1281
|
+
}));
|
1282
|
+
return _aaveDebtPositionRepayBorrow.apply(this, arguments);
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
function createAaveDebtPosition(_x6) {
|
1286
|
+
return _createAaveDebtPosition.apply(this, arguments);
|
1287
|
+
}
|
1288
|
+
|
1289
|
+
function _createAaveDebtPosition() {
|
1290
|
+
_createAaveDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
1291
|
+
var signer, comptrollerProxy, externalPositionManager;
|
1292
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
1293
|
+
while (1) {
|
1294
|
+
switch (_context6.prev = _context6.next) {
|
1295
|
+
case 0:
|
1296
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
1297
|
+
return _context6.abrupt("return", createExternalPosition({
|
1298
|
+
comptrollerProxy: comptrollerProxy,
|
1299
|
+
externalPositionManager: externalPositionManager,
|
1300
|
+
externalPositionTypeId: ExternalPositionType.AaveDebtPosition,
|
1301
|
+
signer: signer
|
1302
|
+
}));
|
1303
|
+
|
1304
|
+
case 2:
|
1305
|
+
case "end":
|
1306
|
+
return _context6.stop();
|
1307
|
+
}
|
1308
|
+
}
|
1309
|
+
}, _callee6);
|
1310
|
+
}));
|
1311
|
+
return _createAaveDebtPosition.apply(this, arguments);
|
1312
|
+
}
|
1313
|
+
|
1094
1314
|
var _templateObject$3;
|
1095
1315
|
var UniswapV3FeeAmount;
|
1096
1316
|
|
@@ -1113,41 +1333,32 @@ function createUniswapV3LiquidityPosition(_x) {
|
|
1113
1333
|
|
1114
1334
|
function _createUniswapV3LiquidityPosition() {
|
1115
1335
|
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1116
|
-
var signer, comptrollerProxy, externalPositionManager,
|
1336
|
+
var signer, comptrollerProxy, externalPositionManager, _ref$callOnExternalPo, callOnExternalPositionData, _yield$createExternal, externalPositionProxyContract, receipt;
|
1337
|
+
|
1117
1338
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1118
1339
|
while (1) {
|
1119
1340
|
switch (_context.prev = _context.next) {
|
1120
1341
|
case 0:
|
1121
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager,
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1342
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, _ref$callOnExternalPo = _ref.callOnExternalPositionData, callOnExternalPositionData = _ref$callOnExternalPo === void 0 ? '0x' : _ref$callOnExternalPo;
|
1343
|
+
_context.next = 3;
|
1344
|
+
return createExternalPosition({
|
1345
|
+
callOnExternalPositionData: callOnExternalPositionData,
|
1346
|
+
comptrollerProxy: comptrollerProxy,
|
1347
|
+
externalPositionManager: externalPositionManager,
|
1348
|
+
externalPositionTypeId: ExternalPositionType.UniswapV3LiquidityPosition,
|
1349
|
+
signer: signer
|
1125
1350
|
});
|
1126
|
-
_context.next = 4;
|
1127
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [ExternalPositionType.UniswapV3LiquidityPosition, initArgs]));
|
1128
|
-
|
1129
|
-
case 4:
|
1130
|
-
receipt = _context.sent;
|
1131
|
-
_context.t0 = VaultLib;
|
1132
|
-
_context.next = 8;
|
1133
|
-
return comptrollerProxy.getVaultProxy();
|
1134
|
-
|
1135
|
-
case 8:
|
1136
|
-
_context.t1 = _context.sent;
|
1137
|
-
_context.t2 = signer;
|
1138
|
-
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
1139
|
-
_context.next = 13;
|
1140
|
-
return vaultProxy.getActiveExternalPositions.call();
|
1141
1351
|
|
1142
|
-
case
|
1143
|
-
|
1144
|
-
|
1352
|
+
case 3:
|
1353
|
+
_yield$createExternal = _context.sent;
|
1354
|
+
externalPositionProxyContract = _yield$createExternal.externalPositionProxy;
|
1355
|
+
receipt = _yield$createExternal.receipt;
|
1145
1356
|
return _context.abrupt("return", {
|
1146
|
-
externalPositionProxyAddress:
|
1357
|
+
externalPositionProxyAddress: externalPositionProxyContract.address,
|
1147
1358
|
receipt: receipt
|
1148
1359
|
});
|
1149
1360
|
|
1150
|
-
case
|
1361
|
+
case 7:
|
1151
1362
|
case "end":
|
1152
1363
|
return _context.stop();
|
1153
1364
|
}
|
@@ -1232,13 +1443,13 @@ function uniswapV3LiquidityPositionMint(_x4) {
|
|
1232
1443
|
|
1233
1444
|
function _uniswapV3LiquidityPositionMint() {
|
1234
1445
|
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1235
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1446
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1236
1447
|
|
1237
1448
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1238
1449
|
while (1) {
|
1239
1450
|
switch (_context4.prev = _context4.next) {
|
1240
1451
|
case 0:
|
1241
|
-
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;
|
1452
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, token0 = _ref4.token0, token1 = _ref4.token1, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
1242
1453
|
actionArgs = uniswapV3LiquidityPositionMintArgs({
|
1243
1454
|
amount0Desired: amount0Desired,
|
1244
1455
|
amount0Min: amount0Min,
|
@@ -1246,7 +1457,9 @@ function _uniswapV3LiquidityPositionMint() {
|
|
1246
1457
|
amount1Min: amount1Min,
|
1247
1458
|
fee: fee,
|
1248
1459
|
tickLower: tickLower,
|
1249
|
-
tickUpper: tickUpper
|
1460
|
+
tickUpper: tickUpper,
|
1461
|
+
token0: token0,
|
1462
|
+
token1: token1
|
1250
1463
|
});
|
1251
1464
|
callArgs = callOnExternalPositionArgs({
|
1252
1465
|
actionArgs: actionArgs,
|
@@ -1518,19 +1731,234 @@ function _aaveRedeem() {
|
|
1518
1731
|
|
1519
1732
|
var _templateObject$2;
|
1520
1733
|
var ICompoundComptroller = contract()(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n function claimComp(address)\n"])));
|
1521
|
-
function
|
1522
|
-
return
|
1734
|
+
function assertCompoundLend(_x) {
|
1735
|
+
return _assertCompoundLend.apply(this, arguments);
|
1523
1736
|
}
|
1524
1737
|
|
1525
|
-
function
|
1526
|
-
|
1527
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter,
|
1738
|
+
function _assertCompoundLend() {
|
1739
|
+
_assertCompoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1740
|
+
var tokenWhale, comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, _ref$tokenAmount, tokenAmount, cToken, compoundPriceFeed, token, rateBefore, minIncomingCTokenAmount, _yield$getAssetBalanc, _yield$getAssetBalanc2, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, lendReceipt, rate, _yield$getAssetBalanc3, _yield$getAssetBalanc4, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, expectedCTokenAmount;
|
1528
1741
|
|
1529
1742
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1530
1743
|
while (1) {
|
1531
1744
|
switch (_context.prev = _context.next) {
|
1532
1745
|
case 0:
|
1533
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
1746
|
+
tokenWhale = _ref.tokenWhale, comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? utils.parseEther('1') : _ref$tokenAmount, cToken = _ref.cToken, compoundPriceFeed = _ref.compoundPriceFeed;
|
1747
|
+
_context.t0 = StandardToken;
|
1748
|
+
_context.next = 4;
|
1749
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1750
|
+
|
1751
|
+
case 4:
|
1752
|
+
_context.t1 = _context.sent;
|
1753
|
+
_context.t2 = tokenWhale;
|
1754
|
+
token = new _context.t0(_context.t1, _context.t2);
|
1755
|
+
_context.next = 9;
|
1756
|
+
return token.connect(tokenWhale).transfer(vaultProxy, tokenAmount);
|
1757
|
+
|
1758
|
+
case 9:
|
1759
|
+
_context.next = 11;
|
1760
|
+
return cToken.exchangeRateStored.call();
|
1761
|
+
|
1762
|
+
case 11:
|
1763
|
+
rateBefore = _context.sent;
|
1764
|
+
// Exchange rate stored can have a small deviation from exchangeRateStored
|
1765
|
+
minIncomingCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rateBefore).mul(BigNumber.from('999')).div(BigNumber.from('1000'));
|
1766
|
+
_context.next = 15;
|
1767
|
+
return getAssetBalances({
|
1768
|
+
account: vaultProxy,
|
1769
|
+
assets: [cToken, token]
|
1770
|
+
});
|
1771
|
+
|
1772
|
+
case 15:
|
1773
|
+
_yield$getAssetBalanc = _context.sent;
|
1774
|
+
_yield$getAssetBalanc2 = _slicedToArray(_yield$getAssetBalanc, 2);
|
1775
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc2[0];
|
1776
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc2[1];
|
1777
|
+
_context.next = 21;
|
1778
|
+
return compoundLend({
|
1779
|
+
cToken: cToken,
|
1780
|
+
cTokenAmount: minIncomingCTokenAmount,
|
1781
|
+
compoundAdapter: compoundAdapter,
|
1782
|
+
comptrollerProxy: comptrollerProxy,
|
1783
|
+
fundOwner: fundOwner,
|
1784
|
+
integrationManager: integrationManager,
|
1785
|
+
tokenAmount: tokenAmount
|
1786
|
+
});
|
1787
|
+
|
1788
|
+
case 21:
|
1789
|
+
lendReceipt = _context.sent;
|
1790
|
+
_context.next = 24;
|
1791
|
+
return cToken.exchangeRateStored();
|
1792
|
+
|
1793
|
+
case 24:
|
1794
|
+
rate = _context.sent;
|
1795
|
+
_context.next = 27;
|
1796
|
+
return getAssetBalances({
|
1797
|
+
account: vaultProxy,
|
1798
|
+
assets: [cToken, token]
|
1799
|
+
});
|
1800
|
+
|
1801
|
+
case 27:
|
1802
|
+
_yield$getAssetBalanc3 = _context.sent;
|
1803
|
+
_yield$getAssetBalanc4 = _slicedToArray(_yield$getAssetBalanc3, 2);
|
1804
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc4[0];
|
1805
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc4[1];
|
1806
|
+
expectedCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rate);
|
1807
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedCTokenAmount));
|
1808
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(tokenAmount));
|
1809
|
+
return _context.abrupt("return", lendReceipt);
|
1810
|
+
|
1811
|
+
case 35:
|
1812
|
+
case "end":
|
1813
|
+
return _context.stop();
|
1814
|
+
}
|
1815
|
+
}
|
1816
|
+
}, _callee);
|
1817
|
+
}));
|
1818
|
+
return _assertCompoundLend.apply(this, arguments);
|
1819
|
+
}
|
1820
|
+
|
1821
|
+
function assertCompoundRedeem(_x2) {
|
1822
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
1823
|
+
}
|
1824
|
+
|
1825
|
+
function _assertCompoundRedeem() {
|
1826
|
+
_assertCompoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
1827
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, cToken, compoundPriceFeed, cTokenAmount, token, _yield$getAssetBalanc5, _yield$getAssetBalanc6, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, rateBefore, minIncomingTokenAmount, redeemReceipt, _yield$getAssetBalanc7, _yield$getAssetBalanc8, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, rate, expectedTokenAmount;
|
1828
|
+
|
1829
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1830
|
+
while (1) {
|
1831
|
+
switch (_context2.prev = _context2.next) {
|
1832
|
+
case 0:
|
1833
|
+
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, compoundPriceFeed = _ref2.compoundPriceFeed;
|
1834
|
+
_context2.t0 = utils;
|
1835
|
+
_context2.next = 4;
|
1836
|
+
return cToken.decimals();
|
1837
|
+
|
1838
|
+
case 4:
|
1839
|
+
_context2.t1 = _context2.sent;
|
1840
|
+
cTokenAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
1841
|
+
_context2.next = 8;
|
1842
|
+
return cToken.transfer(vaultProxy, cTokenAmount);
|
1843
|
+
|
1844
|
+
case 8:
|
1845
|
+
_context2.t2 = StandardToken;
|
1846
|
+
_context2.next = 11;
|
1847
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1848
|
+
|
1849
|
+
case 11:
|
1850
|
+
_context2.t3 = _context2.sent;
|
1851
|
+
_context2.t4 = provider;
|
1852
|
+
token = new _context2.t2(_context2.t3, _context2.t4);
|
1853
|
+
_context2.next = 16;
|
1854
|
+
return getAssetBalances({
|
1855
|
+
account: vaultProxy,
|
1856
|
+
assets: [token, cToken]
|
1857
|
+
});
|
1858
|
+
|
1859
|
+
case 16:
|
1860
|
+
_yield$getAssetBalanc5 = _context2.sent;
|
1861
|
+
_yield$getAssetBalanc6 = _slicedToArray(_yield$getAssetBalanc5, 2);
|
1862
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc6[0];
|
1863
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc6[1];
|
1864
|
+
_context2.next = 22;
|
1865
|
+
return cToken.exchangeRateStored();
|
1866
|
+
|
1867
|
+
case 22:
|
1868
|
+
rateBefore = _context2.sent;
|
1869
|
+
minIncomingTokenAmount = cTokenAmount.mul(rateBefore).div(utils.parseEther('1'));
|
1870
|
+
_context2.next = 26;
|
1871
|
+
return compoundRedeem({
|
1872
|
+
cToken: cToken,
|
1873
|
+
cTokenAmount: cTokenAmount,
|
1874
|
+
compoundAdapter: compoundAdapter,
|
1875
|
+
comptrollerProxy: comptrollerProxy,
|
1876
|
+
fundOwner: fundOwner,
|
1877
|
+
integrationManager: integrationManager,
|
1878
|
+
tokenAmount: minIncomingTokenAmount,
|
1879
|
+
vaultProxy: vaultProxy
|
1880
|
+
});
|
1881
|
+
|
1882
|
+
case 26:
|
1883
|
+
redeemReceipt = _context2.sent;
|
1884
|
+
_context2.next = 29;
|
1885
|
+
return getAssetBalances({
|
1886
|
+
account: vaultProxy,
|
1887
|
+
assets: [token, cToken]
|
1888
|
+
});
|
1889
|
+
|
1890
|
+
case 29:
|
1891
|
+
_yield$getAssetBalanc7 = _context2.sent;
|
1892
|
+
_yield$getAssetBalanc8 = _slicedToArray(_yield$getAssetBalanc7, 2);
|
1893
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc8[0];
|
1894
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc8[1];
|
1895
|
+
_context2.next = 35;
|
1896
|
+
return cToken.exchangeRateStored();
|
1897
|
+
|
1898
|
+
case 35:
|
1899
|
+
rate = _context2.sent;
|
1900
|
+
expectedTokenAmount = cTokenAmount.mul(rate).div(utils.parseEther('1'));
|
1901
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedTokenAmount));
|
1902
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(cTokenAmount));
|
1903
|
+
return _context2.abrupt("return", redeemReceipt);
|
1904
|
+
|
1905
|
+
case 40:
|
1906
|
+
case "end":
|
1907
|
+
return _context2.stop();
|
1908
|
+
}
|
1909
|
+
}
|
1910
|
+
}, _callee2);
|
1911
|
+
}));
|
1912
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
1913
|
+
}
|
1914
|
+
|
1915
|
+
function compoundClaim(_x3) {
|
1916
|
+
return _compoundClaim.apply(this, arguments);
|
1917
|
+
}
|
1918
|
+
|
1919
|
+
function _compoundClaim() {
|
1920
|
+
_compoundClaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
1921
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, compoundComptroller, cTokens, claimArgs, callArgs, claimRewardsTx;
|
1922
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1923
|
+
while (1) {
|
1924
|
+
switch (_context3.prev = _context3.next) {
|
1925
|
+
case 0:
|
1926
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, compoundAdapter = _ref3.compoundAdapter, compoundComptroller = _ref3.compoundComptroller, cTokens = _ref3.cTokens;
|
1927
|
+
claimArgs = compoundClaimRewardsArgs({
|
1928
|
+
cTokens: cTokens,
|
1929
|
+
compoundComptroller: compoundComptroller
|
1930
|
+
});
|
1931
|
+
callArgs = callOnIntegrationArgs({
|
1932
|
+
adapter: compoundAdapter,
|
1933
|
+
encodedCallArgs: claimArgs,
|
1934
|
+
selector: claimRewardsSelector
|
1935
|
+
});
|
1936
|
+
claimRewardsTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1937
|
+
return _context3.abrupt("return", claimRewardsTx);
|
1938
|
+
|
1939
|
+
case 5:
|
1940
|
+
case "end":
|
1941
|
+
return _context3.stop();
|
1942
|
+
}
|
1943
|
+
}
|
1944
|
+
}, _callee3);
|
1945
|
+
}));
|
1946
|
+
return _compoundClaim.apply(this, arguments);
|
1947
|
+
}
|
1948
|
+
|
1949
|
+
function compoundLend(_x4) {
|
1950
|
+
return _compoundLend.apply(this, arguments);
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
function _compoundLend() {
|
1954
|
+
_compoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1955
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref4$tokenAmount, tokenAmount, _ref4$cTokenAmount, cTokenAmount, lendArgs, callArgs, lendTx;
|
1956
|
+
|
1957
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1958
|
+
while (1) {
|
1959
|
+
switch (_context4.prev = _context4.next) {
|
1960
|
+
case 0:
|
1961
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, compoundAdapter = _ref4.compoundAdapter, cToken = _ref4.cToken, _ref4$tokenAmount = _ref4.tokenAmount, tokenAmount = _ref4$tokenAmount === void 0 ? utils.parseEther('1') : _ref4$tokenAmount, _ref4$cTokenAmount = _ref4.cTokenAmount, cTokenAmount = _ref4$cTokenAmount === void 0 ? utils.parseEther('1') : _ref4$cTokenAmount;
|
1534
1962
|
lendArgs = compoundArgs({
|
1535
1963
|
cToken: cToken,
|
1536
1964
|
minIncomingAssetAmount: cTokenAmount,
|
@@ -1542,31 +1970,31 @@ function _compoundLend() {
|
|
1542
1970
|
selector: lendSelector
|
1543
1971
|
});
|
1544
1972
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1545
|
-
return
|
1973
|
+
return _context4.abrupt("return", lendTx);
|
1546
1974
|
|
1547
1975
|
case 5:
|
1548
1976
|
case "end":
|
1549
|
-
return
|
1977
|
+
return _context4.stop();
|
1550
1978
|
}
|
1551
1979
|
}
|
1552
|
-
},
|
1980
|
+
}, _callee4);
|
1553
1981
|
}));
|
1554
1982
|
return _compoundLend.apply(this, arguments);
|
1555
1983
|
}
|
1556
1984
|
|
1557
|
-
function compoundRedeem(
|
1985
|
+
function compoundRedeem(_x5) {
|
1558
1986
|
return _compoundRedeem.apply(this, arguments);
|
1559
1987
|
}
|
1560
1988
|
|
1561
1989
|
function _compoundRedeem() {
|
1562
|
-
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
1563
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken,
|
1990
|
+
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
1991
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref5$tokenAmount, tokenAmount, _ref5$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
1564
1992
|
|
1565
|
-
return _regeneratorRuntime.wrap(function
|
1993
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1566
1994
|
while (1) {
|
1567
|
-
switch (
|
1995
|
+
switch (_context5.prev = _context5.next) {
|
1568
1996
|
case 0:
|
1569
|
-
comptrollerProxy =
|
1997
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, fundOwner = _ref5.fundOwner, compoundAdapter = _ref5.compoundAdapter, cToken = _ref5.cToken, _ref5$tokenAmount = _ref5.tokenAmount, tokenAmount = _ref5$tokenAmount === void 0 ? utils.parseEther('1') : _ref5$tokenAmount, _ref5$cTokenAmount = _ref5.cTokenAmount, cTokenAmount = _ref5$cTokenAmount === void 0 ? utils.parseEther('1') : _ref5$cTokenAmount;
|
1570
1998
|
redeemArgs = compoundArgs({
|
1571
1999
|
cToken: resolveAddress(cToken),
|
1572
2000
|
minIncomingAssetAmount: tokenAmount,
|
@@ -1578,27 +2006,28 @@ function _compoundRedeem() {
|
|
1578
2006
|
selector: redeemSelector
|
1579
2007
|
});
|
1580
2008
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1581
|
-
return
|
2009
|
+
return _context5.abrupt("return", redeemTx);
|
1582
2010
|
|
1583
2011
|
case 5:
|
1584
2012
|
case "end":
|
1585
|
-
return
|
2013
|
+
return _context5.stop();
|
1586
2014
|
}
|
1587
2015
|
}
|
1588
|
-
},
|
2016
|
+
}, _callee5);
|
1589
2017
|
}));
|
1590
2018
|
return _compoundRedeem.apply(this, arguments);
|
1591
2019
|
}
|
1592
2020
|
|
1593
|
-
var _templateObject$1, _templateObject2, _templateObject3;
|
1594
|
-
var CurveLiquidityGaugeV2 = contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
2021
|
+
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
2022
|
+
var CurveLiquidityGaugeV2 = contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
2023
|
+
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
|
1595
2024
|
|
1596
|
-
var CurveSwaps = contract()(
|
1597
|
-
var CurveMinter = contract()(
|
2025
|
+
var CurveSwaps = contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
2026
|
+
var CurveMinter = contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
1598
2027
|
|
1599
2028
|
function curveTakeOrder(_x) {
|
1600
2029
|
return _curveTakeOrder.apply(this, arguments);
|
1601
|
-
} //
|
2030
|
+
} // combined liquidity
|
1602
2031
|
|
1603
2032
|
function _curveTakeOrder() {
|
1604
2033
|
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
@@ -1623,542 +2052,237 @@ function _curveTakeOrder() {
|
|
1623
2052
|
});
|
1624
2053
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1625
2054
|
|
1626
|
-
case 4:
|
1627
|
-
case "end":
|
1628
|
-
return _context.stop();
|
1629
|
-
}
|
1630
|
-
}
|
1631
|
-
}, _callee);
|
1632
|
-
}));
|
1633
|
-
return _curveTakeOrder.apply(this, arguments);
|
1634
|
-
}
|
1635
|
-
|
1636
|
-
function curveAaveClaimRewards(_ref2) {
|
1637
|
-
var comptrollerProxy = _ref2.comptrollerProxy,
|
1638
|
-
integrationManager = _ref2.integrationManager,
|
1639
|
-
fundOwner = _ref2.fundOwner,
|
1640
|
-
curveLiquidityAaveAdapter = _ref2.curveLiquidityAaveAdapter;
|
1641
|
-
var callArgs = callOnIntegrationArgs({
|
1642
|
-
adapter: curveLiquidityAaveAdapter,
|
1643
|
-
encodedCallArgs: constants.HashZero,
|
1644
|
-
selector: claimRewardsSelector
|
1645
|
-
});
|
1646
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1647
|
-
}
|
1648
|
-
function curveAaveLend(_ref3) {
|
1649
|
-
var comptrollerProxy = _ref3.comptrollerProxy,
|
1650
|
-
integrationManager = _ref3.integrationManager,
|
1651
|
-
fundOwner = _ref3.fundOwner,
|
1652
|
-
curveLiquidityAaveAdapter = _ref3.curveLiquidityAaveAdapter,
|
1653
|
-
_ref3$outgoingAaveDai = _ref3.outgoingAaveDaiAmount,
|
1654
|
-
outgoingAaveDaiAmount = _ref3$outgoingAaveDai === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveDai,
|
1655
|
-
_ref3$outgoingAaveUsd = _ref3.outgoingAaveUsdcAmount,
|
1656
|
-
outgoingAaveUsdcAmount = _ref3$outgoingAaveUsd === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveUsd,
|
1657
|
-
_ref3$outgoingAaveUsd2 = _ref3.outgoingAaveUsdtAmount,
|
1658
|
-
outgoingAaveUsdtAmount = _ref3$outgoingAaveUsd2 === void 0 ? BigNumber.from(0) : _ref3$outgoingAaveUsd2,
|
1659
|
-
_ref3$minIncomingLPTo = _ref3.minIncomingLPTokenAmount,
|
1660
|
-
minIncomingLPTokenAmount = _ref3$minIncomingLPTo === void 0 ? BigNumber.from(1) : _ref3$minIncomingLPTo,
|
1661
|
-
_ref3$useUnderlyings = _ref3.useUnderlyings,
|
1662
|
-
useUnderlyings = _ref3$useUnderlyings === void 0 ? false : _ref3$useUnderlyings;
|
1663
|
-
var callArgs = callOnIntegrationArgs({
|
1664
|
-
adapter: curveLiquidityAaveAdapter,
|
1665
|
-
encodedCallArgs: curveAaveLendArgs({
|
1666
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1667
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1668
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1669
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1670
|
-
useUnderlyings: useUnderlyings
|
1671
|
-
}),
|
1672
|
-
selector: lendSelector
|
1673
|
-
});
|
1674
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1675
|
-
}
|
1676
|
-
function curveAaveLendAndStake(_ref4) {
|
1677
|
-
var comptrollerProxy = _ref4.comptrollerProxy,
|
1678
|
-
integrationManager = _ref4.integrationManager,
|
1679
|
-
fundOwner = _ref4.fundOwner,
|
1680
|
-
curveLiquidityAaveAdapter = _ref4.curveLiquidityAaveAdapter,
|
1681
|
-
_ref4$outgoingAaveDai = _ref4.outgoingAaveDaiAmount,
|
1682
|
-
outgoingAaveDaiAmount = _ref4$outgoingAaveDai === void 0 ? BigNumber.from(0) : _ref4$outgoingAaveDai,
|
1683
|
-
_ref4$outgoingAaveUsd = _ref4.outgoingAaveUsdcAmount,
|
1684
|
-
outgoingAaveUsdcAmount = _ref4$outgoingAaveUsd === void 0 ? BigNumber.from(0) : _ref4$outgoingAaveUsd,
|
1685
|
-
_ref4$outgoingAaveUsd2 = _ref4.outgoingAaveUsdtAmount,
|
1686
|
-
outgoingAaveUsdtAmount = _ref4$outgoingAaveUsd2 === void 0 ? BigNumber.from(0) : _ref4$outgoingAaveUsd2,
|
1687
|
-
_ref4$minIncomingLiqu = _ref4.minIncomingLiquidityGaugeTokenAmount,
|
1688
|
-
minIncomingLiquidityGaugeTokenAmount = _ref4$minIncomingLiqu === void 0 ? BigNumber.from(1) : _ref4$minIncomingLiqu,
|
1689
|
-
_ref4$useUnderlyings = _ref4.useUnderlyings,
|
1690
|
-
useUnderlyings = _ref4$useUnderlyings === void 0 ? false : _ref4$useUnderlyings;
|
1691
|
-
var callArgs = callOnIntegrationArgs({
|
1692
|
-
adapter: curveLiquidityAaveAdapter,
|
1693
|
-
encodedCallArgs: curveAaveLendAndStakeArgs({
|
1694
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1695
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1696
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1697
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1698
|
-
useUnderlyings: useUnderlyings
|
1699
|
-
}),
|
1700
|
-
selector: lendAndStakeSelector
|
1701
|
-
});
|
1702
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1703
|
-
}
|
1704
|
-
function curveAaveRedeem(_ref5) {
|
1705
|
-
var comptrollerProxy = _ref5.comptrollerProxy,
|
1706
|
-
integrationManager = _ref5.integrationManager,
|
1707
|
-
fundOwner = _ref5.fundOwner,
|
1708
|
-
curveLiquidityAaveAdapter = _ref5.curveLiquidityAaveAdapter,
|
1709
|
-
outgoingLPTokenAmount = _ref5.outgoingLPTokenAmount,
|
1710
|
-
_ref5$minIncomingAave = _ref5.minIncomingAaveDaiAmount,
|
1711
|
-
minIncomingAaveDaiAmount = _ref5$minIncomingAave === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave,
|
1712
|
-
_ref5$minIncomingAave2 = _ref5.minIncomingAaveUsdcAmount,
|
1713
|
-
minIncomingAaveUsdcAmount = _ref5$minIncomingAave2 === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave2,
|
1714
|
-
_ref5$minIncomingAave3 = _ref5.minIncomingAaveUsdtAmount,
|
1715
|
-
minIncomingAaveUsdtAmount = _ref5$minIncomingAave3 === void 0 ? BigNumber.from(1) : _ref5$minIncomingAave3,
|
1716
|
-
_ref5$receiveSingleAs = _ref5.receiveSingleAsset,
|
1717
|
-
receiveSingleAsset = _ref5$receiveSingleAs === void 0 ? false : _ref5$receiveSingleAs,
|
1718
|
-
_ref5$useUnderlyings = _ref5.useUnderlyings,
|
1719
|
-
useUnderlyings = _ref5$useUnderlyings === void 0 ? false : _ref5$useUnderlyings;
|
1720
|
-
var callArgs = callOnIntegrationArgs({
|
1721
|
-
adapter: curveLiquidityAaveAdapter,
|
1722
|
-
encodedCallArgs: curveAaveRedeemArgs({
|
1723
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1724
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1725
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1726
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1727
|
-
receiveSingleAsset: receiveSingleAsset,
|
1728
|
-
useUnderlyings: useUnderlyings
|
1729
|
-
}),
|
1730
|
-
selector: redeemSelector
|
1731
|
-
});
|
1732
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1733
|
-
}
|
1734
|
-
function curveAaveStake(_ref6) {
|
1735
|
-
var comptrollerProxy = _ref6.comptrollerProxy,
|
1736
|
-
integrationManager = _ref6.integrationManager,
|
1737
|
-
fundOwner = _ref6.fundOwner,
|
1738
|
-
curveLiquidityAaveAdapter = _ref6.curveLiquidityAaveAdapter,
|
1739
|
-
outgoingLPTokenAmount = _ref6.outgoingLPTokenAmount;
|
1740
|
-
var callArgs = callOnIntegrationArgs({
|
1741
|
-
adapter: curveLiquidityAaveAdapter,
|
1742
|
-
encodedCallArgs: curveAaveStakeArgs({
|
1743
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1744
|
-
}),
|
1745
|
-
selector: stakeSelector
|
1746
|
-
});
|
1747
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1748
|
-
}
|
1749
|
-
function curveAaveUnstakeAndRedeem(_ref7) {
|
1750
|
-
var comptrollerProxy = _ref7.comptrollerProxy,
|
1751
|
-
integrationManager = _ref7.integrationManager,
|
1752
|
-
fundOwner = _ref7.fundOwner,
|
1753
|
-
curveLiquidityAaveAdapter = _ref7.curveLiquidityAaveAdapter,
|
1754
|
-
outgoingLiquidityGaugeTokenAmount = _ref7.outgoingLiquidityGaugeTokenAmount,
|
1755
|
-
_ref7$minIncomingAave = _ref7.minIncomingAaveDaiAmount,
|
1756
|
-
minIncomingAaveDaiAmount = _ref7$minIncomingAave === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave,
|
1757
|
-
_ref7$minIncomingAave2 = _ref7.minIncomingAaveUsdcAmount,
|
1758
|
-
minIncomingAaveUsdcAmount = _ref7$minIncomingAave2 === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave2,
|
1759
|
-
_ref7$minIncomingAave3 = _ref7.minIncomingAaveUsdtAmount,
|
1760
|
-
minIncomingAaveUsdtAmount = _ref7$minIncomingAave3 === void 0 ? BigNumber.from(1) : _ref7$minIncomingAave3,
|
1761
|
-
_ref7$receiveSingleAs = _ref7.receiveSingleAsset,
|
1762
|
-
receiveSingleAsset = _ref7$receiveSingleAs === void 0 ? false : _ref7$receiveSingleAs,
|
1763
|
-
_ref7$useUnderlyings = _ref7.useUnderlyings,
|
1764
|
-
useUnderlyings = _ref7$useUnderlyings === void 0 ? false : _ref7$useUnderlyings;
|
1765
|
-
var callArgs = callOnIntegrationArgs({
|
1766
|
-
adapter: curveLiquidityAaveAdapter,
|
1767
|
-
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
1768
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1769
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1770
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1771
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1772
|
-
receiveSingleAsset: receiveSingleAsset,
|
1773
|
-
useUnderlyings: useUnderlyings
|
1774
|
-
}),
|
1775
|
-
selector: unstakeAndRedeemSelector
|
1776
|
-
});
|
1777
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1778
|
-
}
|
1779
|
-
function curveAaveUnstake(_ref8) {
|
1780
|
-
var comptrollerProxy = _ref8.comptrollerProxy,
|
1781
|
-
integrationManager = _ref8.integrationManager,
|
1782
|
-
fundOwner = _ref8.fundOwner,
|
1783
|
-
curveLiquidityAaveAdapter = _ref8.curveLiquidityAaveAdapter,
|
1784
|
-
outgoingLiquidityGaugeTokenAmount = _ref8.outgoingLiquidityGaugeTokenAmount;
|
1785
|
-
var callArgs = callOnIntegrationArgs({
|
1786
|
-
adapter: curveLiquidityAaveAdapter,
|
1787
|
-
encodedCallArgs: curveAaveUnstakeArgs({
|
1788
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1789
|
-
}),
|
1790
|
-
selector: unstakeSelector
|
1791
|
-
});
|
1792
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1793
|
-
} // eurs pool
|
1794
|
-
|
1795
|
-
function curveEursClaimRewards(_ref9) {
|
1796
|
-
var comptrollerProxy = _ref9.comptrollerProxy,
|
1797
|
-
integrationManager = _ref9.integrationManager,
|
1798
|
-
fundOwner = _ref9.fundOwner,
|
1799
|
-
curveLiquidityEursAdapter = _ref9.curveLiquidityEursAdapter;
|
1800
|
-
var callArgs = callOnIntegrationArgs({
|
1801
|
-
adapter: curveLiquidityEursAdapter,
|
1802
|
-
encodedCallArgs: constants.HashZero,
|
1803
|
-
selector: claimRewardsSelector
|
1804
|
-
});
|
1805
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1806
|
-
}
|
1807
|
-
function curveEursLend(_ref10) {
|
1808
|
-
var comptrollerProxy = _ref10.comptrollerProxy,
|
1809
|
-
integrationManager = _ref10.integrationManager,
|
1810
|
-
fundOwner = _ref10.fundOwner,
|
1811
|
-
curveLiquidityEursAdapter = _ref10.curveLiquidityEursAdapter,
|
1812
|
-
outgoingEursAmount = _ref10.outgoingEursAmount,
|
1813
|
-
outgoingSeurAmount = _ref10.outgoingSeurAmount,
|
1814
|
-
minIncomingLPTokenAmount = _ref10.minIncomingLPTokenAmount;
|
1815
|
-
var callArgs = callOnIntegrationArgs({
|
1816
|
-
adapter: curveLiquidityEursAdapter,
|
1817
|
-
encodedCallArgs: curveEursLendArgs({
|
1818
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1819
|
-
outgoingEursAmount: outgoingEursAmount,
|
1820
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1821
|
-
}),
|
1822
|
-
selector: lendSelector
|
1823
|
-
});
|
1824
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1825
|
-
}
|
1826
|
-
function curveEursLendAndStake(_ref11) {
|
1827
|
-
var comptrollerProxy = _ref11.comptrollerProxy,
|
1828
|
-
integrationManager = _ref11.integrationManager,
|
1829
|
-
fundOwner = _ref11.fundOwner,
|
1830
|
-
curveLiquidityEursAdapter = _ref11.curveLiquidityEursAdapter,
|
1831
|
-
outgoingEursAmount = _ref11.outgoingEursAmount,
|
1832
|
-
outgoingSeurAmount = _ref11.outgoingSeurAmount,
|
1833
|
-
minIncomingLiquidityGaugeTokenAmount = _ref11.minIncomingLiquidityGaugeTokenAmount;
|
1834
|
-
var callArgs = callOnIntegrationArgs({
|
1835
|
-
adapter: curveLiquidityEursAdapter,
|
1836
|
-
encodedCallArgs: curveEursLendAndStakeArgs({
|
1837
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1838
|
-
outgoingEursAmount: outgoingEursAmount,
|
1839
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1840
|
-
}),
|
1841
|
-
selector: lendAndStakeSelector
|
1842
|
-
});
|
1843
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1844
|
-
}
|
1845
|
-
function curveEursRedeem(_ref12) {
|
1846
|
-
var comptrollerProxy = _ref12.comptrollerProxy,
|
1847
|
-
integrationManager = _ref12.integrationManager,
|
1848
|
-
fundOwner = _ref12.fundOwner,
|
1849
|
-
curveLiquidityEursAdapter = _ref12.curveLiquidityEursAdapter,
|
1850
|
-
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
1851
|
-
minIncomingEursAmount = _ref12.minIncomingEursAmount,
|
1852
|
-
minIncomingSeurAmount = _ref12.minIncomingSeurAmount,
|
1853
|
-
receiveSingleAsset = _ref12.receiveSingleAsset;
|
1854
|
-
var callArgs = callOnIntegrationArgs({
|
1855
|
-
adapter: curveLiquidityEursAdapter,
|
1856
|
-
encodedCallArgs: curveEursRedeemArgs({
|
1857
|
-
minIncomingEursAmount: minIncomingEursAmount,
|
1858
|
-
minIncomingSeurAmount: minIncomingSeurAmount,
|
1859
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1860
|
-
receiveSingleAsset: receiveSingleAsset
|
1861
|
-
}),
|
1862
|
-
selector: redeemSelector
|
1863
|
-
});
|
1864
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1865
|
-
}
|
1866
|
-
function curveEursStake(_ref13) {
|
1867
|
-
var comptrollerProxy = _ref13.comptrollerProxy,
|
1868
|
-
integrationManager = _ref13.integrationManager,
|
1869
|
-
fundOwner = _ref13.fundOwner,
|
1870
|
-
curveLiquidityEursAdapter = _ref13.curveLiquidityEursAdapter,
|
1871
|
-
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
1872
|
-
var callArgs = callOnIntegrationArgs({
|
1873
|
-
adapter: curveLiquidityEursAdapter,
|
1874
|
-
encodedCallArgs: curveEursStakeArgs({
|
1875
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1876
|
-
}),
|
1877
|
-
selector: stakeSelector
|
1878
|
-
});
|
1879
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1880
|
-
}
|
1881
|
-
function curveEursUnstakeAndRedeem(_ref14) {
|
1882
|
-
var comptrollerProxy = _ref14.comptrollerProxy,
|
1883
|
-
integrationManager = _ref14.integrationManager,
|
1884
|
-
fundOwner = _ref14.fundOwner,
|
1885
|
-
curveLiquidityEursAdapter = _ref14.curveLiquidityEursAdapter,
|
1886
|
-
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
1887
|
-
minIncomingEursAmount = _ref14.minIncomingEursAmount,
|
1888
|
-
minIncomingSeurAmount = _ref14.minIncomingSeurAmount,
|
1889
|
-
receiveSingleAsset = _ref14.receiveSingleAsset;
|
1890
|
-
var callArgs = callOnIntegrationArgs({
|
1891
|
-
adapter: curveLiquidityEursAdapter,
|
1892
|
-
encodedCallArgs: curveEursUnstakeAndRedeemArgs({
|
1893
|
-
minIncomingEursAmount: minIncomingEursAmount,
|
1894
|
-
minIncomingSeurAmount: minIncomingSeurAmount,
|
1895
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1896
|
-
receiveSingleAsset: receiveSingleAsset
|
1897
|
-
}),
|
1898
|
-
selector: unstakeAndRedeemSelector
|
1899
|
-
});
|
1900
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2055
|
+
case 4:
|
2056
|
+
case "end":
|
2057
|
+
return _context.stop();
|
2058
|
+
}
|
2059
|
+
}
|
2060
|
+
}, _callee);
|
2061
|
+
}));
|
2062
|
+
return _curveTakeOrder.apply(this, arguments);
|
1901
2063
|
}
|
1902
|
-
function curveEursUnstake(_ref15) {
|
1903
|
-
var comptrollerProxy = _ref15.comptrollerProxy,
|
1904
|
-
integrationManager = _ref15.integrationManager,
|
1905
|
-
fundOwner = _ref15.fundOwner,
|
1906
|
-
curveLiquidityEursAdapter = _ref15.curveLiquidityEursAdapter,
|
1907
|
-
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
1908
|
-
var callArgs = callOnIntegrationArgs({
|
1909
|
-
adapter: curveLiquidityEursAdapter,
|
1910
|
-
encodedCallArgs: curveEursUnstakeArgs({
|
1911
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1912
|
-
}),
|
1913
|
-
selector: unstakeSelector
|
1914
|
-
});
|
1915
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1916
|
-
} // sETH pool
|
1917
2064
|
|
1918
|
-
function
|
1919
|
-
var comptrollerProxy =
|
1920
|
-
integrationManager =
|
1921
|
-
fundOwner =
|
1922
|
-
|
2065
|
+
function curveClaimRewards(_ref2) {
|
2066
|
+
var comptrollerProxy = _ref2.comptrollerProxy,
|
2067
|
+
integrationManager = _ref2.integrationManager,
|
2068
|
+
fundOwner = _ref2.fundOwner,
|
2069
|
+
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
2070
|
+
stakingToken = _ref2.stakingToken;
|
1923
2071
|
var callArgs = callOnIntegrationArgs({
|
1924
|
-
adapter:
|
1925
|
-
encodedCallArgs:
|
2072
|
+
adapter: curveLiquidityAdapter,
|
2073
|
+
encodedCallArgs: curveClaimRewardsArgs({
|
2074
|
+
stakingToken: stakingToken
|
2075
|
+
}),
|
1926
2076
|
selector: claimRewardsSelector
|
1927
2077
|
});
|
1928
2078
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1929
2079
|
}
|
1930
|
-
function
|
1931
|
-
|
1932
|
-
integrationManager = _ref17.integrationManager,
|
1933
|
-
fundOwner = _ref17.fundOwner,
|
1934
|
-
curveLiquiditySethAdapter = _ref17.curveLiquiditySethAdapter,
|
1935
|
-
outgoingWethAmount = _ref17.outgoingWethAmount,
|
1936
|
-
outgoingSethAmount = _ref17.outgoingSethAmount,
|
1937
|
-
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
1938
|
-
var callArgs = callOnIntegrationArgs({
|
1939
|
-
adapter: curveLiquiditySethAdapter,
|
1940
|
-
encodedCallArgs: curveSethLendArgs({
|
1941
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1942
|
-
outgoingSethAmount: outgoingSethAmount,
|
1943
|
-
outgoingWethAmount: outgoingWethAmount
|
1944
|
-
}),
|
1945
|
-
selector: lendSelector
|
1946
|
-
});
|
1947
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2080
|
+
function curveLend(_x2) {
|
2081
|
+
return _curveLend.apply(this, arguments);
|
1948
2082
|
}
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
2083
|
+
|
2084
|
+
function _curveLend() {
|
2085
|
+
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
2086
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
2087
|
+
|
2088
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2089
|
+
while (1) {
|
2090
|
+
switch (_context2.prev = _context2.next) {
|
2091
|
+
case 0:
|
2092
|
+
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;
|
2093
|
+
callArgs = callOnIntegrationArgs({
|
2094
|
+
adapter: curveLiquidityAdapter,
|
2095
|
+
encodedCallArgs: curveLendArgs({
|
2096
|
+
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
2097
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
2098
|
+
pool: pool,
|
2099
|
+
useUnderlyings: useUnderlyings
|
2100
|
+
}),
|
2101
|
+
selector: lendSelector
|
2102
|
+
});
|
2103
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2104
|
+
|
2105
|
+
case 3:
|
2106
|
+
case "end":
|
2107
|
+
return _context2.stop();
|
2108
|
+
}
|
2109
|
+
}
|
2110
|
+
}, _callee2);
|
2111
|
+
}));
|
2112
|
+
return _curveLend.apply(this, arguments);
|
1967
2113
|
}
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
fundOwner = _ref19.fundOwner,
|
1972
|
-
curveLiquiditySethAdapter = _ref19.curveLiquiditySethAdapter,
|
1973
|
-
outgoingLPTokenAmount = _ref19.outgoingLPTokenAmount,
|
1974
|
-
minIncomingWethAmount = _ref19.minIncomingWethAmount,
|
1975
|
-
minIncomingSethAmount = _ref19.minIncomingSethAmount,
|
1976
|
-
receiveSingleAsset = _ref19.receiveSingleAsset;
|
1977
|
-
var callArgs = callOnIntegrationArgs({
|
1978
|
-
adapter: curveLiquiditySethAdapter,
|
1979
|
-
encodedCallArgs: curveSethRedeemArgs({
|
1980
|
-
minIncomingSethAmount: minIncomingSethAmount,
|
1981
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1982
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1983
|
-
receiveSingleAsset: receiveSingleAsset
|
1984
|
-
}),
|
1985
|
-
selector: redeemSelector
|
1986
|
-
});
|
1987
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2114
|
+
|
2115
|
+
function curveLendAndStake(_x3) {
|
2116
|
+
return _curveLendAndStake.apply(this, arguments);
|
1988
2117
|
}
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2118
|
+
|
2119
|
+
function _curveLendAndStake() {
|
2120
|
+
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
2121
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingStakingToken, _ref4$minIncomingStak, minIncomingStakingTokenAmount, useUnderlyings, callArgs;
|
2122
|
+
|
2123
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2124
|
+
while (1) {
|
2125
|
+
switch (_context3.prev = _context3.next) {
|
2126
|
+
case 0:
|
2127
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingStakingToken = _ref4.incomingStakingToken, _ref4$minIncomingStak = _ref4.minIncomingStakingTokenAmount, minIncomingStakingTokenAmount = _ref4$minIncomingStak === void 0 ? BigNumber.from(1) : _ref4$minIncomingStak, useUnderlyings = _ref4.useUnderlyings;
|
2128
|
+
callArgs = callOnIntegrationArgs({
|
2129
|
+
adapter: curveLiquidityAdapter,
|
2130
|
+
encodedCallArgs: curveLendAndStakeArgs({
|
2131
|
+
incomingStakingToken: incomingStakingToken,
|
2132
|
+
minIncomingStakingTokenAmount: minIncomingStakingTokenAmount,
|
2133
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
2134
|
+
pool: pool,
|
2135
|
+
useUnderlyings: useUnderlyings
|
2136
|
+
}),
|
2137
|
+
selector: lendAndStakeSelector
|
2138
|
+
});
|
2139
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2140
|
+
|
2141
|
+
case 3:
|
2142
|
+
case "end":
|
2143
|
+
return _context3.stop();
|
2144
|
+
}
|
2145
|
+
}
|
2146
|
+
}, _callee3);
|
2147
|
+
}));
|
2148
|
+
return _curveLendAndStake.apply(this, arguments);
|
2003
2149
|
}
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
fundOwner = _ref21.fundOwner,
|
2008
|
-
curveLiquiditySethAdapter = _ref21.curveLiquiditySethAdapter,
|
2009
|
-
outgoingLiquidityGaugeTokenAmount = _ref21.outgoingLiquidityGaugeTokenAmount,
|
2010
|
-
minIncomingWethAmount = _ref21.minIncomingWethAmount,
|
2011
|
-
minIncomingSethAmount = _ref21.minIncomingSethAmount,
|
2012
|
-
receiveSingleAsset = _ref21.receiveSingleAsset;
|
2013
|
-
var callArgs = callOnIntegrationArgs({
|
2014
|
-
adapter: curveLiquiditySethAdapter,
|
2015
|
-
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
2016
|
-
minIncomingSethAmount: minIncomingSethAmount,
|
2017
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2018
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
2019
|
-
receiveSingleAsset: receiveSingleAsset
|
2020
|
-
}),
|
2021
|
-
selector: unstakeAndRedeemSelector
|
2022
|
-
});
|
2023
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2150
|
+
|
2151
|
+
function curveRedeem(_x4) {
|
2152
|
+
return _curveRedeem.apply(this, arguments);
|
2024
2153
|
}
|
2025
|
-
function curveSethUnstake(_ref22) {
|
2026
|
-
var comptrollerProxy = _ref22.comptrollerProxy,
|
2027
|
-
integrationManager = _ref22.integrationManager,
|
2028
|
-
fundOwner = _ref22.fundOwner,
|
2029
|
-
curveLiquiditySethAdapter = _ref22.curveLiquiditySethAdapter,
|
2030
|
-
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
2031
|
-
var callArgs = callOnIntegrationArgs({
|
2032
|
-
adapter: curveLiquiditySethAdapter,
|
2033
|
-
encodedCallArgs: curveSethUnstakeArgs({
|
2034
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
2035
|
-
}),
|
2036
|
-
selector: unstakeSelector
|
2037
|
-
});
|
2038
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2039
|
-
} // stETH pool
|
2040
2154
|
|
2041
|
-
function
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2155
|
+
function _curveRedeem() {
|
2156
|
+
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref5) {
|
2157
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
2158
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
2159
|
+
while (1) {
|
2160
|
+
switch (_context4.prev = _context4.next) {
|
2161
|
+
case 0:
|
2162
|
+
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;
|
2163
|
+
callArgs = callOnIntegrationArgs({
|
2164
|
+
adapter: curveLiquidityAdapter,
|
2165
|
+
encodedCallArgs: curveRedeemArgs({
|
2166
|
+
incomingAssetData: incomingAssetData,
|
2167
|
+
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
2168
|
+
pool: pool,
|
2169
|
+
redeemType: redeemType,
|
2170
|
+
useUnderlyings: useUnderlyings
|
2171
|
+
}),
|
2172
|
+
selector: redeemSelector
|
2173
|
+
});
|
2174
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2175
|
+
|
2176
|
+
case 3:
|
2177
|
+
case "end":
|
2178
|
+
return _context4.stop();
|
2179
|
+
}
|
2180
|
+
}
|
2181
|
+
}, _callee4);
|
2182
|
+
}));
|
2183
|
+
return _curveRedeem.apply(this, arguments);
|
2052
2184
|
}
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
fundOwner = _ref24.fundOwner,
|
2057
|
-
curveLiquidityStethAdapter = _ref24.curveLiquidityStethAdapter,
|
2058
|
-
outgoingWethAmount = _ref24.outgoingWethAmount,
|
2059
|
-
outgoingStethAmount = _ref24.outgoingStethAmount,
|
2060
|
-
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
2061
|
-
var callArgs = callOnIntegrationArgs({
|
2062
|
-
adapter: curveLiquidityStethAdapter,
|
2063
|
-
encodedCallArgs: curveStethLendArgs({
|
2064
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
2065
|
-
outgoingStethAmount: outgoingStethAmount,
|
2066
|
-
outgoingWethAmount: outgoingWethAmount
|
2067
|
-
}),
|
2068
|
-
selector: lendSelector
|
2069
|
-
});
|
2070
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2185
|
+
|
2186
|
+
function curveStake(_x5) {
|
2187
|
+
return _curveStake.apply(this, arguments);
|
2071
2188
|
}
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2189
|
+
|
2190
|
+
function _curveStake() {
|
2191
|
+
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref6) {
|
2192
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingStakingToken, amount, callArgs;
|
2193
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
2194
|
+
while (1) {
|
2195
|
+
switch (_context5.prev = _context5.next) {
|
2196
|
+
case 0:
|
2197
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingStakingToken = _ref6.incomingStakingToken, amount = _ref6.amount;
|
2198
|
+
callArgs = callOnIntegrationArgs({
|
2199
|
+
adapter: curveLiquidityAdapter,
|
2200
|
+
encodedCallArgs: curveStakeArgs({
|
2201
|
+
amount: amount,
|
2202
|
+
incomingStakingToken: incomingStakingToken,
|
2203
|
+
pool: pool
|
2204
|
+
}),
|
2205
|
+
selector: stakeSelector
|
2206
|
+
});
|
2207
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2208
|
+
|
2209
|
+
case 3:
|
2210
|
+
case "end":
|
2211
|
+
return _context5.stop();
|
2212
|
+
}
|
2213
|
+
}
|
2214
|
+
}, _callee5);
|
2215
|
+
}));
|
2216
|
+
return _curveStake.apply(this, arguments);
|
2090
2217
|
}
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
fundOwner = _ref26.fundOwner,
|
2095
|
-
curveLiquidityStethAdapter = _ref26.curveLiquidityStethAdapter,
|
2096
|
-
outgoingLPTokenAmount = _ref26.outgoingLPTokenAmount,
|
2097
|
-
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
2098
|
-
minIncomingStethAmount = _ref26.minIncomingStethAmount,
|
2099
|
-
receiveSingleAsset = _ref26.receiveSingleAsset;
|
2100
|
-
var callArgs = callOnIntegrationArgs({
|
2101
|
-
adapter: curveLiquidityStethAdapter,
|
2102
|
-
encodedCallArgs: curveStethRedeemArgs({
|
2103
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
2104
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2105
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
2106
|
-
receiveSingleAsset: receiveSingleAsset
|
2107
|
-
}),
|
2108
|
-
selector: redeemSelector
|
2109
|
-
});
|
2110
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2218
|
+
|
2219
|
+
function curveUnstake(_x6) {
|
2220
|
+
return _curveUnstake.apply(this, arguments);
|
2111
2221
|
}
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2222
|
+
|
2223
|
+
function _curveUnstake() {
|
2224
|
+
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref7) {
|
2225
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, amount, callArgs;
|
2226
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
2227
|
+
while (1) {
|
2228
|
+
switch (_context6.prev = _context6.next) {
|
2229
|
+
case 0:
|
2230
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingStakingToken = _ref7.outgoingStakingToken, amount = _ref7.amount;
|
2231
|
+
callArgs = callOnIntegrationArgs({
|
2232
|
+
adapter: curveLiquidityAdapter,
|
2233
|
+
encodedCallArgs: curveUnstakeArgs({
|
2234
|
+
amount: amount,
|
2235
|
+
outgoingStakingToken: outgoingStakingToken,
|
2236
|
+
pool: pool
|
2237
|
+
}),
|
2238
|
+
selector: unstakeSelector
|
2239
|
+
});
|
2240
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2241
|
+
|
2242
|
+
case 3:
|
2243
|
+
case "end":
|
2244
|
+
return _context6.stop();
|
2245
|
+
}
|
2246
|
+
}
|
2247
|
+
}, _callee6);
|
2248
|
+
}));
|
2249
|
+
return _curveUnstake.apply(this, arguments);
|
2126
2250
|
}
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
fundOwner = _ref28.fundOwner,
|
2131
|
-
curveLiquidityStethAdapter = _ref28.curveLiquidityStethAdapter,
|
2132
|
-
outgoingLiquidityGaugeTokenAmount = _ref28.outgoingLiquidityGaugeTokenAmount,
|
2133
|
-
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
2134
|
-
minIncomingStethAmount = _ref28.minIncomingStethAmount,
|
2135
|
-
receiveSingleAsset = _ref28.receiveSingleAsset;
|
2136
|
-
var callArgs = callOnIntegrationArgs({
|
2137
|
-
adapter: curveLiquidityStethAdapter,
|
2138
|
-
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
2139
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
2140
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2141
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
2142
|
-
receiveSingleAsset: receiveSingleAsset
|
2143
|
-
}),
|
2144
|
-
selector: unstakeAndRedeemSelector
|
2145
|
-
});
|
2146
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2251
|
+
|
2252
|
+
function curveUnstakeAndRedeem(_x7) {
|
2253
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2147
2254
|
}
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2255
|
+
|
2256
|
+
function _curveUnstakeAndRedeem() {
|
2257
|
+
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref8) {
|
2258
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, outgoingStakingTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
2259
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
2260
|
+
while (1) {
|
2261
|
+
switch (_context7.prev = _context7.next) {
|
2262
|
+
case 0:
|
2263
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingStakingToken = _ref8.outgoingStakingToken, outgoingStakingTokenAmount = _ref8.outgoingStakingTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
2264
|
+
callArgs = callOnIntegrationArgs({
|
2265
|
+
adapter: curveLiquidityAdapter,
|
2266
|
+
encodedCallArgs: curveUnstakeAndRedeemArgs({
|
2267
|
+
incomingAssetData: incomingAssetData,
|
2268
|
+
outgoingStakingToken: outgoingStakingToken,
|
2269
|
+
outgoingStakingTokenAmount: outgoingStakingTokenAmount,
|
2270
|
+
pool: pool,
|
2271
|
+
redeemType: redeemType,
|
2272
|
+
useUnderlyings: useUnderlyings
|
2273
|
+
}),
|
2274
|
+
selector: unstakeAndRedeemSelector
|
2275
|
+
});
|
2276
|
+
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2277
|
+
|
2278
|
+
case 3:
|
2279
|
+
case "end":
|
2280
|
+
return _context7.stop();
|
2281
|
+
}
|
2282
|
+
}
|
2283
|
+
}, _callee7);
|
2284
|
+
}));
|
2285
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2162
2286
|
}
|
2163
2287
|
|
2164
2288
|
function idleClaimRewards(_x) {
|
@@ -2346,53 +2470,70 @@ function _mockGenericSwap() {
|
|
2346
2470
|
return _mockGenericSwap.apply(this, arguments);
|
2347
2471
|
}
|
2348
2472
|
|
2349
|
-
function
|
2350
|
-
|
2351
|
-
return toTokens.map(function (toToken) {
|
2352
|
-
return {
|
2353
|
-
// Not supported in our protocol
|
2354
|
-
routes: [],
|
2355
|
-
to: toToken,
|
2356
|
-
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2357
|
-
|
2358
|
-
};
|
2359
|
-
});
|
2360
|
-
}
|
2361
|
-
function paraSwapV4TakeOrder(_x) {
|
2362
|
-
return _paraSwapV4TakeOrder.apply(this, arguments);
|
2473
|
+
function olympusV2Stake(_x) {
|
2474
|
+
return _olympusV2Stake.apply(this, arguments);
|
2363
2475
|
}
|
2364
2476
|
|
2365
|
-
function
|
2366
|
-
|
2367
|
-
var comptrollerProxy, integrationManager,
|
2368
|
-
|
2477
|
+
function _olympusV2Stake() {
|
2478
|
+
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2479
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
2369
2480
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2370
2481
|
while (1) {
|
2371
2482
|
switch (_context.prev = _context.next) {
|
2372
2483
|
case 0:
|
2373
|
-
comptrollerProxy =
|
2374
|
-
|
2375
|
-
|
2376
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2377
|
-
outgoingAsset: outgoingAsset,
|
2378
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
2379
|
-
paths: paths
|
2484
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
2485
|
+
stakeArgs = olympusV2StakeArgs({
|
2486
|
+
amount: amount
|
2380
2487
|
});
|
2381
2488
|
callArgs = callOnIntegrationArgs({
|
2382
|
-
adapter:
|
2383
|
-
encodedCallArgs:
|
2384
|
-
selector:
|
2489
|
+
adapter: olympusV2Adapter,
|
2490
|
+
encodedCallArgs: stakeArgs,
|
2491
|
+
selector: stakeSelector
|
2385
2492
|
});
|
2386
|
-
|
2493
|
+
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2494
|
+
return _context.abrupt("return", stakeTx);
|
2387
2495
|
|
2388
|
-
case
|
2496
|
+
case 5:
|
2389
2497
|
case "end":
|
2390
2498
|
return _context.stop();
|
2391
2499
|
}
|
2392
2500
|
}
|
2393
2501
|
}, _callee);
|
2394
2502
|
}));
|
2395
|
-
return
|
2503
|
+
return _olympusV2Stake.apply(this, arguments);
|
2504
|
+
}
|
2505
|
+
|
2506
|
+
function olympusV2Unstake(_x2) {
|
2507
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2508
|
+
}
|
2509
|
+
|
2510
|
+
function _olympusV2Unstake() {
|
2511
|
+
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2512
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
2513
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2514
|
+
while (1) {
|
2515
|
+
switch (_context2.prev = _context2.next) {
|
2516
|
+
case 0:
|
2517
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
2518
|
+
unstakeArgs = olympusV2UnstakeArgs({
|
2519
|
+
amount: amount
|
2520
|
+
});
|
2521
|
+
callArgs = callOnIntegrationArgs({
|
2522
|
+
adapter: olympusV2Adapter,
|
2523
|
+
encodedCallArgs: unstakeArgs,
|
2524
|
+
selector: unstakeSelector
|
2525
|
+
});
|
2526
|
+
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2527
|
+
return _context2.abrupt("return", unstakeTx);
|
2528
|
+
|
2529
|
+
case 5:
|
2530
|
+
case "end":
|
2531
|
+
return _context2.stop();
|
2532
|
+
}
|
2533
|
+
}
|
2534
|
+
}, _callee2);
|
2535
|
+
}));
|
2536
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2396
2537
|
}
|
2397
2538
|
|
2398
2539
|
function paraSwapV5GenerateDummyPaths(_ref) {
|
@@ -2556,24 +2697,16 @@ function synthetixAssignExchangeDelegate(_x) {
|
|
2556
2697
|
|
2557
2698
|
function _synthetixAssignExchangeDelegate() {
|
2558
2699
|
_synthetixAssignExchangeDelegate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2559
|
-
var comptrollerProxy,
|
2700
|
+
var comptrollerProxy, synthetixDelegateApprovals, fundOwner, delegate;
|
2560
2701
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2561
2702
|
while (1) {
|
2562
2703
|
switch (_context.prev = _context.next) {
|
2563
2704
|
case 0:
|
2564
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
2705
|
+
comptrollerProxy = _ref.comptrollerProxy, synthetixDelegateApprovals = _ref.synthetixDelegateApprovals, fundOwner = _ref.fundOwner, delegate = _ref.delegate;
|
2565
2706
|
_context.next = 3;
|
2566
|
-
return
|
2567
|
-
addressResolver: addressResolver,
|
2568
|
-
name: 'DelegateApprovals'
|
2569
|
-
});
|
2707
|
+
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(synthetixDelegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
2570
2708
|
|
2571
2709
|
case 3:
|
2572
|
-
delegateApprovals = _context.sent;
|
2573
|
-
_context.next = 6;
|
2574
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
2575
|
-
|
2576
|
-
case 6:
|
2577
2710
|
case "end":
|
2578
2711
|
return _context.stop();
|
2579
2712
|
}
|
@@ -2583,42 +2716,18 @@ function _synthetixAssignExchangeDelegate() {
|
|
2583
2716
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
2584
2717
|
}
|
2585
2718
|
|
2586
|
-
function
|
2587
|
-
return _synthetixResolveAddress.apply(this, arguments);
|
2588
|
-
}
|
2589
|
-
|
2590
|
-
function _synthetixResolveAddress() {
|
2591
|
-
_synthetixResolveAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2592
|
-
var addressResolver, name;
|
2593
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2594
|
-
while (1) {
|
2595
|
-
switch (_context2.prev = _context2.next) {
|
2596
|
-
case 0:
|
2597
|
-
addressResolver = _ref2.addressResolver, name = _ref2.name;
|
2598
|
-
return _context2.abrupt("return", addressResolver.requireAndGetAddress(utils.formatBytes32String(name), "Missing ".concat(name)));
|
2599
|
-
|
2600
|
-
case 2:
|
2601
|
-
case "end":
|
2602
|
-
return _context2.stop();
|
2603
|
-
}
|
2604
|
-
}
|
2605
|
-
}, _callee2);
|
2606
|
-
}));
|
2607
|
-
return _synthetixResolveAddress.apply(this, arguments);
|
2608
|
-
}
|
2609
|
-
|
2610
|
-
function synthetixRedeem(_x3) {
|
2719
|
+
function synthetixRedeem(_x2) {
|
2611
2720
|
return _synthetixRedeem.apply(this, arguments);
|
2612
2721
|
}
|
2613
2722
|
|
2614
2723
|
function _synthetixRedeem() {
|
2615
|
-
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
2724
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2616
2725
|
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
2617
|
-
return _regeneratorRuntime.wrap(function
|
2726
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2618
2727
|
while (1) {
|
2619
|
-
switch (
|
2728
|
+
switch (_context2.prev = _context2.next) {
|
2620
2729
|
case 0:
|
2621
|
-
comptrollerProxy =
|
2730
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, synthetixAdapter = _ref2.synthetixAdapter, synths = _ref2.synths;
|
2622
2731
|
redeemArgs = synthetixRedeemArgs({
|
2623
2732
|
synths: synths
|
2624
2733
|
});
|
@@ -2627,48 +2736,47 @@ function _synthetixRedeem() {
|
|
2627
2736
|
encodedCallArgs: redeemArgs,
|
2628
2737
|
selector: redeemSelector
|
2629
2738
|
});
|
2630
|
-
return
|
2739
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2631
2740
|
|
2632
2741
|
case 4:
|
2633
2742
|
case "end":
|
2634
|
-
return
|
2743
|
+
return _context2.stop();
|
2635
2744
|
}
|
2636
2745
|
}
|
2637
|
-
},
|
2746
|
+
}, _callee2);
|
2638
2747
|
}));
|
2639
2748
|
return _synthetixRedeem.apply(this, arguments);
|
2640
2749
|
}
|
2641
2750
|
|
2642
|
-
function synthetixTakeOrder(
|
2751
|
+
function synthetixTakeOrder(_x3) {
|
2643
2752
|
return _synthetixTakeOrder.apply(this, arguments);
|
2644
2753
|
}
|
2645
2754
|
|
2646
2755
|
function _synthetixTakeOrder() {
|
2647
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
2648
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
2756
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2757
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount, _ref3$minIncomingSusd, minIncomingSusdAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
2649
2758
|
|
2650
|
-
return _regeneratorRuntime.wrap(function
|
2759
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2651
2760
|
while (1) {
|
2652
|
-
switch (
|
2761
|
+
switch (_context3.prev = _context3.next) {
|
2653
2762
|
case 0:
|
2654
|
-
comptrollerProxy =
|
2763
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref3$outgoingAssetAm, _ref3$minIncomingSusd = _ref3.minIncomingSusdAmount, minIncomingSusdAmount = _ref3$minIncomingSusd === void 0 ? utils.parseEther('1') : _ref3$minIncomingSusd, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
2655
2764
|
|
2656
2765
|
if (!seedFund) {
|
2657
|
-
|
2766
|
+
_context3.next = 4;
|
2658
2767
|
break;
|
2659
2768
|
}
|
2660
2769
|
|
2661
|
-
|
2770
|
+
_context3.next = 4;
|
2662
2771
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
2663
2772
|
|
2664
2773
|
case 4:
|
2665
2774
|
takeOrderArgs = synthetixTakeOrderArgs({
|
2666
|
-
|
2667
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2775
|
+
minIncomingSusdAmount: minIncomingSusdAmount,
|
2668
2776
|
outgoingAsset: outgoingAsset,
|
2669
2777
|
outgoingAssetAmount: outgoingAssetAmount
|
2670
2778
|
});
|
2671
|
-
|
2779
|
+
_context3.next = 7;
|
2672
2780
|
return callOnIntegrationArgs({
|
2673
2781
|
adapter: synthetixAdapter,
|
2674
2782
|
encodedCallArgs: takeOrderArgs,
|
@@ -2676,15 +2784,15 @@ function _synthetixTakeOrder() {
|
|
2676
2784
|
});
|
2677
2785
|
|
2678
2786
|
case 7:
|
2679
|
-
callArgs =
|
2680
|
-
return
|
2787
|
+
callArgs = _context3.sent;
|
2788
|
+
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2681
2789
|
|
2682
2790
|
case 9:
|
2683
2791
|
case "end":
|
2684
|
-
return
|
2792
|
+
return _context3.stop();
|
2685
2793
|
}
|
2686
2794
|
}
|
2687
|
-
},
|
2795
|
+
}, _callee3);
|
2688
2796
|
}));
|
2689
2797
|
return _synthetixTakeOrder.apply(this, arguments);
|
2690
2798
|
}
|
@@ -3645,12 +3753,15 @@ var whales = {
|
|
3645
3753
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
3646
3754
|
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3647
3755
|
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
3756
|
+
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3648
3757
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
3649
3758
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
3650
3759
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
3760
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
3651
3761
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
3652
3762
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
3653
3763
|
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
3764
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
3654
3765
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
3655
3766
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
3656
3767
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
@@ -3658,23 +3769,29 @@ var whales = {
|
|
3658
3769
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
3659
3770
|
// aTokens
|
3660
3771
|
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3772
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
3661
3773
|
// cTokens
|
3662
3774
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
3663
3775
|
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
3664
3776
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
3665
3777
|
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
3666
|
-
cusdc: '
|
3778
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
3779
|
+
// fTokens
|
3780
|
+
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
3781
|
+
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
3782
|
+
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
3783
|
+
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
3667
3784
|
// ptTokens
|
3668
3785
|
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
3669
|
-
// synths
|
3786
|
+
// synths (unsupported)
|
3670
3787
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
3671
|
-
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
3672
3788
|
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
3673
3789
|
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
3674
3790
|
// misc
|
3675
3791
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
3676
|
-
|
3677
|
-
|
3792
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
3793
|
+
// Curve steth pool related
|
3794
|
+
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663'
|
3678
3795
|
};
|
3679
3796
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
3680
3797
|
|
@@ -3908,4 +4025,4 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
3908
4025
|
expect(utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
3909
4026
|
}
|
3910
4027
|
|
3911
|
-
export { CurveLiquidityGaugeV2, CurveMinter, 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,
|
4028
|
+
export { CurveLiquidityGaugeV2, CurveMinter, CurveRegistry, CurveSwaps, ICompoundComptroller, IUniswapV3NonFungibleTokenManager, UniswapV2Factory, UniswapV3FeeAmount, aaveDebtPositionAddCollateral, aaveDebtPositionBorrow, aaveDebtPositionClaimRewards, aaveDebtPositionRemoveCollateral, aaveDebtPositionRepayBorrow, aaveLend, aaveRedeem, addNewAssetsToFund, addTrackedAssetsToVault, assertCompoundLend, assertCompoundRedeem, assertDidRelay, assertDidRelaySuccessfully, assertDidRelayWithCharge, assertDidRelayWithError, assertEvent, assertNoEvent, assertPaymasterDidReject, assertPaymasterDidRejectForReason, buyShares, buySharesFunction, calcMlnValueAndBurnAmountForSharesBuyback, callOnExtension, callOnExternalPosition, compoundClaim, compoundDebtPositionAddCollateral, compoundDebtPositionBorrow, compoundDebtPositionClaimComp, compoundDebtPositionRemoveCollateral, compoundDebtPositionRepayBorrow, compoundLend, compoundRedeem, createAaveDebtPosition, createCompoundDebtPosition, createComptrollerProxy, createExternalPosition, createFundDeployer, createMigrationRequest, createMockExternalPosition, createNewFund, createReconfigurationRequest, createUniswapV3LiquidityPosition, createVaultProxy, curveClaimRewards, curveLend, curveLendAndStake, curveRedeem, curveStake, 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, paraSwapV5GenerateDummyPaths, paraSwapV5TakeOrder, poolTogetherV4ClaimRewards, poolTogetherV4Lend, poolTogetherV4Redeem, reactivateExternalPosition, redeemSharesForSpecificAssets, redeemSharesInKind, relayTransaction, removeExternalPosition, removeTrackedAssetsFromVault, setupGasRelayerPaymaster, synthetixAssignExchangeDelegate, synthetixRedeem, synthetixTakeOrder, transactionTimestamp, uniswapV2Lend, uniswapV2Redeem, uniswapV2TakeOrder, uniswapV3LiquidityPositionAddLiquidity, uniswapV3LiquidityPositionCollect, uniswapV3LiquidityPositionGetMaxTick, uniswapV3LiquidityPositionGetMinTick, uniswapV3LiquidityPositionMint, uniswapV3LiquidityPositionPurge, uniswapV3LiquidityPositionRemoveLiquidity, uniswapV3OrderTokenPair, uniswapV3TakeOrder, unlockAllWhales, unlockWhale, unlockWhales, updateChainlinkAggregator, vaultCallCreateNewList, vaultCallCurveMinterMint, vaultCallCurveMinterMintMany, vaultCallCurveMinterToggleApproveMint, vaultCallStartAssetBypassTimelock, yearnVaultV2Lend, yearnVaultV2Redeem, zeroExV2TakeOrder };
|