@enzymefinance/testutils 4.0.0-next.6 → 4.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/declarations/src/deployment.d.ts +19 -16
- 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/actions.d.ts +2 -1
- 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 +13 -71
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +2 -2
- 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 +6 -3
- package/dist/enzymefinance-testutils.browser.cjs.js +403 -344
- package/dist/enzymefinance-testutils.browser.esm.js +402 -338
- package/dist/enzymefinance-testutils.cjs.dev.js +403 -344
- package/dist/enzymefinance-testutils.cjs.prod.js +403 -344
- package/dist/enzymefinance-testutils.esm.js +402 -338
- package/package.json +6 -6
- package/src/deployment.ts +19 -15
- package/src/scaffolding/core.ts +1 -9
- package/src/scaffolding/extensions/external-positions/actions.ts +6 -1
- 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 +21 -238
- package/src/scaffolding/extensions/integrations/synthetix.ts +6 -25
- package/src/types.d.ts +1 -0
- package/src/whales.ts +8 -3
|
@@ -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, AavePriceFeed, AddressListRegistry, AllowedAdapterIncomingAssetsPolicy, AllowedAdaptersPolicy, AllowedAssetsForRedemptionPolicy, AllowedDepositRecipientsPolicy, AllowedExternalPositionTypesPolicy, AllowedSharesTransferRecipientsPolicy, CompoundAdapter, CompoundDebtPositionLib, CompoundDebtPositionParser, CompoundPriceFeed, ComptrollerLib, ConvexCurveLpStakingAdapter, ConvexCurveLpStakingWrapperFactory, ConvexCurveLpStakingWrapperPriceFeed, CumulativeSlippageTolerancePolicy, CurveExchangeAdapter, CurveLiquidityAaveAdapter, CurveLiquidityAdapter, CurveLiquiditySethAdapter, CurveLiquidityStethAdapter, CurvePriceFeed, DepositWrapper, Dispatcher, EntranceRateBurnFee, EntranceRateDirectFee, ExitRateBurnFee, ExitRateDirectFee, ExternalPositionFactory, ExternalPositionManager, FeeManager, FundDeployer, FundValueCalculator, FundValueCalculatorRouter, FundValueCalculatorUsdWrapper, FuseAdapter, FusePriceFeed, GasRelayPaymasterFactory, IdleAdapter, IdlePriceFeed, IntegrationManager, LidoStethPriceFeed, ManagementFee, MinAssetBalancesPostRedemptionPolicy, MinMaxInvestmentPolicy, OlympusV2Adapter, OnlyRemoveDustExternalPositionPolicy, OnlyUntrackDustOrPricelessAssetsPolicy, ParaSwapV4Adapter, ParaSwapV5Adapter, PerformanceFee, PolicyManager, PoolTogetherV4Adapter, PoolTogetherV4PriceFeed, ProtocolFeeReserveLib, ProtocolFeeTracker, RevertingPriceFeed, StakehoundEthPriceFeed, SynthetixAdapter, UniswapV2ExchangeAdapter, UniswapV2LiquidityAdapter, UniswapV2PoolPriceFeed, UniswapV3Adapter, UnpermissionedActionsWrapper, ValueInterpreter, VaultLib, YearnVaultV2Adapter, YearnVaultV2PriceFeed, ZeroExV2Adapter, IntegrationManagerActionId, addTrackedAssetsToVaultArgs, removeTrackedAssetsFromVaultArgs, StandardToken, callOnExternalPositionArgs, ExternalPositionManagerActionId, IExternalPositionProxy, encodeArgs, externalPositionReactivateArgs, externalPositionRemoveArgs, compoundExternalPositionActionArgs, CompoundDebtPositionActionId, ExternalPositionType, MockGenericExternalPositionParser, MockGenericExternalPositionLib, mockGenericExternalPositionActionArgs, MockGenericExternalPositionActionId, uniswapV3LiquidityPositionAddLiquidityArgs, UniswapV3LiquidityPositionActionId, uniswapV3LiquidityPositionCollectArgs, UniswapV3LiquidityPositionLib, uniswapV3LiquidityPositionMintArgs, uniswapV3LiquidityPositionPurgeArgs, uniswapV3LiquidityPositionRemoveLiquidityArgs, feeManagerConfigArgs, FeeSettlementType, FeeHook, IFee, aaveLendArgs, callOnIntegrationArgs, lendSelector, aaveRedeemArgs, redeemSelector, compoundClaimRewardsArgs, claimRewardsSelector, compoundArgs, curveTakeOrderArgs, takeOrderSelector, curveClaimRewardsArgs, curveLendArgs, curveLendAndStakeArgs, lendAndStakeSelector, curveRedeemArgs, curveStakeArgs, stakeSelector, curveUnstakeArgs, unstakeSelector, curveUnstakeAndRedeemArgs, unstakeAndRedeemSelector, curveAaveLendArgs, curveAaveLendAndStakeArgs, curveAaveRedeemArgs, curveAaveStakeArgs, curveAaveUnstakeAndRedeemArgs, curveAaveUnstakeArgs, curveSethLendArgs, curveSethLendAndStakeArgs, curveSethRedeemArgs, curveSethStakeArgs, curveSethUnstakeAndRedeemArgs, curveSethUnstakeArgs, curveStethLendArgs, curveStethLendAndStakeArgs, curveStethRedeemArgs, curveStethStakeArgs, curveStethUnstakeAndRedeemArgs, curveStethUnstakeArgs, idleClaimRewardsArgs, idleLendArgs, idleRedeemArgs, sighash, olympusV2StakeArgs, olympusV2UnstakeArgs, paraSwapV4TakeOrderArgs, paraSwapV5TakeOrderArgs, poolTogetherV4LendArgs, poolTogetherV4RedeemArgs, poolTogetherV4ClaimRewardsArgs, synthetixAssignExchangeDelegateSelector, synthetixRedeemArgs, synthetixTakeOrderArgs, uniswapV2LendArgs, uniswapV2RedeemArgs, uniswapV2TakeOrderArgs, uniswapV3TakeOrderArgs, yearnVaultV2LendArgs, yearnVaultV2RedeemArgs, zeroExV2TakeOrderArgs, policyManagerConfigArgs, PolicyHook, IPolicy, encodeFunctionData, ComptrollerProxy, VaultProxy, GasRelayPaymasterLib, addressListRegistryCreateListSelector, curveMinterMintSelector, curveMinterMintManySelector, curveMinterToggleApproveMintSelector, IGsnRelayHub, createSignedRelayRequest, isTypedDataSigner } from '@enzymefinance/protocol';
|
|
4
4
|
import { utils, constants, BigNumber } from 'ethers';
|
|
5
5
|
import { extractEvent, contract, resolveAddress, randomAddress } from '@enzymefinance/ethers';
|
|
6
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
|
|
|
@@ -112,17 +113,18 @@ function _deployProtocolFixture() {
|
|
|
112
113
|
allowedDepositRecipientsPolicy: new AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
|
113
114
|
allowedExternalPositionTypesPolicy: new AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
|
114
115
|
allowedSharesTransferRecipientsPolicy: new AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
|
115
|
-
assetFinalityResolver: new AssetFinalityResolver(fixture['AssetFinalityResolver'].address, deployer),
|
|
116
116
|
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
|
117
117
|
compoundDebtPositionLib: new CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
|
118
118
|
compoundDebtPositionParser: new CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
|
119
119
|
compoundPriceFeed: new CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
|
120
120
|
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
|
121
|
+
convexCurveLpStakingAdapter: new ConvexCurveLpStakingAdapter(fixture['ConvexCurveLpStakingAdapter'].address, deployer),
|
|
122
|
+
convexCurveLpStakingWrapperFactory: new ConvexCurveLpStakingWrapperFactory(fixture['ConvexCurveLpStakingWrapperFactory'].address, deployer),
|
|
123
|
+
convexCurveLpStakingWrapperPriceFeed: new ConvexCurveLpStakingWrapperPriceFeed(fixture['ConvexCurveLpStakingWrapperPriceFeed'].address, deployer),
|
|
121
124
|
cumulativeSlippageTolerancePolicy: new CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
|
122
125
|
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
|
123
126
|
curveLiquidityAaveAdapter: new CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
|
124
127
|
curveLiquidityAdapter: new CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
|
125
|
-
curveLiquidityEursAdapter: new CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
|
126
128
|
curveLiquiditySethAdapter: new CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
|
127
129
|
curveLiquidityStethAdapter: new CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
|
128
130
|
curvePriceFeed: new CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
|
@@ -139,8 +141,9 @@ function _deployProtocolFixture() {
|
|
|
139
141
|
fundValueCalculator: new FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
|
140
142
|
fundValueCalculatorRouter: new FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
|
141
143
|
fundValueCalculatorUsdWrapper: new FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
|
144
|
+
fuseAdapter: new FuseAdapter(fixture['FuseAdapter'].address, deployer),
|
|
145
|
+
fusePriceFeed: new FusePriceFeed(fixture['FusePriceFeed'].address, deployer),
|
|
142
146
|
gasRelayPaymasterFactory: new GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
|
143
|
-
guaranteedRedemptionPolicy: new GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
|
144
147
|
idleAdapter: new IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
|
145
148
|
idlePriceFeed: new IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
|
146
149
|
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
|
@@ -163,7 +166,6 @@ function _deployProtocolFixture() {
|
|
|
163
166
|
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
|
164
167
|
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
|
165
168
|
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
|
166
|
-
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
|
167
169
|
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
|
168
170
|
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
|
169
171
|
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
|
@@ -381,13 +383,13 @@ function createFundDeployer(_x) {
|
|
|
381
383
|
|
|
382
384
|
function _createFundDeployer() {
|
|
383
385
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
384
|
-
var deployer,
|
|
386
|
+
var deployer, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
|
385
387
|
|
|
386
388
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
387
389
|
while (1) {
|
|
388
390
|
switch (_context.prev = _context.next) {
|
|
389
391
|
case 0:
|
|
390
|
-
deployer = _ref.deployer,
|
|
392
|
+
deployer = _ref.deployer, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
|
391
393
|
_context.next = 3;
|
|
392
394
|
return vaultLib.getMlnToken();
|
|
393
395
|
|
|
@@ -438,7 +440,7 @@ function _createFundDeployer() {
|
|
|
438
440
|
case 31:
|
|
439
441
|
nextIntegrationManager = _context.sent;
|
|
440
442
|
_context.next = 34;
|
|
441
|
-
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager,
|
|
443
|
+
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, gasRelayPaymasterFactory, mlnToken, wethToken);
|
|
442
444
|
|
|
443
445
|
case 34:
|
|
444
446
|
nextComptrollerLib = _context.sent;
|
|
@@ -599,15 +601,15 @@ function createExternalPosition(_x2) {
|
|
|
599
601
|
|
|
600
602
|
function _createExternalPosition() {
|
|
601
603
|
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
602
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
|
604
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, _ref2$callOnExternalP, callOnExternalPositionData, receipt, event, externalPositionProxy;
|
|
603
605
|
|
|
604
606
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
605
607
|
while (1) {
|
|
606
608
|
switch (_context2.prev = _context2.next) {
|
|
607
609
|
case 0:
|
|
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;
|
|
610
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD, _ref2$callOnExternalP = _ref2.callOnExternalPositionData, callOnExternalPositionData = _ref2$callOnExternalP === void 0 ? '0x' : _ref2$callOnExternalP;
|
|
609
611
|
_context2.next = 3;
|
|
610
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
|
612
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes', 'bytes'], [externalPositionTypeId, initializationData, callOnExternalPositionData]));
|
|
611
613
|
|
|
612
614
|
case 3:
|
|
613
615
|
receipt = _context2.sent;
|
|
@@ -936,7 +938,12 @@ function _createMockExternalPosition() {
|
|
|
936
938
|
|
|
937
939
|
case 21:
|
|
938
940
|
_context.next = 23;
|
|
939
|
-
return
|
|
941
|
+
return createExternalPosition({
|
|
942
|
+
comptrollerProxy: comptrollerProxy,
|
|
943
|
+
externalPositionManager: externalPositionManager,
|
|
944
|
+
externalPositionTypeId: typeId,
|
|
945
|
+
signer: fundOwner
|
|
946
|
+
});
|
|
940
947
|
|
|
941
948
|
case 23:
|
|
942
949
|
receipt = _context.sent;
|
|
@@ -1125,41 +1132,32 @@ function createUniswapV3LiquidityPosition(_x) {
|
|
|
1125
1132
|
|
|
1126
1133
|
function _createUniswapV3LiquidityPosition() {
|
|
1127
1134
|
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1128
|
-
var signer, comptrollerProxy, externalPositionManager,
|
|
1135
|
+
var signer, comptrollerProxy, externalPositionManager, _ref$callOnExternalPo, callOnExternalPositionData, _yield$createExternal, externalPositionProxyContract, receipt;
|
|
1136
|
+
|
|
1129
1137
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1130
1138
|
while (1) {
|
|
1131
1139
|
switch (_context.prev = _context.next) {
|
|
1132
1140
|
case 0:
|
|
1133
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager,
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1141
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, _ref$callOnExternalPo = _ref.callOnExternalPositionData, callOnExternalPositionData = _ref$callOnExternalPo === void 0 ? '0x' : _ref$callOnExternalPo;
|
|
1142
|
+
_context.next = 3;
|
|
1143
|
+
return createExternalPosition({
|
|
1144
|
+
callOnExternalPositionData: callOnExternalPositionData,
|
|
1145
|
+
comptrollerProxy: comptrollerProxy,
|
|
1146
|
+
externalPositionManager: externalPositionManager,
|
|
1147
|
+
externalPositionTypeId: ExternalPositionType.UniswapV3LiquidityPosition,
|
|
1148
|
+
signer: signer
|
|
1137
1149
|
});
|
|
1138
|
-
_context.next = 4;
|
|
1139
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [ExternalPositionType.UniswapV3LiquidityPosition, initArgs]));
|
|
1140
|
-
|
|
1141
|
-
case 4:
|
|
1142
|
-
receipt = _context.sent;
|
|
1143
|
-
_context.t0 = VaultLib;
|
|
1144
|
-
_context.next = 8;
|
|
1145
|
-
return comptrollerProxy.getVaultProxy();
|
|
1146
1150
|
|
|
1147
|
-
case
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
_context.next = 13;
|
|
1152
|
-
return vaultProxy.getActiveExternalPositions.call();
|
|
1153
|
-
|
|
1154
|
-
case 13:
|
|
1155
|
-
externalPositions = _context.sent;
|
|
1156
|
-
externalPositionProxyAddress = externalPositions[externalPositions.length - 1];
|
|
1151
|
+
case 3:
|
|
1152
|
+
_yield$createExternal = _context.sent;
|
|
1153
|
+
externalPositionProxyContract = _yield$createExternal.externalPositionProxy;
|
|
1154
|
+
receipt = _yield$createExternal.receipt;
|
|
1157
1155
|
return _context.abrupt("return", {
|
|
1158
|
-
externalPositionProxyAddress:
|
|
1156
|
+
externalPositionProxyAddress: externalPositionProxyContract.address,
|
|
1159
1157
|
receipt: receipt
|
|
1160
1158
|
});
|
|
1161
1159
|
|
|
1162
|
-
case
|
|
1160
|
+
case 7:
|
|
1163
1161
|
case "end":
|
|
1164
1162
|
return _context.stop();
|
|
1165
1163
|
}
|
|
@@ -1244,13 +1242,13 @@ function uniswapV3LiquidityPositionMint(_x4) {
|
|
|
1244
1242
|
|
|
1245
1243
|
function _uniswapV3LiquidityPositionMint() {
|
|
1246
1244
|
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
1247
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
|
1245
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
|
1248
1246
|
|
|
1249
1247
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1250
1248
|
while (1) {
|
|
1251
1249
|
switch (_context4.prev = _context4.next) {
|
|
1252
1250
|
case 0:
|
|
1253
|
-
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
|
1251
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, token0 = _ref4.token0, token1 = _ref4.token1, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
|
1254
1252
|
actionArgs = uniswapV3LiquidityPositionMintArgs({
|
|
1255
1253
|
amount0Desired: amount0Desired,
|
|
1256
1254
|
amount0Min: amount0Min,
|
|
@@ -1258,7 +1256,9 @@ function _uniswapV3LiquidityPositionMint() {
|
|
|
1258
1256
|
amount1Min: amount1Min,
|
|
1259
1257
|
fee: fee,
|
|
1260
1258
|
tickLower: tickLower,
|
|
1261
|
-
tickUpper: tickUpper
|
|
1259
|
+
tickUpper: tickUpper,
|
|
1260
|
+
token0: token0,
|
|
1261
|
+
token1: token1
|
|
1262
1262
|
});
|
|
1263
1263
|
callArgs = callOnExternalPositionArgs({
|
|
1264
1264
|
actionArgs: actionArgs,
|
|
@@ -1530,19 +1530,234 @@ function _aaveRedeem() {
|
|
|
1530
1530
|
|
|
1531
1531
|
var _templateObject$2;
|
|
1532
1532
|
var ICompoundComptroller = contract()(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n function claimComp(address)\n"])));
|
|
1533
|
-
function
|
|
1534
|
-
return
|
|
1533
|
+
function assertCompoundLend(_x) {
|
|
1534
|
+
return _assertCompoundLend.apply(this, arguments);
|
|
1535
1535
|
}
|
|
1536
1536
|
|
|
1537
|
-
function
|
|
1538
|
-
|
|
1539
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter,
|
|
1537
|
+
function _assertCompoundLend() {
|
|
1538
|
+
_assertCompoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
1539
|
+
var tokenWhale, comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, _ref$tokenAmount, tokenAmount, cToken, compoundPriceFeed, token, rateBefore, minIncomingCTokenAmount, _yield$getAssetBalanc, _yield$getAssetBalanc2, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, lendReceipt, rate, _yield$getAssetBalanc3, _yield$getAssetBalanc4, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, expectedCTokenAmount;
|
|
1540
1540
|
|
|
1541
1541
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1542
1542
|
while (1) {
|
|
1543
1543
|
switch (_context.prev = _context.next) {
|
|
1544
1544
|
case 0:
|
|
1545
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
|
1545
|
+
tokenWhale = _ref.tokenWhale, comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? utils.parseEther('1') : _ref$tokenAmount, cToken = _ref.cToken, compoundPriceFeed = _ref.compoundPriceFeed;
|
|
1546
|
+
_context.t0 = StandardToken;
|
|
1547
|
+
_context.next = 4;
|
|
1548
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
|
1549
|
+
|
|
1550
|
+
case 4:
|
|
1551
|
+
_context.t1 = _context.sent;
|
|
1552
|
+
_context.t2 = tokenWhale;
|
|
1553
|
+
token = new _context.t0(_context.t1, _context.t2);
|
|
1554
|
+
_context.next = 9;
|
|
1555
|
+
return token.connect(tokenWhale).transfer(vaultProxy, tokenAmount);
|
|
1556
|
+
|
|
1557
|
+
case 9:
|
|
1558
|
+
_context.next = 11;
|
|
1559
|
+
return cToken.exchangeRateStored.call();
|
|
1560
|
+
|
|
1561
|
+
case 11:
|
|
1562
|
+
rateBefore = _context.sent;
|
|
1563
|
+
// Exchange rate stored can have a small deviation from exchangeRateStored
|
|
1564
|
+
minIncomingCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rateBefore).mul(BigNumber.from('999')).div(BigNumber.from('1000'));
|
|
1565
|
+
_context.next = 15;
|
|
1566
|
+
return getAssetBalances({
|
|
1567
|
+
account: vaultProxy,
|
|
1568
|
+
assets: [cToken, token]
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
case 15:
|
|
1572
|
+
_yield$getAssetBalanc = _context.sent;
|
|
1573
|
+
_yield$getAssetBalanc2 = _slicedToArray(_yield$getAssetBalanc, 2);
|
|
1574
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc2[0];
|
|
1575
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc2[1];
|
|
1576
|
+
_context.next = 21;
|
|
1577
|
+
return compoundLend({
|
|
1578
|
+
cToken: cToken,
|
|
1579
|
+
cTokenAmount: minIncomingCTokenAmount,
|
|
1580
|
+
compoundAdapter: compoundAdapter,
|
|
1581
|
+
comptrollerProxy: comptrollerProxy,
|
|
1582
|
+
fundOwner: fundOwner,
|
|
1583
|
+
integrationManager: integrationManager,
|
|
1584
|
+
tokenAmount: tokenAmount
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
case 21:
|
|
1588
|
+
lendReceipt = _context.sent;
|
|
1589
|
+
_context.next = 24;
|
|
1590
|
+
return cToken.exchangeRateStored();
|
|
1591
|
+
|
|
1592
|
+
case 24:
|
|
1593
|
+
rate = _context.sent;
|
|
1594
|
+
_context.next = 27;
|
|
1595
|
+
return getAssetBalances({
|
|
1596
|
+
account: vaultProxy,
|
|
1597
|
+
assets: [cToken, token]
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
case 27:
|
|
1601
|
+
_yield$getAssetBalanc3 = _context.sent;
|
|
1602
|
+
_yield$getAssetBalanc4 = _slicedToArray(_yield$getAssetBalanc3, 2);
|
|
1603
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc4[0];
|
|
1604
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc4[1];
|
|
1605
|
+
expectedCTokenAmount = tokenAmount.mul(utils.parseEther('1')).div(rate);
|
|
1606
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedCTokenAmount));
|
|
1607
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(tokenAmount));
|
|
1608
|
+
return _context.abrupt("return", lendReceipt);
|
|
1609
|
+
|
|
1610
|
+
case 35:
|
|
1611
|
+
case "end":
|
|
1612
|
+
return _context.stop();
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}, _callee);
|
|
1616
|
+
}));
|
|
1617
|
+
return _assertCompoundLend.apply(this, arguments);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
function assertCompoundRedeem(_x2) {
|
|
1621
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
function _assertCompoundRedeem() {
|
|
1625
|
+
_assertCompoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
1626
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, cToken, compoundPriceFeed, cTokenAmount, token, _yield$getAssetBalanc5, _yield$getAssetBalanc6, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, rateBefore, minIncomingTokenAmount, redeemReceipt, _yield$getAssetBalanc7, _yield$getAssetBalanc8, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, rate, expectedTokenAmount;
|
|
1627
|
+
|
|
1628
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1629
|
+
while (1) {
|
|
1630
|
+
switch (_context2.prev = _context2.next) {
|
|
1631
|
+
case 0:
|
|
1632
|
+
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, compoundPriceFeed = _ref2.compoundPriceFeed;
|
|
1633
|
+
_context2.t0 = utils;
|
|
1634
|
+
_context2.next = 4;
|
|
1635
|
+
return cToken.decimals();
|
|
1636
|
+
|
|
1637
|
+
case 4:
|
|
1638
|
+
_context2.t1 = _context2.sent;
|
|
1639
|
+
cTokenAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
|
1640
|
+
_context2.next = 8;
|
|
1641
|
+
return cToken.transfer(vaultProxy, cTokenAmount);
|
|
1642
|
+
|
|
1643
|
+
case 8:
|
|
1644
|
+
_context2.t2 = StandardToken;
|
|
1645
|
+
_context2.next = 11;
|
|
1646
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
|
1647
|
+
|
|
1648
|
+
case 11:
|
|
1649
|
+
_context2.t3 = _context2.sent;
|
|
1650
|
+
_context2.t4 = provider;
|
|
1651
|
+
token = new _context2.t2(_context2.t3, _context2.t4);
|
|
1652
|
+
_context2.next = 16;
|
|
1653
|
+
return getAssetBalances({
|
|
1654
|
+
account: vaultProxy,
|
|
1655
|
+
assets: [token, cToken]
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
|
+
case 16:
|
|
1659
|
+
_yield$getAssetBalanc5 = _context2.sent;
|
|
1660
|
+
_yield$getAssetBalanc6 = _slicedToArray(_yield$getAssetBalanc5, 2);
|
|
1661
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc6[0];
|
|
1662
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc6[1];
|
|
1663
|
+
_context2.next = 22;
|
|
1664
|
+
return cToken.exchangeRateStored();
|
|
1665
|
+
|
|
1666
|
+
case 22:
|
|
1667
|
+
rateBefore = _context2.sent;
|
|
1668
|
+
minIncomingTokenAmount = cTokenAmount.mul(rateBefore).div(utils.parseEther('1'));
|
|
1669
|
+
_context2.next = 26;
|
|
1670
|
+
return compoundRedeem({
|
|
1671
|
+
cToken: cToken,
|
|
1672
|
+
cTokenAmount: cTokenAmount,
|
|
1673
|
+
compoundAdapter: compoundAdapter,
|
|
1674
|
+
comptrollerProxy: comptrollerProxy,
|
|
1675
|
+
fundOwner: fundOwner,
|
|
1676
|
+
integrationManager: integrationManager,
|
|
1677
|
+
tokenAmount: minIncomingTokenAmount,
|
|
1678
|
+
vaultProxy: vaultProxy
|
|
1679
|
+
});
|
|
1680
|
+
|
|
1681
|
+
case 26:
|
|
1682
|
+
redeemReceipt = _context2.sent;
|
|
1683
|
+
_context2.next = 29;
|
|
1684
|
+
return getAssetBalances({
|
|
1685
|
+
account: vaultProxy,
|
|
1686
|
+
assets: [token, cToken]
|
|
1687
|
+
});
|
|
1688
|
+
|
|
1689
|
+
case 29:
|
|
1690
|
+
_yield$getAssetBalanc7 = _context2.sent;
|
|
1691
|
+
_yield$getAssetBalanc8 = _slicedToArray(_yield$getAssetBalanc7, 2);
|
|
1692
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc8[0];
|
|
1693
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc8[1];
|
|
1694
|
+
_context2.next = 35;
|
|
1695
|
+
return cToken.exchangeRateStored();
|
|
1696
|
+
|
|
1697
|
+
case 35:
|
|
1698
|
+
rate = _context2.sent;
|
|
1699
|
+
expectedTokenAmount = cTokenAmount.mul(rate).div(utils.parseEther('1'));
|
|
1700
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedTokenAmount));
|
|
1701
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(cTokenAmount));
|
|
1702
|
+
return _context2.abrupt("return", redeemReceipt);
|
|
1703
|
+
|
|
1704
|
+
case 40:
|
|
1705
|
+
case "end":
|
|
1706
|
+
return _context2.stop();
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}, _callee2);
|
|
1710
|
+
}));
|
|
1711
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
function compoundClaim(_x3) {
|
|
1715
|
+
return _compoundClaim.apply(this, arguments);
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
function _compoundClaim() {
|
|
1719
|
+
_compoundClaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
1720
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, compoundComptroller, cTokens, claimArgs, callArgs, claimRewardsTx;
|
|
1721
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1722
|
+
while (1) {
|
|
1723
|
+
switch (_context3.prev = _context3.next) {
|
|
1724
|
+
case 0:
|
|
1725
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, compoundAdapter = _ref3.compoundAdapter, compoundComptroller = _ref3.compoundComptroller, cTokens = _ref3.cTokens;
|
|
1726
|
+
claimArgs = compoundClaimRewardsArgs({
|
|
1727
|
+
cTokens: cTokens,
|
|
1728
|
+
compoundComptroller: compoundComptroller
|
|
1729
|
+
});
|
|
1730
|
+
callArgs = callOnIntegrationArgs({
|
|
1731
|
+
adapter: compoundAdapter,
|
|
1732
|
+
encodedCallArgs: claimArgs,
|
|
1733
|
+
selector: claimRewardsSelector
|
|
1734
|
+
});
|
|
1735
|
+
claimRewardsTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1736
|
+
return _context3.abrupt("return", claimRewardsTx);
|
|
1737
|
+
|
|
1738
|
+
case 5:
|
|
1739
|
+
case "end":
|
|
1740
|
+
return _context3.stop();
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}, _callee3);
|
|
1744
|
+
}));
|
|
1745
|
+
return _compoundClaim.apply(this, arguments);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
function compoundLend(_x4) {
|
|
1749
|
+
return _compoundLend.apply(this, arguments);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
function _compoundLend() {
|
|
1753
|
+
_compoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
1754
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref4$tokenAmount, tokenAmount, _ref4$cTokenAmount, cTokenAmount, lendArgs, callArgs, lendTx;
|
|
1755
|
+
|
|
1756
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
1757
|
+
while (1) {
|
|
1758
|
+
switch (_context4.prev = _context4.next) {
|
|
1759
|
+
case 0:
|
|
1760
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, compoundAdapter = _ref4.compoundAdapter, cToken = _ref4.cToken, _ref4$tokenAmount = _ref4.tokenAmount, tokenAmount = _ref4$tokenAmount === void 0 ? utils.parseEther('1') : _ref4$tokenAmount, _ref4$cTokenAmount = _ref4.cTokenAmount, cTokenAmount = _ref4$cTokenAmount === void 0 ? utils.parseEther('1') : _ref4$cTokenAmount;
|
|
1546
1761
|
lendArgs = compoundArgs({
|
|
1547
1762
|
cToken: cToken,
|
|
1548
1763
|
minIncomingAssetAmount: cTokenAmount,
|
|
@@ -1554,31 +1769,31 @@ function _compoundLend() {
|
|
|
1554
1769
|
selector: lendSelector
|
|
1555
1770
|
});
|
|
1556
1771
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1557
|
-
return
|
|
1772
|
+
return _context4.abrupt("return", lendTx);
|
|
1558
1773
|
|
|
1559
1774
|
case 5:
|
|
1560
1775
|
case "end":
|
|
1561
|
-
return
|
|
1776
|
+
return _context4.stop();
|
|
1562
1777
|
}
|
|
1563
1778
|
}
|
|
1564
|
-
},
|
|
1779
|
+
}, _callee4);
|
|
1565
1780
|
}));
|
|
1566
1781
|
return _compoundLend.apply(this, arguments);
|
|
1567
1782
|
}
|
|
1568
1783
|
|
|
1569
|
-
function compoundRedeem(
|
|
1784
|
+
function compoundRedeem(_x5) {
|
|
1570
1785
|
return _compoundRedeem.apply(this, arguments);
|
|
1571
1786
|
}
|
|
1572
1787
|
|
|
1573
1788
|
function _compoundRedeem() {
|
|
1574
|
-
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1575
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken,
|
|
1789
|
+
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
1790
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref5$tokenAmount, tokenAmount, _ref5$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
|
1576
1791
|
|
|
1577
|
-
return _regeneratorRuntime.wrap(function
|
|
1792
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1578
1793
|
while (1) {
|
|
1579
|
-
switch (
|
|
1794
|
+
switch (_context5.prev = _context5.next) {
|
|
1580
1795
|
case 0:
|
|
1581
|
-
comptrollerProxy =
|
|
1796
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, fundOwner = _ref5.fundOwner, compoundAdapter = _ref5.compoundAdapter, cToken = _ref5.cToken, _ref5$tokenAmount = _ref5.tokenAmount, tokenAmount = _ref5$tokenAmount === void 0 ? utils.parseEther('1') : _ref5$tokenAmount, _ref5$cTokenAmount = _ref5.cTokenAmount, cTokenAmount = _ref5$cTokenAmount === void 0 ? utils.parseEther('1') : _ref5$cTokenAmount;
|
|
1582
1797
|
redeemArgs = compoundArgs({
|
|
1583
1798
|
cToken: resolveAddress(cToken),
|
|
1584
1799
|
minIncomingAssetAmount: tokenAmount,
|
|
@@ -1590,14 +1805,14 @@ function _compoundRedeem() {
|
|
|
1590
1805
|
selector: redeemSelector
|
|
1591
1806
|
});
|
|
1592
1807
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1593
|
-
return
|
|
1808
|
+
return _context5.abrupt("return", redeemTx);
|
|
1594
1809
|
|
|
1595
1810
|
case 5:
|
|
1596
1811
|
case "end":
|
|
1597
|
-
return
|
|
1812
|
+
return _context5.stop();
|
|
1598
1813
|
}
|
|
1599
1814
|
}
|
|
1600
|
-
},
|
|
1815
|
+
}, _callee5);
|
|
1601
1816
|
}));
|
|
1602
1817
|
return _compoundRedeem.apply(this, arguments);
|
|
1603
1818
|
}
|
|
@@ -1651,11 +1866,11 @@ function curveClaimRewards(_ref2) {
|
|
|
1651
1866
|
integrationManager = _ref2.integrationManager,
|
|
1652
1867
|
fundOwner = _ref2.fundOwner,
|
|
1653
1868
|
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
|
1654
|
-
|
|
1869
|
+
stakingToken = _ref2.stakingToken;
|
|
1655
1870
|
var callArgs = callOnIntegrationArgs({
|
|
1656
1871
|
adapter: curveLiquidityAdapter,
|
|
1657
1872
|
encodedCallArgs: curveClaimRewardsArgs({
|
|
1658
|
-
|
|
1873
|
+
stakingToken: stakingToken
|
|
1659
1874
|
}),
|
|
1660
1875
|
selector: claimRewardsSelector
|
|
1661
1876
|
});
|
|
@@ -1702,18 +1917,18 @@ function curveLendAndStake(_x3) {
|
|
|
1702
1917
|
|
|
1703
1918
|
function _curveLendAndStake() {
|
|
1704
1919
|
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
1705
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts,
|
|
1920
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingStakingToken, _ref4$minIncomingStak, minIncomingStakingTokenAmount, useUnderlyings, callArgs;
|
|
1706
1921
|
|
|
1707
1922
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1708
1923
|
while (1) {
|
|
1709
1924
|
switch (_context3.prev = _context3.next) {
|
|
1710
1925
|
case 0:
|
|
1711
|
-
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts,
|
|
1926
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingStakingToken = _ref4.incomingStakingToken, _ref4$minIncomingStak = _ref4.minIncomingStakingTokenAmount, minIncomingStakingTokenAmount = _ref4$minIncomingStak === void 0 ? BigNumber.from(1) : _ref4$minIncomingStak, useUnderlyings = _ref4.useUnderlyings;
|
|
1712
1927
|
callArgs = callOnIntegrationArgs({
|
|
1713
1928
|
adapter: curveLiquidityAdapter,
|
|
1714
1929
|
encodedCallArgs: curveLendAndStakeArgs({
|
|
1715
|
-
|
|
1716
|
-
|
|
1930
|
+
incomingStakingToken: incomingStakingToken,
|
|
1931
|
+
minIncomingStakingTokenAmount: minIncomingStakingTokenAmount,
|
|
1717
1932
|
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
|
1718
1933
|
pool: pool,
|
|
1719
1934
|
useUnderlyings: useUnderlyings
|
|
@@ -1773,17 +1988,17 @@ function curveStake(_x5) {
|
|
|
1773
1988
|
|
|
1774
1989
|
function _curveStake() {
|
|
1775
1990
|
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref6) {
|
|
1776
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool,
|
|
1991
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingStakingToken, amount, callArgs;
|
|
1777
1992
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
1778
1993
|
while (1) {
|
|
1779
1994
|
switch (_context5.prev = _context5.next) {
|
|
1780
1995
|
case 0:
|
|
1781
|
-
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool,
|
|
1996
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingStakingToken = _ref6.incomingStakingToken, amount = _ref6.amount;
|
|
1782
1997
|
callArgs = callOnIntegrationArgs({
|
|
1783
1998
|
adapter: curveLiquidityAdapter,
|
|
1784
1999
|
encodedCallArgs: curveStakeArgs({
|
|
1785
2000
|
amount: amount,
|
|
1786
|
-
|
|
2001
|
+
incomingStakingToken: incomingStakingToken,
|
|
1787
2002
|
pool: pool
|
|
1788
2003
|
}),
|
|
1789
2004
|
selector: stakeSelector
|
|
@@ -1806,17 +2021,17 @@ function curveUnstake(_x6) {
|
|
|
1806
2021
|
|
|
1807
2022
|
function _curveUnstake() {
|
|
1808
2023
|
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref7) {
|
|
1809
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool,
|
|
2024
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, amount, callArgs;
|
|
1810
2025
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
1811
2026
|
while (1) {
|
|
1812
2027
|
switch (_context6.prev = _context6.next) {
|
|
1813
2028
|
case 0:
|
|
1814
|
-
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool,
|
|
2029
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingStakingToken = _ref7.outgoingStakingToken, amount = _ref7.amount;
|
|
1815
2030
|
callArgs = callOnIntegrationArgs({
|
|
1816
2031
|
adapter: curveLiquidityAdapter,
|
|
1817
2032
|
encodedCallArgs: curveUnstakeArgs({
|
|
1818
2033
|
amount: amount,
|
|
1819
|
-
|
|
2034
|
+
outgoingStakingToken: outgoingStakingToken,
|
|
1820
2035
|
pool: pool
|
|
1821
2036
|
}),
|
|
1822
2037
|
selector: unstakeSelector
|
|
@@ -1839,18 +2054,18 @@ function curveUnstakeAndRedeem(_x7) {
|
|
|
1839
2054
|
|
|
1840
2055
|
function _curveUnstakeAndRedeem() {
|
|
1841
2056
|
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref8) {
|
|
1842
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool,
|
|
2057
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, outgoingStakingTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
|
1843
2058
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
1844
2059
|
while (1) {
|
|
1845
2060
|
switch (_context7.prev = _context7.next) {
|
|
1846
2061
|
case 0:
|
|
1847
|
-
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool,
|
|
2062
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingStakingToken = _ref8.outgoingStakingToken, outgoingStakingTokenAmount = _ref8.outgoingStakingTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
|
1848
2063
|
callArgs = callOnIntegrationArgs({
|
|
1849
2064
|
adapter: curveLiquidityAdapter,
|
|
1850
2065
|
encodedCallArgs: curveUnstakeAndRedeemArgs({
|
|
1851
2066
|
incomingAssetData: incomingAssetData,
|
|
1852
|
-
|
|
1853
|
-
|
|
2067
|
+
outgoingStakingToken: outgoingStakingToken,
|
|
2068
|
+
outgoingStakingTokenAmount: outgoingStakingTokenAmount,
|
|
1854
2069
|
pool: pool,
|
|
1855
2070
|
redeemType: redeemType,
|
|
1856
2071
|
useUnderlyings: useUnderlyings
|
|
@@ -2026,72 +2241,72 @@ function curveAaveUnstake(_ref15) {
|
|
|
2026
2241
|
selector: unstakeSelector
|
|
2027
2242
|
});
|
|
2028
2243
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2029
|
-
} //
|
|
2244
|
+
} // sETH pool
|
|
2030
2245
|
|
|
2031
|
-
function
|
|
2246
|
+
function curveSethClaimRewards(_ref16) {
|
|
2032
2247
|
var comptrollerProxy = _ref16.comptrollerProxy,
|
|
2033
2248
|
integrationManager = _ref16.integrationManager,
|
|
2034
2249
|
fundOwner = _ref16.fundOwner,
|
|
2035
|
-
|
|
2250
|
+
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
|
2036
2251
|
var callArgs = callOnIntegrationArgs({
|
|
2037
|
-
adapter:
|
|
2252
|
+
adapter: curveLiquiditySethAdapter,
|
|
2038
2253
|
encodedCallArgs: constants.HashZero,
|
|
2039
2254
|
selector: claimRewardsSelector
|
|
2040
2255
|
});
|
|
2041
2256
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2042
2257
|
}
|
|
2043
|
-
function
|
|
2258
|
+
function curveSethLend(_ref17) {
|
|
2044
2259
|
var comptrollerProxy = _ref17.comptrollerProxy,
|
|
2045
2260
|
integrationManager = _ref17.integrationManager,
|
|
2046
2261
|
fundOwner = _ref17.fundOwner,
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2262
|
+
curveLiquiditySethAdapter = _ref17.curveLiquiditySethAdapter,
|
|
2263
|
+
outgoingWethAmount = _ref17.outgoingWethAmount,
|
|
2264
|
+
outgoingSethAmount = _ref17.outgoingSethAmount,
|
|
2050
2265
|
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
|
2051
2266
|
var callArgs = callOnIntegrationArgs({
|
|
2052
|
-
adapter:
|
|
2053
|
-
encodedCallArgs:
|
|
2267
|
+
adapter: curveLiquiditySethAdapter,
|
|
2268
|
+
encodedCallArgs: curveSethLendArgs({
|
|
2054
2269
|
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
2055
|
-
|
|
2056
|
-
|
|
2270
|
+
outgoingSethAmount: outgoingSethAmount,
|
|
2271
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2057
2272
|
}),
|
|
2058
2273
|
selector: lendSelector
|
|
2059
2274
|
});
|
|
2060
2275
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2061
2276
|
}
|
|
2062
|
-
function
|
|
2277
|
+
function curveSethLendAndStake(_ref18) {
|
|
2063
2278
|
var comptrollerProxy = _ref18.comptrollerProxy,
|
|
2064
2279
|
integrationManager = _ref18.integrationManager,
|
|
2065
2280
|
fundOwner = _ref18.fundOwner,
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2281
|
+
curveLiquiditySethAdapter = _ref18.curveLiquiditySethAdapter,
|
|
2282
|
+
outgoingWethAmount = _ref18.outgoingWethAmount,
|
|
2283
|
+
outgoingSethAmount = _ref18.outgoingSethAmount,
|
|
2069
2284
|
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
|
2070
2285
|
var callArgs = callOnIntegrationArgs({
|
|
2071
|
-
adapter:
|
|
2072
|
-
encodedCallArgs:
|
|
2286
|
+
adapter: curveLiquiditySethAdapter,
|
|
2287
|
+
encodedCallArgs: curveSethLendAndStakeArgs({
|
|
2073
2288
|
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
2074
|
-
|
|
2075
|
-
|
|
2289
|
+
outgoingSethAmount: outgoingSethAmount,
|
|
2290
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2076
2291
|
}),
|
|
2077
2292
|
selector: lendAndStakeSelector
|
|
2078
2293
|
});
|
|
2079
2294
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2080
2295
|
}
|
|
2081
|
-
function
|
|
2296
|
+
function curveSethRedeem(_ref19) {
|
|
2082
2297
|
var comptrollerProxy = _ref19.comptrollerProxy,
|
|
2083
2298
|
integrationManager = _ref19.integrationManager,
|
|
2084
2299
|
fundOwner = _ref19.fundOwner,
|
|
2085
|
-
|
|
2300
|
+
curveLiquiditySethAdapter = _ref19.curveLiquiditySethAdapter,
|
|
2086
2301
|
outgoingLPTokenAmount = _ref19.outgoingLPTokenAmount,
|
|
2087
|
-
|
|
2088
|
-
|
|
2302
|
+
minIncomingWethAmount = _ref19.minIncomingWethAmount,
|
|
2303
|
+
minIncomingSethAmount = _ref19.minIncomingSethAmount,
|
|
2089
2304
|
receiveSingleAsset = _ref19.receiveSingleAsset;
|
|
2090
2305
|
var callArgs = callOnIntegrationArgs({
|
|
2091
|
-
adapter:
|
|
2092
|
-
encodedCallArgs:
|
|
2093
|
-
|
|
2094
|
-
|
|
2306
|
+
adapter: curveLiquiditySethAdapter,
|
|
2307
|
+
encodedCallArgs: curveSethRedeemArgs({
|
|
2308
|
+
minIncomingSethAmount: minIncomingSethAmount,
|
|
2309
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2095
2310
|
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
2096
2311
|
receiveSingleAsset: receiveSingleAsset
|
|
2097
2312
|
}),
|
|
@@ -2099,35 +2314,35 @@ function curveEursRedeem(_ref19) {
|
|
|
2099
2314
|
});
|
|
2100
2315
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2101
2316
|
}
|
|
2102
|
-
function
|
|
2317
|
+
function curveSethStake(_ref20) {
|
|
2103
2318
|
var comptrollerProxy = _ref20.comptrollerProxy,
|
|
2104
2319
|
integrationManager = _ref20.integrationManager,
|
|
2105
2320
|
fundOwner = _ref20.fundOwner,
|
|
2106
|
-
|
|
2321
|
+
curveLiquiditySethAdapter = _ref20.curveLiquiditySethAdapter,
|
|
2107
2322
|
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
|
2108
2323
|
var callArgs = callOnIntegrationArgs({
|
|
2109
|
-
adapter:
|
|
2110
|
-
encodedCallArgs:
|
|
2324
|
+
adapter: curveLiquiditySethAdapter,
|
|
2325
|
+
encodedCallArgs: curveSethStakeArgs({
|
|
2111
2326
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
2112
2327
|
}),
|
|
2113
2328
|
selector: stakeSelector
|
|
2114
2329
|
});
|
|
2115
2330
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2116
2331
|
}
|
|
2117
|
-
function
|
|
2332
|
+
function curveSethUnstakeAndRedeem(_ref21) {
|
|
2118
2333
|
var comptrollerProxy = _ref21.comptrollerProxy,
|
|
2119
2334
|
integrationManager = _ref21.integrationManager,
|
|
2120
2335
|
fundOwner = _ref21.fundOwner,
|
|
2121
|
-
|
|
2336
|
+
curveLiquiditySethAdapter = _ref21.curveLiquiditySethAdapter,
|
|
2122
2337
|
outgoingLiquidityGaugeTokenAmount = _ref21.outgoingLiquidityGaugeTokenAmount,
|
|
2123
|
-
|
|
2124
|
-
|
|
2338
|
+
minIncomingWethAmount = _ref21.minIncomingWethAmount,
|
|
2339
|
+
minIncomingSethAmount = _ref21.minIncomingSethAmount,
|
|
2125
2340
|
receiveSingleAsset = _ref21.receiveSingleAsset;
|
|
2126
2341
|
var callArgs = callOnIntegrationArgs({
|
|
2127
|
-
adapter:
|
|
2128
|
-
encodedCallArgs:
|
|
2129
|
-
|
|
2130
|
-
|
|
2342
|
+
adapter: curveLiquiditySethAdapter,
|
|
2343
|
+
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
|
2344
|
+
minIncomingSethAmount: minIncomingSethAmount,
|
|
2345
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2131
2346
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
2132
2347
|
receiveSingleAsset: receiveSingleAsset
|
|
2133
2348
|
}),
|
|
@@ -2135,85 +2350,85 @@ function curveEursUnstakeAndRedeem(_ref21) {
|
|
|
2135
2350
|
});
|
|
2136
2351
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2137
2352
|
}
|
|
2138
|
-
function
|
|
2353
|
+
function curveSethUnstake(_ref22) {
|
|
2139
2354
|
var comptrollerProxy = _ref22.comptrollerProxy,
|
|
2140
2355
|
integrationManager = _ref22.integrationManager,
|
|
2141
2356
|
fundOwner = _ref22.fundOwner,
|
|
2142
|
-
|
|
2357
|
+
curveLiquiditySethAdapter = _ref22.curveLiquiditySethAdapter,
|
|
2143
2358
|
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
|
2144
2359
|
var callArgs = callOnIntegrationArgs({
|
|
2145
|
-
adapter:
|
|
2146
|
-
encodedCallArgs:
|
|
2360
|
+
adapter: curveLiquiditySethAdapter,
|
|
2361
|
+
encodedCallArgs: curveSethUnstakeArgs({
|
|
2147
2362
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
2148
2363
|
}),
|
|
2149
2364
|
selector: unstakeSelector
|
|
2150
2365
|
});
|
|
2151
2366
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2152
|
-
} //
|
|
2367
|
+
} // stETH pool
|
|
2153
2368
|
|
|
2154
|
-
function
|
|
2369
|
+
function curveStethClaimRewards(_ref23) {
|
|
2155
2370
|
var comptrollerProxy = _ref23.comptrollerProxy,
|
|
2156
2371
|
integrationManager = _ref23.integrationManager,
|
|
2157
2372
|
fundOwner = _ref23.fundOwner,
|
|
2158
|
-
|
|
2373
|
+
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
|
2159
2374
|
var callArgs = callOnIntegrationArgs({
|
|
2160
|
-
adapter:
|
|
2375
|
+
adapter: curveLiquidityStethAdapter,
|
|
2161
2376
|
encodedCallArgs: constants.HashZero,
|
|
2162
2377
|
selector: claimRewardsSelector
|
|
2163
2378
|
});
|
|
2164
2379
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2165
2380
|
}
|
|
2166
|
-
function
|
|
2381
|
+
function curveStethLend(_ref24) {
|
|
2167
2382
|
var comptrollerProxy = _ref24.comptrollerProxy,
|
|
2168
2383
|
integrationManager = _ref24.integrationManager,
|
|
2169
2384
|
fundOwner = _ref24.fundOwner,
|
|
2170
|
-
|
|
2385
|
+
curveLiquidityStethAdapter = _ref24.curveLiquidityStethAdapter,
|
|
2171
2386
|
outgoingWethAmount = _ref24.outgoingWethAmount,
|
|
2172
|
-
|
|
2387
|
+
outgoingStethAmount = _ref24.outgoingStethAmount,
|
|
2173
2388
|
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
|
2174
2389
|
var callArgs = callOnIntegrationArgs({
|
|
2175
|
-
adapter:
|
|
2176
|
-
encodedCallArgs:
|
|
2390
|
+
adapter: curveLiquidityStethAdapter,
|
|
2391
|
+
encodedCallArgs: curveStethLendArgs({
|
|
2177
2392
|
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
2178
|
-
|
|
2393
|
+
outgoingStethAmount: outgoingStethAmount,
|
|
2179
2394
|
outgoingWethAmount: outgoingWethAmount
|
|
2180
2395
|
}),
|
|
2181
2396
|
selector: lendSelector
|
|
2182
2397
|
});
|
|
2183
2398
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2184
2399
|
}
|
|
2185
|
-
function
|
|
2400
|
+
function curveStethLendAndStake(_ref25) {
|
|
2186
2401
|
var comptrollerProxy = _ref25.comptrollerProxy,
|
|
2187
2402
|
integrationManager = _ref25.integrationManager,
|
|
2188
2403
|
fundOwner = _ref25.fundOwner,
|
|
2189
|
-
|
|
2404
|
+
curveLiquidityStethAdapter = _ref25.curveLiquidityStethAdapter,
|
|
2190
2405
|
outgoingWethAmount = _ref25.outgoingWethAmount,
|
|
2191
|
-
|
|
2406
|
+
outgoingStethAmount = _ref25.outgoingStethAmount,
|
|
2192
2407
|
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
|
2193
2408
|
var callArgs = callOnIntegrationArgs({
|
|
2194
|
-
adapter:
|
|
2195
|
-
encodedCallArgs:
|
|
2409
|
+
adapter: curveLiquidityStethAdapter,
|
|
2410
|
+
encodedCallArgs: curveStethLendAndStakeArgs({
|
|
2196
2411
|
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
2197
|
-
|
|
2412
|
+
outgoingStethAmount: outgoingStethAmount,
|
|
2198
2413
|
outgoingWethAmount: outgoingWethAmount
|
|
2199
2414
|
}),
|
|
2200
2415
|
selector: lendAndStakeSelector
|
|
2201
2416
|
});
|
|
2202
2417
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2203
2418
|
}
|
|
2204
|
-
function
|
|
2419
|
+
function curveStethRedeem(_ref26) {
|
|
2205
2420
|
var comptrollerProxy = _ref26.comptrollerProxy,
|
|
2206
2421
|
integrationManager = _ref26.integrationManager,
|
|
2207
2422
|
fundOwner = _ref26.fundOwner,
|
|
2208
|
-
|
|
2423
|
+
curveLiquidityStethAdapter = _ref26.curveLiquidityStethAdapter,
|
|
2209
2424
|
outgoingLPTokenAmount = _ref26.outgoingLPTokenAmount,
|
|
2210
2425
|
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
|
2211
|
-
|
|
2426
|
+
minIncomingStethAmount = _ref26.minIncomingStethAmount,
|
|
2212
2427
|
receiveSingleAsset = _ref26.receiveSingleAsset;
|
|
2213
2428
|
var callArgs = callOnIntegrationArgs({
|
|
2214
|
-
adapter:
|
|
2215
|
-
encodedCallArgs:
|
|
2216
|
-
|
|
2429
|
+
adapter: curveLiquidityStethAdapter,
|
|
2430
|
+
encodedCallArgs: curveStethRedeemArgs({
|
|
2431
|
+
minIncomingStethAmount: minIncomingStethAmount,
|
|
2217
2432
|
minIncomingWethAmount: minIncomingWethAmount,
|
|
2218
2433
|
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
2219
2434
|
receiveSingleAsset: receiveSingleAsset
|
|
@@ -2222,34 +2437,34 @@ function curveSethRedeem(_ref26) {
|
|
|
2222
2437
|
});
|
|
2223
2438
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2224
2439
|
}
|
|
2225
|
-
function
|
|
2440
|
+
function curveStethStake(_ref27) {
|
|
2226
2441
|
var comptrollerProxy = _ref27.comptrollerProxy,
|
|
2227
2442
|
integrationManager = _ref27.integrationManager,
|
|
2228
2443
|
fundOwner = _ref27.fundOwner,
|
|
2229
|
-
|
|
2444
|
+
curveLiquidityStethAdapter = _ref27.curveLiquidityStethAdapter,
|
|
2230
2445
|
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
|
2231
2446
|
var callArgs = callOnIntegrationArgs({
|
|
2232
|
-
adapter:
|
|
2233
|
-
encodedCallArgs:
|
|
2447
|
+
adapter: curveLiquidityStethAdapter,
|
|
2448
|
+
encodedCallArgs: curveStethStakeArgs({
|
|
2234
2449
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
2235
2450
|
}),
|
|
2236
2451
|
selector: stakeSelector
|
|
2237
2452
|
});
|
|
2238
2453
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2239
2454
|
}
|
|
2240
|
-
function
|
|
2455
|
+
function curveStethUnstakeAndRedeem(_ref28) {
|
|
2241
2456
|
var comptrollerProxy = _ref28.comptrollerProxy,
|
|
2242
2457
|
integrationManager = _ref28.integrationManager,
|
|
2243
2458
|
fundOwner = _ref28.fundOwner,
|
|
2244
|
-
|
|
2459
|
+
curveLiquidityStethAdapter = _ref28.curveLiquidityStethAdapter,
|
|
2245
2460
|
outgoingLiquidityGaugeTokenAmount = _ref28.outgoingLiquidityGaugeTokenAmount,
|
|
2246
2461
|
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
|
2247
|
-
|
|
2462
|
+
minIncomingStethAmount = _ref28.minIncomingStethAmount,
|
|
2248
2463
|
receiveSingleAsset = _ref28.receiveSingleAsset;
|
|
2249
2464
|
var callArgs = callOnIntegrationArgs({
|
|
2250
|
-
adapter:
|
|
2251
|
-
encodedCallArgs:
|
|
2252
|
-
|
|
2465
|
+
adapter: curveLiquidityStethAdapter,
|
|
2466
|
+
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
|
2467
|
+
minIncomingStethAmount: minIncomingStethAmount,
|
|
2253
2468
|
minIncomingWethAmount: minIncomingWethAmount,
|
|
2254
2469
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
2255
2470
|
receiveSingleAsset: receiveSingleAsset
|
|
@@ -2258,135 +2473,12 @@ function curveSethUnstakeAndRedeem(_ref28) {
|
|
|
2258
2473
|
});
|
|
2259
2474
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2260
2475
|
}
|
|
2261
|
-
function
|
|
2476
|
+
function curveStethUnstake(_ref29) {
|
|
2262
2477
|
var comptrollerProxy = _ref29.comptrollerProxy,
|
|
2263
2478
|
integrationManager = _ref29.integrationManager,
|
|
2264
2479
|
fundOwner = _ref29.fundOwner,
|
|
2265
|
-
|
|
2480
|
+
curveLiquidityStethAdapter = _ref29.curveLiquidityStethAdapter,
|
|
2266
2481
|
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
|
2267
|
-
var callArgs = callOnIntegrationArgs({
|
|
2268
|
-
adapter: curveLiquiditySethAdapter,
|
|
2269
|
-
encodedCallArgs: curveSethUnstakeArgs({
|
|
2270
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
2271
|
-
}),
|
|
2272
|
-
selector: unstakeSelector
|
|
2273
|
-
});
|
|
2274
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2275
|
-
} // stETH pool
|
|
2276
|
-
|
|
2277
|
-
function curveStethClaimRewards(_ref30) {
|
|
2278
|
-
var comptrollerProxy = _ref30.comptrollerProxy,
|
|
2279
|
-
integrationManager = _ref30.integrationManager,
|
|
2280
|
-
fundOwner = _ref30.fundOwner,
|
|
2281
|
-
curveLiquidityStethAdapter = _ref30.curveLiquidityStethAdapter;
|
|
2282
|
-
var callArgs = callOnIntegrationArgs({
|
|
2283
|
-
adapter: curveLiquidityStethAdapter,
|
|
2284
|
-
encodedCallArgs: constants.HashZero,
|
|
2285
|
-
selector: claimRewardsSelector
|
|
2286
|
-
});
|
|
2287
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2288
|
-
}
|
|
2289
|
-
function curveStethLend(_ref31) {
|
|
2290
|
-
var comptrollerProxy = _ref31.comptrollerProxy,
|
|
2291
|
-
integrationManager = _ref31.integrationManager,
|
|
2292
|
-
fundOwner = _ref31.fundOwner,
|
|
2293
|
-
curveLiquidityStethAdapter = _ref31.curveLiquidityStethAdapter,
|
|
2294
|
-
outgoingWethAmount = _ref31.outgoingWethAmount,
|
|
2295
|
-
outgoingStethAmount = _ref31.outgoingStethAmount,
|
|
2296
|
-
minIncomingLPTokenAmount = _ref31.minIncomingLPTokenAmount;
|
|
2297
|
-
var callArgs = callOnIntegrationArgs({
|
|
2298
|
-
adapter: curveLiquidityStethAdapter,
|
|
2299
|
-
encodedCallArgs: curveStethLendArgs({
|
|
2300
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
2301
|
-
outgoingStethAmount: outgoingStethAmount,
|
|
2302
|
-
outgoingWethAmount: outgoingWethAmount
|
|
2303
|
-
}),
|
|
2304
|
-
selector: lendSelector
|
|
2305
|
-
});
|
|
2306
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2307
|
-
}
|
|
2308
|
-
function curveStethLendAndStake(_ref32) {
|
|
2309
|
-
var comptrollerProxy = _ref32.comptrollerProxy,
|
|
2310
|
-
integrationManager = _ref32.integrationManager,
|
|
2311
|
-
fundOwner = _ref32.fundOwner,
|
|
2312
|
-
curveLiquidityStethAdapter = _ref32.curveLiquidityStethAdapter,
|
|
2313
|
-
outgoingWethAmount = _ref32.outgoingWethAmount,
|
|
2314
|
-
outgoingStethAmount = _ref32.outgoingStethAmount,
|
|
2315
|
-
minIncomingLiquidityGaugeTokenAmount = _ref32.minIncomingLiquidityGaugeTokenAmount;
|
|
2316
|
-
var callArgs = callOnIntegrationArgs({
|
|
2317
|
-
adapter: curveLiquidityStethAdapter,
|
|
2318
|
-
encodedCallArgs: curveStethLendAndStakeArgs({
|
|
2319
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
2320
|
-
outgoingStethAmount: outgoingStethAmount,
|
|
2321
|
-
outgoingWethAmount: outgoingWethAmount
|
|
2322
|
-
}),
|
|
2323
|
-
selector: lendAndStakeSelector
|
|
2324
|
-
});
|
|
2325
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2326
|
-
}
|
|
2327
|
-
function curveStethRedeem(_ref33) {
|
|
2328
|
-
var comptrollerProxy = _ref33.comptrollerProxy,
|
|
2329
|
-
integrationManager = _ref33.integrationManager,
|
|
2330
|
-
fundOwner = _ref33.fundOwner,
|
|
2331
|
-
curveLiquidityStethAdapter = _ref33.curveLiquidityStethAdapter,
|
|
2332
|
-
outgoingLPTokenAmount = _ref33.outgoingLPTokenAmount,
|
|
2333
|
-
minIncomingWethAmount = _ref33.minIncomingWethAmount,
|
|
2334
|
-
minIncomingStethAmount = _ref33.minIncomingStethAmount,
|
|
2335
|
-
receiveSingleAsset = _ref33.receiveSingleAsset;
|
|
2336
|
-
var callArgs = callOnIntegrationArgs({
|
|
2337
|
-
adapter: curveLiquidityStethAdapter,
|
|
2338
|
-
encodedCallArgs: curveStethRedeemArgs({
|
|
2339
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
|
2340
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
2341
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
2342
|
-
receiveSingleAsset: receiveSingleAsset
|
|
2343
|
-
}),
|
|
2344
|
-
selector: redeemSelector
|
|
2345
|
-
});
|
|
2346
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2347
|
-
}
|
|
2348
|
-
function curveStethStake(_ref34) {
|
|
2349
|
-
var comptrollerProxy = _ref34.comptrollerProxy,
|
|
2350
|
-
integrationManager = _ref34.integrationManager,
|
|
2351
|
-
fundOwner = _ref34.fundOwner,
|
|
2352
|
-
curveLiquidityStethAdapter = _ref34.curveLiquidityStethAdapter,
|
|
2353
|
-
outgoingLPTokenAmount = _ref34.outgoingLPTokenAmount;
|
|
2354
|
-
var callArgs = callOnIntegrationArgs({
|
|
2355
|
-
adapter: curveLiquidityStethAdapter,
|
|
2356
|
-
encodedCallArgs: curveStethStakeArgs({
|
|
2357
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
2358
|
-
}),
|
|
2359
|
-
selector: stakeSelector
|
|
2360
|
-
});
|
|
2361
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2362
|
-
}
|
|
2363
|
-
function curveStethUnstakeAndRedeem(_ref35) {
|
|
2364
|
-
var comptrollerProxy = _ref35.comptrollerProxy,
|
|
2365
|
-
integrationManager = _ref35.integrationManager,
|
|
2366
|
-
fundOwner = _ref35.fundOwner,
|
|
2367
|
-
curveLiquidityStethAdapter = _ref35.curveLiquidityStethAdapter,
|
|
2368
|
-
outgoingLiquidityGaugeTokenAmount = _ref35.outgoingLiquidityGaugeTokenAmount,
|
|
2369
|
-
minIncomingWethAmount = _ref35.minIncomingWethAmount,
|
|
2370
|
-
minIncomingStethAmount = _ref35.minIncomingStethAmount,
|
|
2371
|
-
receiveSingleAsset = _ref35.receiveSingleAsset;
|
|
2372
|
-
var callArgs = callOnIntegrationArgs({
|
|
2373
|
-
adapter: curveLiquidityStethAdapter,
|
|
2374
|
-
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
|
2375
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
|
2376
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
2377
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
2378
|
-
receiveSingleAsset: receiveSingleAsset
|
|
2379
|
-
}),
|
|
2380
|
-
selector: unstakeAndRedeemSelector
|
|
2381
|
-
});
|
|
2382
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2383
|
-
}
|
|
2384
|
-
function curveStethUnstake(_ref36) {
|
|
2385
|
-
var comptrollerProxy = _ref36.comptrollerProxy,
|
|
2386
|
-
integrationManager = _ref36.integrationManager,
|
|
2387
|
-
fundOwner = _ref36.fundOwner,
|
|
2388
|
-
curveLiquidityStethAdapter = _ref36.curveLiquidityStethAdapter,
|
|
2389
|
-
outgoingLiquidityGaugeTokenAmount = _ref36.outgoingLiquidityGaugeTokenAmount;
|
|
2390
2482
|
var callArgs = callOnIntegrationArgs({
|
|
2391
2483
|
adapter: curveLiquidityStethAdapter,
|
|
2392
2484
|
encodedCallArgs: curveStethUnstakeArgs({
|
|
@@ -2858,24 +2950,16 @@ function synthetixAssignExchangeDelegate(_x) {
|
|
|
2858
2950
|
|
|
2859
2951
|
function _synthetixAssignExchangeDelegate() {
|
|
2860
2952
|
_synthetixAssignExchangeDelegate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
2861
|
-
var comptrollerProxy,
|
|
2953
|
+
var comptrollerProxy, synthetixDelegateApprovals, fundOwner, delegate;
|
|
2862
2954
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2863
2955
|
while (1) {
|
|
2864
2956
|
switch (_context.prev = _context.next) {
|
|
2865
2957
|
case 0:
|
|
2866
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
|
2958
|
+
comptrollerProxy = _ref.comptrollerProxy, synthetixDelegateApprovals = _ref.synthetixDelegateApprovals, fundOwner = _ref.fundOwner, delegate = _ref.delegate;
|
|
2867
2959
|
_context.next = 3;
|
|
2868
|
-
return
|
|
2869
|
-
addressResolver: addressResolver,
|
|
2870
|
-
name: 'DelegateApprovals'
|
|
2871
|
-
});
|
|
2960
|
+
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(synthetixDelegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
|
2872
2961
|
|
|
2873
2962
|
case 3:
|
|
2874
|
-
delegateApprovals = _context.sent;
|
|
2875
|
-
_context.next = 6;
|
|
2876
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, synthetixAssignExchangeDelegateSelector, encodeArgs(['address'], [delegate]));
|
|
2877
|
-
|
|
2878
|
-
case 6:
|
|
2879
2963
|
case "end":
|
|
2880
2964
|
return _context.stop();
|
|
2881
2965
|
}
|
|
@@ -2885,42 +2969,18 @@ function _synthetixAssignExchangeDelegate() {
|
|
|
2885
2969
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
|
2886
2970
|
}
|
|
2887
2971
|
|
|
2888
|
-
function
|
|
2889
|
-
return _synthetixResolveAddress.apply(this, arguments);
|
|
2890
|
-
}
|
|
2891
|
-
|
|
2892
|
-
function _synthetixResolveAddress() {
|
|
2893
|
-
_synthetixResolveAddress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
2894
|
-
var addressResolver, name;
|
|
2895
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2896
|
-
while (1) {
|
|
2897
|
-
switch (_context2.prev = _context2.next) {
|
|
2898
|
-
case 0:
|
|
2899
|
-
addressResolver = _ref2.addressResolver, name = _ref2.name;
|
|
2900
|
-
return _context2.abrupt("return", addressResolver.requireAndGetAddress(utils.formatBytes32String(name), "Missing ".concat(name)));
|
|
2901
|
-
|
|
2902
|
-
case 2:
|
|
2903
|
-
case "end":
|
|
2904
|
-
return _context2.stop();
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
}, _callee2);
|
|
2908
|
-
}));
|
|
2909
|
-
return _synthetixResolveAddress.apply(this, arguments);
|
|
2910
|
-
}
|
|
2911
|
-
|
|
2912
|
-
function synthetixRedeem(_x3) {
|
|
2972
|
+
function synthetixRedeem(_x2) {
|
|
2913
2973
|
return _synthetixRedeem.apply(this, arguments);
|
|
2914
2974
|
}
|
|
2915
2975
|
|
|
2916
2976
|
function _synthetixRedeem() {
|
|
2917
|
-
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2977
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
2918
2978
|
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
|
2919
|
-
return _regeneratorRuntime.wrap(function
|
|
2979
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2920
2980
|
while (1) {
|
|
2921
|
-
switch (
|
|
2981
|
+
switch (_context2.prev = _context2.next) {
|
|
2922
2982
|
case 0:
|
|
2923
|
-
comptrollerProxy =
|
|
2983
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, synthetixAdapter = _ref2.synthetixAdapter, synths = _ref2.synths;
|
|
2924
2984
|
redeemArgs = synthetixRedeemArgs({
|
|
2925
2985
|
synths: synths
|
|
2926
2986
|
});
|
|
@@ -2929,48 +2989,47 @@ function _synthetixRedeem() {
|
|
|
2929
2989
|
encodedCallArgs: redeemArgs,
|
|
2930
2990
|
selector: redeemSelector
|
|
2931
2991
|
});
|
|
2932
|
-
return
|
|
2992
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2933
2993
|
|
|
2934
2994
|
case 4:
|
|
2935
2995
|
case "end":
|
|
2936
|
-
return
|
|
2996
|
+
return _context2.stop();
|
|
2937
2997
|
}
|
|
2938
2998
|
}
|
|
2939
|
-
},
|
|
2999
|
+
}, _callee2);
|
|
2940
3000
|
}));
|
|
2941
3001
|
return _synthetixRedeem.apply(this, arguments);
|
|
2942
3002
|
}
|
|
2943
3003
|
|
|
2944
|
-
function synthetixTakeOrder(
|
|
3004
|
+
function synthetixTakeOrder(_x3) {
|
|
2945
3005
|
return _synthetixTakeOrder.apply(this, arguments);
|
|
2946
3006
|
}
|
|
2947
3007
|
|
|
2948
3008
|
function _synthetixTakeOrder() {
|
|
2949
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2950
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
|
3009
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
3010
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount, _ref3$minIncomingSusd, minIncomingSusdAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
2951
3011
|
|
|
2952
|
-
return _regeneratorRuntime.wrap(function
|
|
3012
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2953
3013
|
while (1) {
|
|
2954
|
-
switch (
|
|
3014
|
+
switch (_context3.prev = _context3.next) {
|
|
2955
3015
|
case 0:
|
|
2956
|
-
comptrollerProxy =
|
|
3016
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref3$outgoingAssetAm, _ref3$minIncomingSusd = _ref3.minIncomingSusdAmount, minIncomingSusdAmount = _ref3$minIncomingSusd === void 0 ? utils.parseEther('1') : _ref3$minIncomingSusd, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
|
2957
3017
|
|
|
2958
3018
|
if (!seedFund) {
|
|
2959
|
-
|
|
3019
|
+
_context3.next = 4;
|
|
2960
3020
|
break;
|
|
2961
3021
|
}
|
|
2962
3022
|
|
|
2963
|
-
|
|
3023
|
+
_context3.next = 4;
|
|
2964
3024
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
|
2965
3025
|
|
|
2966
3026
|
case 4:
|
|
2967
3027
|
takeOrderArgs = synthetixTakeOrderArgs({
|
|
2968
|
-
|
|
2969
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
3028
|
+
minIncomingSusdAmount: minIncomingSusdAmount,
|
|
2970
3029
|
outgoingAsset: outgoingAsset,
|
|
2971
3030
|
outgoingAssetAmount: outgoingAssetAmount
|
|
2972
3031
|
});
|
|
2973
|
-
|
|
3032
|
+
_context3.next = 7;
|
|
2974
3033
|
return callOnIntegrationArgs({
|
|
2975
3034
|
adapter: synthetixAdapter,
|
|
2976
3035
|
encodedCallArgs: takeOrderArgs,
|
|
@@ -2978,15 +3037,15 @@ function _synthetixTakeOrder() {
|
|
|
2978
3037
|
});
|
|
2979
3038
|
|
|
2980
3039
|
case 7:
|
|
2981
|
-
callArgs =
|
|
2982
|
-
return
|
|
3040
|
+
callArgs = _context3.sent;
|
|
3041
|
+
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2983
3042
|
|
|
2984
3043
|
case 9:
|
|
2985
3044
|
case "end":
|
|
2986
|
-
return
|
|
3045
|
+
return _context3.stop();
|
|
2987
3046
|
}
|
|
2988
3047
|
}
|
|
2989
|
-
},
|
|
3048
|
+
}, _callee3);
|
|
2990
3049
|
}));
|
|
2991
3050
|
return _synthetixTakeOrder.apply(this, arguments);
|
|
2992
3051
|
}
|
|
@@ -3970,17 +4029,22 @@ var whales = {
|
|
|
3970
4029
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
|
3971
4030
|
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
|
3972
4031
|
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
|
4032
|
+
// fTokens
|
|
4033
|
+
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
|
4034
|
+
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
|
4035
|
+
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
|
4036
|
+
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
|
3973
4037
|
// ptTokens
|
|
3974
4038
|
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
|
3975
|
-
// synths
|
|
4039
|
+
// synths (unsupported)
|
|
3976
4040
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
|
3977
|
-
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
|
3978
4041
|
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
|
3979
4042
|
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
|
3980
4043
|
// misc
|
|
3981
4044
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
|
3982
|
-
|
|
3983
|
-
|
|
4045
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
|
4046
|
+
// Curve steth pool related
|
|
4047
|
+
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663'
|
|
3984
4048
|
};
|
|
3985
4049
|
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
3986
4050
|
|
|
@@ -4214,4 +4278,4 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
|
4214
4278
|
expect(utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
|
4215
4279
|
}
|
|
4216
4280
|
|
|
4217
|
-
export { CurveLiquidityGaugeV2, CurveMinter, CurveRegistry, CurveSwaps, ICompoundComptroller, IUniswapV3NonFungibleTokenManager, UniswapV2Factory, UniswapV3FeeAmount, aaveLend, aaveRedeem, addNewAssetsToFund, addTrackedAssetsToVault, assertDidRelay, assertDidRelaySuccessfully, assertDidRelayWithCharge, assertDidRelayWithError, assertEvent, assertNoEvent, assertPaymasterDidReject, assertPaymasterDidRejectForReason, buyShares, buySharesFunction, calcMlnValueAndBurnAmountForSharesBuyback, callOnExtension, callOnExternalPosition, compoundDebtPositionAddCollateral, compoundDebtPositionBorrow, compoundDebtPositionClaimComp, compoundDebtPositionRemoveCollateral, compoundDebtPositionRepayBorrow, compoundLend, compoundRedeem, createCompoundDebtPosition, createComptrollerProxy, createExternalPosition, createFundDeployer, createMigrationRequest, createMockExternalPosition, createNewFund, createReconfigurationRequest, createUniswapV3LiquidityPosition, createVaultProxy, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem, curveClaimRewards,
|
|
4281
|
+
export { CurveLiquidityGaugeV2, CurveMinter, CurveRegistry, CurveSwaps, ICompoundComptroller, IUniswapV3NonFungibleTokenManager, UniswapV2Factory, UniswapV3FeeAmount, aaveLend, aaveRedeem, addNewAssetsToFund, addTrackedAssetsToVault, assertCompoundLend, assertCompoundRedeem, assertDidRelay, assertDidRelaySuccessfully, assertDidRelayWithCharge, assertDidRelayWithError, assertEvent, assertNoEvent, assertPaymasterDidReject, assertPaymasterDidRejectForReason, buyShares, buySharesFunction, calcMlnValueAndBurnAmountForSharesBuyback, callOnExtension, callOnExternalPosition, compoundClaim, compoundDebtPositionAddCollateral, compoundDebtPositionBorrow, compoundDebtPositionClaimComp, compoundDebtPositionRemoveCollateral, compoundDebtPositionRepayBorrow, compoundLend, compoundRedeem, createCompoundDebtPosition, createComptrollerProxy, createExternalPosition, createFundDeployer, createMigrationRequest, createMockExternalPosition, createNewFund, createReconfigurationRequest, createUniswapV3LiquidityPosition, createVaultProxy, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem, curveClaimRewards, curveLend, curveLendAndStake, curveRedeem, curveSethClaimRewards, curveSethLend, curveSethLendAndStake, curveSethRedeem, curveSethStake, curveSethUnstake, curveSethUnstakeAndRedeem, curveStake, curveStethClaimRewards, curveStethLend, curveStethLendAndStake, curveStethRedeem, curveStethStake, curveStethUnstake, curveStethUnstakeAndRedeem, curveTakeOrder, curveUnstake, curveUnstakeAndRedeem, deployProtocolFixture, generateFeeManagerConfigWithMockFees, generateMockFees, generateMockPolicies, generatePolicyManagerConfigWithMockPolicies, getAssetBalances, getAssetUnit, getNamedSigner, getUnnamedSigners, idleClaimRewards, idleLend, idleRedeem, mockExternalPositionAddDebtAssets, mockExternalPositionAddManagedAssets, mockExternalPositionRemoveDebtAssets, mockExternalPositionRemoveManagedAssets, mockGenericRemoveOnlySelector, mockGenericSwap, mockGenericSwapASelector, mockGenericSwapArgs, mockGenericSwapBSelector, mockGenericSwapDirectFromVaultSelector, mockGenericSwapViaApprovalSelector, olympusV2Stake, olympusV2Unstake, paraSwapV4GenerateDummyPaths, paraSwapV4TakeOrder, paraSwapV5GenerateDummyPaths, paraSwapV5TakeOrder, poolTogetherV4ClaimRewards, poolTogetherV4Lend, poolTogetherV4Redeem, reactivateExternalPosition, redeemSharesForSpecificAssets, redeemSharesInKind, relayTransaction, removeExternalPosition, removeTrackedAssetsFromVault, setupGasRelayerPaymaster, synthetixAssignExchangeDelegate, synthetixRedeem, synthetixTakeOrder, transactionTimestamp, uniswapV2Lend, uniswapV2Redeem, uniswapV2TakeOrder, uniswapV3LiquidityPositionAddLiquidity, uniswapV3LiquidityPositionCollect, uniswapV3LiquidityPositionGetMaxTick, uniswapV3LiquidityPositionGetMinTick, uniswapV3LiquidityPositionMint, uniswapV3LiquidityPositionPurge, uniswapV3LiquidityPositionRemoveLiquidity, uniswapV3OrderTokenPair, uniswapV3TakeOrder, unlockAllWhales, unlockWhale, unlockWhales, updateChainlinkAggregator, vaultCallCreateNewList, vaultCallCurveMinterMint, vaultCallCurveMinterMintMany, vaultCallCurveMinterToggleApproveMint, vaultCallStartAssetBypassTimelock, yearnVaultV2Lend, yearnVaultV2Redeem, zeroExV2TakeOrder };
|