@enzymefinance/testutils 4.0.0-next.0 → 4.0.0-next.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +33 -0
- package/dist/declarations/src/assertions.d.ts +4 -4
- package/dist/declarations/src/deployment.d.ts +181 -82
- package/dist/declarations/src/gasRelayer.d.ts +56 -54
- package/dist/declarations/src/helpers.d.ts +16 -15
- package/dist/declarations/src/index.d.ts +6 -6
- package/dist/declarations/src/scaffolding/assets.d.ts +10 -10
- package/dist/declarations/src/scaffolding/chainlink.d.ts +3 -3
- package/dist/declarations/src/scaffolding/common.d.ts +7 -7
- package/dist/declarations/src/scaffolding/core.d.ts +17 -16
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +11 -11
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +35 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +56 -59
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +4 -2
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +53 -20
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +99 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +12 -12
- package/dist/declarations/src/scaffolding/extensions/index.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +20 -19
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +28 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +272 -271
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +28 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +14 -12
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +32 -32
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +23 -22
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +23 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +29 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +33 -25
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +15 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +46 -46
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +15 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +22 -22
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +12 -12
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +17 -17
- package/dist/declarations/src/scaffolding/index.d.ts +8 -8
- package/dist/declarations/src/scaffolding/setup.d.ts +77 -75
- package/dist/declarations/src/scaffolding/shares.d.ts +35 -35
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +32 -17
- package/dist/declarations/src/whales.d.ts +42 -44
- package/dist/enzymefinance-testutils.browser.cjs.js +1470 -697
- package/dist/enzymefinance-testutils.browser.esm.js +1257 -508
- package/dist/enzymefinance-testutils.cjs.dev.js +1470 -697
- package/dist/enzymefinance-testutils.cjs.prod.js +1470 -697
- package/dist/enzymefinance-testutils.esm.js +1257 -508
- package/package.json +6 -6
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +202 -99
- package/src/gasRelayer.ts +17 -18
- package/src/helpers.ts +6 -4
- package/src/scaffolding/assets.ts +6 -5
- package/src/scaffolding/chainlink.ts +2 -2
- package/src/scaffolding/common.ts +1 -1
- package/src/scaffolding/core.ts +28 -12
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +103 -0
- package/src/scaffolding/extensions/external-positions/compound.ts +69 -114
- package/src/scaffolding/extensions/external-positions/index.ts +2 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +132 -10
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +290 -0
- package/src/scaffolding/extensions/fees.ts +1 -1
- package/src/scaffolding/extensions/integrations/aave.ts +6 -8
- package/src/scaffolding/extensions/integrations/compound.ts +10 -11
- package/src/scaffolding/extensions/integrations/curve.ts +72 -68
- package/src/scaffolding/extensions/integrations/idle.ts +9 -11
- package/src/scaffolding/extensions/integrations/index.ts +2 -0
- package/src/scaffolding/extensions/integrations/mock.ts +11 -13
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +16 -11
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +73 -0
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +117 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +45 -12
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +31 -27
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +9 -10
- package/src/scaffolding/extensions/integrations/yearn.ts +9 -11
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +9 -7
- package/src/scaffolding/extensions/policies.ts +2 -1
- package/src/scaffolding/setup.ts +27 -19
- package/src/scaffolding/shares.ts +5 -4
- package/src/scaffolding/vaultCalls.ts +50 -3
- package/src/whales.ts +26 -17
- package/tsconfig.json +2 -1
@@ -1,10 +1,9 @@
|
|
1
1
|
import _asyncToGenerator from '@babel/runtime/helpers/esm/asyncToGenerator';
|
2
2
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
3
|
-
import {
|
3
|
+
import { AaveAdapter, AavePriceFeed, AddressListRegistry, AllowedAdapterIncomingAssetsPolicy, AllowedAdaptersPolicy, AllowedAssetsForRedemptionPolicy, AllowedDepositRecipientsPolicy, AllowedExternalPositionTypesPolicy, AllowedSharesTransferRecipientsPolicy, AssetFinalityResolver, CompoundAdapter, CompoundDebtPositionLib, CompoundDebtPositionParser, CompoundPriceFeed, ComptrollerLib, CumulativeSlippageTolerancePolicy, CurveExchangeAdapter, CurveLiquidityAaveAdapter, CurveLiquidityEursAdapter, CurveLiquiditySethAdapter, CurveLiquidityStethAdapter, CurvePriceFeed, DepositWrapper, Dispatcher, EntranceRateBurnFee, EntranceRateDirectFee, ExitRateBurnFee, ExitRateDirectFee, ExternalPositionFactory, ExternalPositionManager, FeeManager, FundDeployer, FundValueCalculator, FundValueCalculatorRouter, FundValueCalculatorUsdWrapper, GasRelayPaymasterFactory, GuaranteedRedemptionPolicy, IdleAdapter, IdlePriceFeed, IntegrationManager, LidoStethPriceFeed, ManagementFee, MinAssetBalancesPostRedemptionPolicy, MinMaxInvestmentPolicy, OnlyRemoveDustExternalPositionPolicy, OnlyUntrackDustOrPricelessAssetsPolicy, ParaSwapV4Adapter, ParaSwapV5Adapter, PerformanceFee, PolicyManager, PoolTogetherV4Adapter, PoolTogetherV4PriceFeed, ProtocolFeeReserveLib, ProtocolFeeTracker, RevertingPriceFeed, StakehoundEthPriceFeed, SynthetixAdapter, SynthetixPriceFeed, UniswapV2ExchangeAdapter, UniswapV2LiquidityAdapter, UniswapV2PoolPriceFeed, UniswapV3Adapter, UnpermissionedActionsWrapper, ValueInterpreter, VaultLib, YearnVaultV2Adapter, YearnVaultV2PriceFeed, ZeroExV2Adapter, IntegrationManagerActionId, addTrackedAssetsToVaultArgs, removeTrackedAssetsFromVaultArgs, StandardToken, callOnExternalPositionArgs, ExternalPositionManagerActionId, IExternalPositionProxy, encodeArgs, externalPositionReactivateArgs, externalPositionRemoveArgs, compoundExternalPositionActionArgs, CompoundDebtPositionActionId, ExternalPositionType, MockGenericExternalPositionParser, MockGenericExternalPositionLib, mockGenericExternalPositionActionArgs, MockGenericExternalPositionActionId, uniswapV3LiquidityPositionInitArgs, uniswapV3LiquidityPositionAddLiquidityArgs, UniswapV3LiquidityPositionActionId, uniswapV3LiquidityPositionCollectArgs, UniswapV3LiquidityPositionLib, uniswapV3LiquidityPositionMintArgs, uniswapV3LiquidityPositionPurgeArgs, uniswapV3LiquidityPositionRemoveLiquidityArgs, feeManagerConfigArgs, FeeSettlementType, FeeHook, IFee, aaveLendArgs, callOnIntegrationArgs, lendSelector, aaveRedeemArgs, redeemSelector, compoundArgs, curveTakeOrderArgs, takeOrderSelector, claimRewardsSelector, curveAaveLendArgs, curveAaveLendAndStakeArgs, lendAndStakeSelector, curveAaveRedeemArgs, curveAaveStakeArgs, stakeSelector, curveAaveUnstakeAndRedeemArgs, unstakeAndRedeemSelector, curveAaveUnstakeArgs, unstakeSelector, curveEursLendArgs, curveEursLendAndStakeArgs, curveEursRedeemArgs, curveEursStakeArgs, curveEursUnstakeAndRedeemArgs, curveEursUnstakeArgs, curveSethLendArgs, curveSethLendAndStakeArgs, curveSethRedeemArgs, curveSethStakeArgs, curveSethUnstakeAndRedeemArgs, curveSethUnstakeArgs, curveStethLendArgs, curveStethLendAndStakeArgs, curveStethRedeemArgs, curveStethStakeArgs, curveStethUnstakeAndRedeemArgs, curveStethUnstakeArgs, idleClaimRewardsArgs, idleLendArgs, idleRedeemArgs, sighash, 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
|
-
import {
|
5
|
+
import { extractEvent, contract, resolveAddress, randomAddress } from '@enzymefinance/ethers';
|
6
6
|
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
7
|
-
import { contract, resolveAddress, extractEvent, randomAddress } from '@enzymefinance/ethers';
|
8
7
|
import _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';
|
9
8
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
10
9
|
|
@@ -104,68 +103,81 @@ function _deployProtocolFixture() {
|
|
104
103
|
config = fixture['Config'].linkedData; // prettier-ignore
|
105
104
|
|
106
105
|
deployment = {
|
107
|
-
|
108
|
-
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
109
|
-
fundDeployer: new FundDeployer(fixture['FundDeployer'].address, deployer),
|
110
|
-
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
106
|
+
aaveAdapter: new AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
111
107
|
aavePriceFeed: new AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
108
|
+
addressListRegistry: new AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
109
|
+
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
110
|
+
allowedAdaptersPolicy: new AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
111
|
+
allowedAssetsForRedemptionPolicy: new AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
112
|
+
allowedDepositRecipientsPolicy: new AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
113
|
+
allowedExternalPositionTypesPolicy: new AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
114
|
+
allowedSharesTransferRecipientsPolicy: new AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
115
|
+
assetFinalityResolver: new AssetFinalityResolver(fixture['AssetFinalityResolver'].address, deployer),
|
116
|
+
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
112
117
|
compoundDebtPositionLib: new CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
113
118
|
compoundDebtPositionParser: new CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
114
119
|
compoundPriceFeed: new CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
119
|
-
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
120
|
-
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
121
|
-
wdgldPriceFeed: new WdgldPriceFeed(fixture['WdgldPriceFeed'].address, deployer),
|
122
|
-
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
123
|
-
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
124
|
-
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
125
|
-
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
126
|
-
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
127
|
-
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
120
|
+
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
121
|
+
cumulativeSlippageTolerancePolicy: new CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
122
|
+
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
128
123
|
curveLiquidityAaveAdapter: new CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
129
124
|
curveLiquidityEursAdapter: new CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
130
125
|
curveLiquiditySethAdapter: new CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
131
126
|
curveLiquidityStethAdapter: new CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
136
|
-
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
137
|
-
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer),
|
138
|
-
compoundAdapter: new CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
139
|
-
uniswapV2Adapter: new UniswapV2Adapter(fixture['UniswapV2Adapter'].address, deployer),
|
140
|
-
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
141
|
-
curveExchangeAdapter: new CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
142
|
-
feeManager: new FeeManager(fixture['FeeManager'].address, deployer),
|
143
|
-
comptrollerLib: new ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
127
|
+
curvePriceFeed: new CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
128
|
+
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
129
|
+
dispatcher: new Dispatcher(fixture['Dispatcher'].address, deployer),
|
144
130
|
entranceRateBurnFee: new EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
145
131
|
entranceRateDirectFee: new EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
146
132
|
exitRateBurnFee: new ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
147
133
|
exitRateDirectFee: new ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
134
|
+
externalPositionFactory: new ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
135
|
+
externalPositionManager: new ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
136
|
+
feeManager: new FeeManager(fixture['FeeManager'].address, deployer),
|
137
|
+
fundDeployer: new FundDeployer(fixture['FundDeployer'].address, deployer),
|
138
|
+
fundValueCalculator: new FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
139
|
+
fundValueCalculatorRouter: new FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
140
|
+
fundValueCalculatorUsdWrapper: new FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
141
|
+
gasRelayPaymasterFactory: new GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
142
|
+
guaranteedRedemptionPolicy: new GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
143
|
+
idleAdapter: new IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
144
|
+
idlePriceFeed: new IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
145
|
+
integrationManager: new IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
146
|
+
lidoStethPriceFeed: new LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
148
147
|
managementFee: new ManagementFee(fixture['ManagementFee'].address, deployer),
|
149
|
-
|
150
|
-
depositWrapper: new DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
151
|
-
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
152
|
-
allowedAdapterIncomingAssetsPolicy: new AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
148
|
+
minAssetBalancesPostRedemptionPolicy: new MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
153
149
|
minMaxInvestmentPolicy: new MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
150
|
+
onlyRemoveDustExternalPositionPolicy: new OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
151
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
152
|
+
paraSwapV4Adapter: new ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
153
|
+
paraSwapV5Adapter: new ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
154
|
+
performanceFee: new PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
155
|
+
policyManager: new PolicyManager(fixture['PolicyManager'].address, deployer),
|
156
|
+
poolTogetherV4Adapter: new PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
157
|
+
poolTogetherV4PriceFeed: new PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
159
158
|
protocolFeeReserveLib: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
160
159
|
protocolFeeReserveProxy: new ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
161
160
|
protocolFeeTracker: new ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
162
|
-
|
161
|
+
revertingPriceFeed: new RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
162
|
+
stakehoundEthPriceFeed: new StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
163
|
+
synthetixAdapter: new SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
164
|
+
synthetixPriceFeed: new SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
165
|
+
uniswapV2ExchangeAdapter: new UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
166
|
+
uniswapV2LiquidityAdapter: new UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
167
|
+
uniswapV2PoolPriceFeed: new UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
168
|
+
uniswapV3Adapter: new UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
169
|
+
unpermissionedActionsWrapper: new UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
170
|
+
valueInterpreter: new ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
171
|
+
vaultLib: new VaultLib(fixture['VaultLib'].address, deployer),
|
172
|
+
yearnVaultV2Adapter: new YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
173
|
+
yearnVaultV2PriceFeed: new YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
174
|
+
zeroExV2Adapter: new ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
163
175
|
};
|
164
176
|
return _context3.abrupt("return", {
|
165
|
-
deployer: deployer,
|
166
|
-
deployment: deployment,
|
167
177
|
accounts: accounts,
|
168
|
-
config: config
|
178
|
+
config: config,
|
179
|
+
deployer: deployer,
|
180
|
+
deployment: deployment
|
169
181
|
});
|
170
182
|
|
171
183
|
case 12:
|
@@ -178,30 +190,6 @@ function _deployProtocolFixture() {
|
|
178
190
|
return _deployProtocolFixture.apply(this, arguments);
|
179
191
|
}
|
180
192
|
|
181
|
-
// TODO: Remove this.
|
182
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
183
|
-
function defaultTestDeployment(_x2) {
|
184
|
-
return _defaultTestDeployment.apply(this, arguments);
|
185
|
-
}
|
186
|
-
|
187
|
-
function _defaultTestDeployment() {
|
188
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_) {
|
189
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
190
|
-
while (1) {
|
191
|
-
switch (_context4.prev = _context4.next) {
|
192
|
-
case 0:
|
193
|
-
throw new Error('Removed');
|
194
|
-
|
195
|
-
case 1:
|
196
|
-
case "end":
|
197
|
-
return _context4.stop();
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}, _callee4);
|
201
|
-
}));
|
202
|
-
return _defaultTestDeployment.apply(this, arguments);
|
203
|
-
}
|
204
|
-
|
205
193
|
function addTrackedAssetsToVault(_ref) {
|
206
194
|
var signer = _ref.signer,
|
207
195
|
comptrollerProxy = _ref.comptrollerProxy,
|
@@ -236,10 +224,10 @@ function _addNewAssetsToFund() {
|
|
236
224
|
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;
|
237
225
|
// First, add tracked assets while their balances are 0
|
238
226
|
receipt = addTrackedAssetsToVault({
|
239
|
-
|
227
|
+
assets: assets,
|
240
228
|
comptrollerProxy: comptrollerProxy,
|
241
229
|
integrationManager: integrationManager,
|
242
|
-
|
230
|
+
signer: signer
|
243
231
|
}); // Then seed the vault with balances as necessary
|
244
232
|
|
245
233
|
_context.next = 4;
|
@@ -391,13 +379,13 @@ function createFundDeployer(_x) {
|
|
391
379
|
|
392
380
|
function _createFundDeployer() {
|
393
381
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
394
|
-
var deployer, assetFinalityResolver, externalPositionManager, dispatcher,
|
382
|
+
var deployer, assetFinalityResolver, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
395
383
|
|
396
384
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
397
385
|
while (1) {
|
398
386
|
switch (_context.prev = _context.next) {
|
399
387
|
case 0:
|
400
|
-
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher,
|
388
|
+
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
401
389
|
_context.next = 3;
|
402
390
|
return vaultLib.getMlnToken();
|
403
391
|
|
@@ -419,77 +407,106 @@ function _createFundDeployer() {
|
|
419
407
|
case 12:
|
420
408
|
nextFundDeployer = _context.sent;
|
421
409
|
_context.next = 15;
|
422
|
-
return
|
410
|
+
return PolicyManager.deploy(deployer, nextFundDeployer, gasRelayPaymasterFactory);
|
423
411
|
|
424
412
|
case 15:
|
413
|
+
nextPolicyManager = _context.sent;
|
414
|
+
_context.t0 = ExternalPositionManager;
|
415
|
+
_context.t1 = deployer;
|
416
|
+
_context.t2 = nextFundDeployer;
|
417
|
+
_context.next = 21;
|
418
|
+
return externalPositionManager.getExternalPositionFactory();
|
419
|
+
|
420
|
+
case 21:
|
421
|
+
_context.t3 = _context.sent;
|
422
|
+
_context.t4 = nextPolicyManager;
|
423
|
+
_context.next = 25;
|
424
|
+
return _context.t0.deploy.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4);
|
425
|
+
|
426
|
+
case 25:
|
427
|
+
nextExternalPositionManager = _context.sent;
|
428
|
+
_context.next = 28;
|
429
|
+
return FeeManager.deploy(deployer, nextFundDeployer);
|
430
|
+
|
431
|
+
case 28:
|
432
|
+
nextFeeManager = _context.sent;
|
433
|
+
_context.next = 31;
|
434
|
+
return IntegrationManager.deploy(deployer, nextFundDeployer, nextPolicyManager, valueInterpreter);
|
435
|
+
|
436
|
+
case 31:
|
437
|
+
nextIntegrationManager = _context.sent;
|
438
|
+
_context.next = 34;
|
439
|
+
return ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, assetFinalityResolver, gasRelayPaymasterFactory, mlnToken, wethToken);
|
440
|
+
|
441
|
+
case 34:
|
425
442
|
nextComptrollerLib = _context.sent;
|
426
|
-
_context.next =
|
443
|
+
_context.next = 37;
|
427
444
|
return nextFundDeployer.setComptrollerLib(nextComptrollerLib);
|
428
445
|
|
429
|
-
case
|
430
|
-
_context.next =
|
446
|
+
case 37:
|
447
|
+
_context.next = 39;
|
431
448
|
return ProtocolFeeTracker.deploy(deployer, nextFundDeployer);
|
432
449
|
|
433
|
-
case
|
450
|
+
case 39:
|
434
451
|
nextProtocolFeeTracker = _context.sent;
|
435
|
-
_context.next =
|
452
|
+
_context.next = 42;
|
436
453
|
return nextFundDeployer.setProtocolFeeTracker(nextProtocolFeeTracker);
|
437
454
|
|
438
|
-
case
|
439
|
-
_context.
|
440
|
-
_context.
|
441
|
-
_context.
|
442
|
-
_context.next =
|
455
|
+
case 42:
|
456
|
+
_context.t5 = VaultLib;
|
457
|
+
_context.t6 = deployer;
|
458
|
+
_context.t7 = externalPositionManager;
|
459
|
+
_context.next = 47;
|
443
460
|
return vaultLib.getGasRelayPaymasterFactory();
|
444
461
|
|
445
|
-
case
|
446
|
-
_context.
|
447
|
-
_context.next =
|
462
|
+
case 47:
|
463
|
+
_context.t8 = _context.sent;
|
464
|
+
_context.next = 50;
|
448
465
|
return vaultLib.getProtocolFeeReserve();
|
449
466
|
|
450
|
-
case
|
451
|
-
_context.
|
452
|
-
_context.
|
453
|
-
_context.next =
|
467
|
+
case 50:
|
468
|
+
_context.t9 = _context.sent;
|
469
|
+
_context.t10 = nextProtocolFeeTracker;
|
470
|
+
_context.next = 54;
|
454
471
|
return vaultLib.getMlnToken();
|
455
472
|
|
456
|
-
case
|
457
|
-
_context.
|
458
|
-
_context.next =
|
473
|
+
case 54:
|
474
|
+
_context.t11 = _context.sent;
|
475
|
+
_context.next = 57;
|
459
476
|
return vaultLib.getWethToken();
|
460
477
|
|
461
|
-
case
|
462
|
-
_context.
|
463
|
-
_context.next =
|
464
|
-
return _context.
|
478
|
+
case 57:
|
479
|
+
_context.t12 = _context.sent;
|
480
|
+
_context.next = 60;
|
481
|
+
return _context.t5.deploy.call(_context.t5, _context.t6, _context.t7, _context.t8, _context.t9, _context.t10, _context.t11, _context.t12);
|
465
482
|
|
466
|
-
case
|
483
|
+
case 60:
|
467
484
|
nextVaultLib = _context.sent;
|
468
|
-
_context.next =
|
485
|
+
_context.next = 63;
|
469
486
|
return nextFundDeployer.setVaultLib(nextVaultLib);
|
470
487
|
|
471
|
-
case
|
488
|
+
case 63:
|
472
489
|
if (!setReleaseLive) {
|
473
|
-
_context.next =
|
490
|
+
_context.next = 66;
|
474
491
|
break;
|
475
492
|
}
|
476
493
|
|
477
|
-
_context.next =
|
494
|
+
_context.next = 66;
|
478
495
|
return nextFundDeployer.setReleaseLive();
|
479
496
|
|
480
|
-
case
|
497
|
+
case 66:
|
481
498
|
if (!setOnDispatcher) {
|
482
|
-
_context.next =
|
499
|
+
_context.next = 69;
|
483
500
|
break;
|
484
501
|
}
|
485
502
|
|
486
|
-
_context.next =
|
503
|
+
_context.next = 69;
|
487
504
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
488
505
|
|
489
|
-
case
|
506
|
+
case 69:
|
490
507
|
return _context.abrupt("return", nextFundDeployer);
|
491
508
|
|
492
|
-
case
|
509
|
+
case 70:
|
493
510
|
case "end":
|
494
511
|
return _context.stop();
|
495
512
|
}
|
@@ -535,21 +552,24 @@ function _callOnExtension() {
|
|
535
552
|
return _callOnExtension.apply(this, arguments);
|
536
553
|
}
|
537
554
|
|
538
|
-
|
539
|
-
|
540
|
-
return _createExternalPosition.apply(this, arguments);
|
555
|
+
function callOnExternalPosition(_x) {
|
556
|
+
return _callOnExternalPosition.apply(this, arguments);
|
541
557
|
}
|
542
558
|
|
543
|
-
function
|
544
|
-
|
545
|
-
var comptrollerProxy, externalPositionManager,
|
559
|
+
function _callOnExternalPosition() {
|
560
|
+
_callOnExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
561
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, actionId, actionArgs, callArgs;
|
546
562
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
547
563
|
while (1) {
|
548
564
|
switch (_context.prev = _context.next) {
|
549
565
|
case 0:
|
550
|
-
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager,
|
551
|
-
|
552
|
-
|
566
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
567
|
+
callArgs = callOnExternalPositionArgs({
|
568
|
+
actionArgs: actionArgs,
|
569
|
+
actionId: actionId,
|
570
|
+
externalPositionProxy: externalPositionProxy
|
571
|
+
});
|
572
|
+
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
553
573
|
|
554
574
|
case 3:
|
555
575
|
case "end":
|
@@ -558,242 +578,333 @@ function _createExternalPosition() {
|
|
558
578
|
}
|
559
579
|
}, _callee);
|
560
580
|
}));
|
561
|
-
return
|
581
|
+
return _callOnExternalPosition.apply(this, arguments);
|
562
582
|
}
|
563
583
|
|
564
|
-
function
|
565
|
-
return
|
584
|
+
function createExternalPosition(_x2) {
|
585
|
+
return _createExternalPosition.apply(this, arguments);
|
566
586
|
}
|
567
587
|
|
568
|
-
function
|
569
|
-
|
570
|
-
var comptrollerProxy, externalPositionManager,
|
588
|
+
function _createExternalPosition() {
|
589
|
+
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
590
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
591
|
+
|
571
592
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
572
593
|
while (1) {
|
573
594
|
switch (_context2.prev = _context2.next) {
|
574
595
|
case 0:
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
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;
|
597
|
+
_context2.next = 3;
|
598
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
599
|
+
|
600
|
+
case 3:
|
601
|
+
receipt = _context2.sent;
|
602
|
+
event = extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
603
|
+
externalPositionProxy = new IExternalPositionProxy(event[0].args.externalPosition, signer);
|
604
|
+
return _context2.abrupt("return", {
|
582
605
|
externalPositionProxy: externalPositionProxy,
|
583
|
-
|
584
|
-
encodedCallArgs: actionArgs
|
606
|
+
receipt: receipt
|
585
607
|
});
|
586
|
-
addCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
587
|
-
return _context2.abrupt("return", addCollateralTx);
|
588
608
|
|
589
|
-
case
|
609
|
+
case 7:
|
590
610
|
case "end":
|
591
611
|
return _context2.stop();
|
592
612
|
}
|
593
613
|
}
|
594
614
|
}, _callee2);
|
595
615
|
}));
|
596
|
-
return
|
616
|
+
return _createExternalPosition.apply(this, arguments);
|
597
617
|
}
|
598
618
|
|
599
|
-
function
|
600
|
-
return
|
619
|
+
function reactivateExternalPosition(_x3) {
|
620
|
+
return _reactivateExternalPosition.apply(this, arguments);
|
601
621
|
}
|
602
622
|
|
603
|
-
function
|
604
|
-
|
605
|
-
var comptrollerProxy, externalPositionManager,
|
623
|
+
function _reactivateExternalPosition() {
|
624
|
+
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
625
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
606
626
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
607
627
|
while (1) {
|
608
628
|
switch (_context3.prev = _context3.next) {
|
609
629
|
case 0:
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
amounts: amounts,
|
614
|
-
data: encodeArgs(['address[]'], [cTokens])
|
615
|
-
});
|
616
|
-
callArgs = callOnExternalPositionArgs({
|
617
|
-
externalPositionProxy: externalPositionProxy,
|
618
|
-
actionId: CompoundDebtPositionActionId.RemoveCollateralAssets,
|
619
|
-
encodedCallArgs: actionArgs
|
630
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy;
|
631
|
+
callArgs = externalPositionReactivateArgs({
|
632
|
+
externalPositionProxy: externalPositionProxy
|
620
633
|
});
|
621
|
-
|
622
|
-
return _context3.abrupt("return", removeCollateralTx);
|
634
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.ReactivateExternalPosition, callArgs));
|
623
635
|
|
624
|
-
case
|
636
|
+
case 3:
|
625
637
|
case "end":
|
626
638
|
return _context3.stop();
|
627
639
|
}
|
628
640
|
}
|
629
641
|
}, _callee3);
|
630
642
|
}));
|
631
|
-
return
|
643
|
+
return _reactivateExternalPosition.apply(this, arguments);
|
632
644
|
}
|
633
645
|
|
634
|
-
function
|
635
|
-
return
|
646
|
+
function removeExternalPosition(_x4) {
|
647
|
+
return _removeExternalPosition.apply(this, arguments);
|
636
648
|
}
|
637
649
|
|
638
|
-
function
|
639
|
-
|
640
|
-
var comptrollerProxy, externalPositionManager,
|
650
|
+
function _removeExternalPosition() {
|
651
|
+
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
652
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
641
653
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
642
654
|
while (1) {
|
643
655
|
switch (_context4.prev = _context4.next) {
|
644
656
|
case 0:
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
amounts: amounts,
|
649
|
-
data: encodeArgs(['address[]'], [cTokens])
|
650
|
-
});
|
651
|
-
callArgs = callOnExternalPositionArgs({
|
652
|
-
externalPositionProxy: externalPositionProxy,
|
653
|
-
actionId: CompoundDebtPositionActionId.BorrowAsset,
|
654
|
-
encodedCallArgs: actionArgs
|
657
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy;
|
658
|
+
callArgs = externalPositionRemoveArgs({
|
659
|
+
externalPositionProxy: externalPositionProxy
|
655
660
|
});
|
656
|
-
|
657
|
-
return _context4.abrupt("return", borrowTx);
|
661
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.RemoveExternalPosition, callArgs));
|
658
662
|
|
659
|
-
case
|
663
|
+
case 3:
|
660
664
|
case "end":
|
661
665
|
return _context4.stop();
|
662
666
|
}
|
663
667
|
}
|
664
668
|
}, _callee4);
|
665
669
|
}));
|
666
|
-
return
|
670
|
+
return _removeExternalPosition.apply(this, arguments);
|
667
671
|
}
|
668
672
|
|
669
|
-
function
|
670
|
-
return
|
673
|
+
function compoundDebtPositionAddCollateral(_x) {
|
674
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
671
675
|
}
|
672
676
|
|
673
|
-
function
|
674
|
-
|
675
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
676
|
-
return _regeneratorRuntime.wrap(function
|
677
|
+
function _compoundDebtPositionAddCollateral() {
|
678
|
+
_compoundDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
679
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
680
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
677
681
|
while (1) {
|
678
|
-
switch (
|
682
|
+
switch (_context.prev = _context.next) {
|
679
683
|
case 0:
|
680
|
-
comptrollerProxy =
|
684
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
681
685
|
actionArgs = compoundExternalPositionActionArgs({
|
682
|
-
|
683
|
-
|
684
|
-
data: '
|
686
|
+
amounts: amounts,
|
687
|
+
assets: assets,
|
688
|
+
data: encodeArgs(['address[]'], [cTokens])
|
685
689
|
});
|
686
|
-
|
690
|
+
return _context.abrupt("return", callOnExternalPosition({
|
691
|
+
actionArgs: actionArgs,
|
692
|
+
actionId: CompoundDebtPositionActionId.AddCollateralAssets,
|
693
|
+
comptrollerProxy: comptrollerProxy,
|
694
|
+
externalPositionManager: externalPositionManager,
|
687
695
|
externalPositionProxy: externalPositionProxy,
|
688
|
-
|
689
|
-
|
690
|
-
});
|
691
|
-
claimCompTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
692
|
-
return _context5.abrupt("return", claimCompTx);
|
696
|
+
signer: fundOwner
|
697
|
+
}));
|
693
698
|
|
694
|
-
case
|
699
|
+
case 3:
|
695
700
|
case "end":
|
696
|
-
return
|
701
|
+
return _context.stop();
|
697
702
|
}
|
698
703
|
}
|
699
|
-
},
|
704
|
+
}, _callee);
|
700
705
|
}));
|
701
|
-
return
|
706
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
702
707
|
}
|
703
708
|
|
704
|
-
function
|
705
|
-
return
|
709
|
+
function compoundDebtPositionBorrow(_x2) {
|
710
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
706
711
|
}
|
707
712
|
|
708
|
-
function
|
709
|
-
|
710
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts,
|
711
|
-
return _regeneratorRuntime.wrap(function
|
713
|
+
function _compoundDebtPositionBorrow() {
|
714
|
+
_compoundDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
715
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, assets, amounts, cTokens, actionArgs;
|
716
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
712
717
|
while (1) {
|
713
|
-
switch (
|
718
|
+
switch (_context2.prev = _context2.next) {
|
714
719
|
case 0:
|
715
|
-
comptrollerProxy =
|
720
|
+
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
716
721
|
actionArgs = compoundExternalPositionActionArgs({
|
717
|
-
assets: assets,
|
718
722
|
amounts: amounts,
|
723
|
+
assets: assets,
|
719
724
|
data: encodeArgs(['address[]'], [cTokens])
|
720
725
|
});
|
721
|
-
|
726
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
727
|
+
actionArgs: actionArgs,
|
728
|
+
actionId: CompoundDebtPositionActionId.BorrowAsset,
|
729
|
+
comptrollerProxy: comptrollerProxy,
|
730
|
+
externalPositionManager: externalPositionManager,
|
722
731
|
externalPositionProxy: externalPositionProxy,
|
723
|
-
|
724
|
-
|
725
|
-
});
|
726
|
-
repayTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
727
|
-
return _context6.abrupt("return", repayTx);
|
732
|
+
signer: fundOwner
|
733
|
+
}));
|
728
734
|
|
729
|
-
case
|
735
|
+
case 3:
|
730
736
|
case "end":
|
731
|
-
return
|
737
|
+
return _context2.stop();
|
732
738
|
}
|
733
739
|
}
|
734
|
-
},
|
740
|
+
}, _callee2);
|
735
741
|
}));
|
736
|
-
return
|
742
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
737
743
|
}
|
738
744
|
|
739
|
-
function
|
740
|
-
return
|
745
|
+
function compoundDebtPositionClaimComp(_x3) {
|
746
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
741
747
|
}
|
742
748
|
|
743
|
-
function
|
744
|
-
|
745
|
-
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs
|
746
|
-
return _regeneratorRuntime.wrap(function
|
749
|
+
function _compoundDebtPositionClaimComp() {
|
750
|
+
_compoundDebtPositionClaimComp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
751
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs;
|
752
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
747
753
|
while (1) {
|
748
|
-
switch (
|
754
|
+
switch (_context3.prev = _context3.next) {
|
749
755
|
case 0:
|
750
|
-
comptrollerProxy =
|
751
|
-
actionArgs =
|
752
|
-
|
756
|
+
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
757
|
+
actionArgs = compoundExternalPositionActionArgs({
|
758
|
+
amounts: [],
|
759
|
+
assets: [],
|
760
|
+
data: '0x'
|
753
761
|
});
|
754
|
-
|
762
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
763
|
+
actionArgs: actionArgs,
|
764
|
+
actionId: CompoundDebtPositionActionId.ClaimComp,
|
765
|
+
comptrollerProxy: comptrollerProxy,
|
766
|
+
externalPositionManager: externalPositionManager,
|
755
767
|
externalPositionProxy: externalPositionProxy,
|
756
|
-
|
757
|
-
});
|
758
|
-
removeExternalPositionTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.RemoveExternalPosition, callArgs);
|
759
|
-
return _context7.abrupt("return", removeExternalPositionTx);
|
768
|
+
signer: fundOwner
|
769
|
+
}));
|
760
770
|
|
761
|
-
case
|
771
|
+
case 3:
|
762
772
|
case "end":
|
763
|
-
return
|
773
|
+
return _context3.stop();
|
764
774
|
}
|
765
775
|
}
|
766
|
-
},
|
776
|
+
}, _callee3);
|
767
777
|
}));
|
768
|
-
return
|
778
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
769
779
|
}
|
770
780
|
|
771
|
-
function
|
772
|
-
return
|
781
|
+
function compoundDebtPositionRemoveCollateral(_x4) {
|
782
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
773
783
|
}
|
774
784
|
|
775
|
-
function
|
776
|
-
|
777
|
-
var comptrollerProxy, externalPositionManager,
|
778
|
-
return _regeneratorRuntime.wrap(function
|
785
|
+
function _compoundDebtPositionRemoveCollateral() {
|
786
|
+
_compoundDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
787
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
788
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
779
789
|
while (1) {
|
780
|
-
switch (
|
790
|
+
switch (_context4.prev = _context4.next) {
|
781
791
|
case 0:
|
782
|
-
comptrollerProxy =
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
792
|
+
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
793
|
+
actionArgs = compoundExternalPositionActionArgs({
|
794
|
+
amounts: amounts,
|
795
|
+
assets: assets,
|
796
|
+
data: encodeArgs(['address[]'], [cTokens])
|
797
|
+
});
|
798
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
799
|
+
actionArgs: actionArgs,
|
800
|
+
actionId: CompoundDebtPositionActionId.RemoveCollateralAssets,
|
801
|
+
comptrollerProxy: comptrollerProxy,
|
802
|
+
externalPositionManager: externalPositionManager,
|
803
|
+
externalPositionProxy: externalPositionProxy,
|
804
|
+
signer: fundOwner
|
805
|
+
}));
|
793
806
|
|
794
|
-
case
|
795
|
-
|
796
|
-
|
807
|
+
case 3:
|
808
|
+
case "end":
|
809
|
+
return _context4.stop();
|
810
|
+
}
|
811
|
+
}
|
812
|
+
}, _callee4);
|
813
|
+
}));
|
814
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
815
|
+
}
|
816
|
+
|
817
|
+
function compoundDebtPositionRepayBorrow(_x5) {
|
818
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
819
|
+
}
|
820
|
+
|
821
|
+
function _compoundDebtPositionRepayBorrow() {
|
822
|
+
_compoundDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
823
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
824
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
825
|
+
while (1) {
|
826
|
+
switch (_context5.prev = _context5.next) {
|
827
|
+
case 0:
|
828
|
+
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
829
|
+
actionArgs = compoundExternalPositionActionArgs({
|
830
|
+
amounts: amounts,
|
831
|
+
assets: assets,
|
832
|
+
data: encodeArgs(['address[]'], [cTokens])
|
833
|
+
});
|
834
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
835
|
+
actionArgs: actionArgs,
|
836
|
+
actionId: CompoundDebtPositionActionId.RepayBorrowedAssets,
|
837
|
+
comptrollerProxy: comptrollerProxy,
|
838
|
+
externalPositionManager: externalPositionManager,
|
839
|
+
externalPositionProxy: externalPositionProxy,
|
840
|
+
signer: fundOwner
|
841
|
+
}));
|
842
|
+
|
843
|
+
case 3:
|
844
|
+
case "end":
|
845
|
+
return _context5.stop();
|
846
|
+
}
|
847
|
+
}
|
848
|
+
}, _callee5);
|
849
|
+
}));
|
850
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
851
|
+
}
|
852
|
+
|
853
|
+
function createCompoundDebtPosition(_x6) {
|
854
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
855
|
+
}
|
856
|
+
|
857
|
+
function _createCompoundDebtPosition() {
|
858
|
+
_createCompoundDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
859
|
+
var signer, comptrollerProxy, externalPositionManager;
|
860
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
861
|
+
while (1) {
|
862
|
+
switch (_context6.prev = _context6.next) {
|
863
|
+
case 0:
|
864
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
865
|
+
return _context6.abrupt("return", createExternalPosition({
|
866
|
+
comptrollerProxy: comptrollerProxy,
|
867
|
+
externalPositionManager: externalPositionManager,
|
868
|
+
externalPositionTypeId: ExternalPositionType.CompoundDebtPosition,
|
869
|
+
signer: signer
|
870
|
+
}));
|
871
|
+
|
872
|
+
case 2:
|
873
|
+
case "end":
|
874
|
+
return _context6.stop();
|
875
|
+
}
|
876
|
+
}
|
877
|
+
}, _callee6);
|
878
|
+
}));
|
879
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
880
|
+
}
|
881
|
+
|
882
|
+
function createMockExternalPosition(_x) {
|
883
|
+
return _createMockExternalPosition.apply(this, arguments);
|
884
|
+
}
|
885
|
+
|
886
|
+
function _createMockExternalPosition() {
|
887
|
+
_createMockExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
888
|
+
var comptrollerProxy, externalPositionManager, externalPositionFactory, defaultActionAssetsToTransfer, defaultActionAmountsToTransfer, defaultActionAssetsToReceive, fundOwner, deployer, vaultProxy, typeId, mockGenericExternalPositionLib, mockExternalPositionParser, receipt, externalPositionProxy;
|
889
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
890
|
+
while (1) {
|
891
|
+
switch (_context.prev = _context.next) {
|
892
|
+
case 0:
|
893
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
894
|
+
_context.t0 = VaultLib;
|
895
|
+
_context.next = 4;
|
896
|
+
return comptrollerProxy.getVaultProxy();
|
897
|
+
|
898
|
+
case 4:
|
899
|
+
_context.t1 = _context.sent;
|
900
|
+
_context.t2 = deployer;
|
901
|
+
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
902
|
+
_context.next = 9;
|
903
|
+
return externalPositionFactory.getPositionTypeCounter();
|
904
|
+
|
905
|
+
case 9:
|
906
|
+
typeId = _context.sent;
|
907
|
+
_context.next = 12;
|
797
908
|
return externalPositionFactory.addNewPositionTypes(['TEST']);
|
798
909
|
|
799
910
|
case 12:
|
@@ -813,7 +924,7 @@ function _createMockExternalPosition() {
|
|
813
924
|
|
814
925
|
case 21:
|
815
926
|
_context.next = 23;
|
816
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId
|
927
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CreateExternalPosition, encodeArgs(['uint256', 'bytes'], [typeId, '0x']));
|
817
928
|
|
818
929
|
case 23:
|
819
930
|
receipt = _context.sent;
|
@@ -823,11 +934,11 @@ function _createMockExternalPosition() {
|
|
823
934
|
case 26:
|
824
935
|
externalPositionProxy = _context.sent[0];
|
825
936
|
return _context.abrupt("return", {
|
826
|
-
typeId: typeId,
|
827
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
828
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
829
937
|
externalPositionProxy: externalPositionProxy,
|
830
|
-
|
938
|
+
mockExternalPositionParser: mockExternalPositionParser,
|
939
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
940
|
+
receipt: receipt,
|
941
|
+
typeId: typeId
|
831
942
|
});
|
832
943
|
|
833
944
|
case 28:
|
@@ -840,6 +951,416 @@ function _createMockExternalPosition() {
|
|
840
951
|
return _createMockExternalPosition.apply(this, arguments);
|
841
952
|
}
|
842
953
|
|
954
|
+
function mockExternalPositionAddDebtAssets(_x2) {
|
955
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
956
|
+
}
|
957
|
+
|
958
|
+
function _mockExternalPositionAddDebtAssets() {
|
959
|
+
_mockExternalPositionAddDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
960
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
961
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
962
|
+
while (1) {
|
963
|
+
switch (_context2.prev = _context2.next) {
|
964
|
+
case 0:
|
965
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
966
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
967
|
+
amounts: amounts,
|
968
|
+
assets: assets
|
969
|
+
});
|
970
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
971
|
+
actionArgs: actionArgs,
|
972
|
+
actionId: MockGenericExternalPositionActionId.AddDebtAssets,
|
973
|
+
comptrollerProxy: comptrollerProxy,
|
974
|
+
externalPositionManager: externalPositionManager,
|
975
|
+
externalPositionProxy: externalPositionProxy,
|
976
|
+
signer: signer
|
977
|
+
}));
|
978
|
+
|
979
|
+
case 3:
|
980
|
+
case "end":
|
981
|
+
return _context2.stop();
|
982
|
+
}
|
983
|
+
}
|
984
|
+
}, _callee2);
|
985
|
+
}));
|
986
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
987
|
+
}
|
988
|
+
|
989
|
+
function mockExternalPositionAddManagedAssets(_x3) {
|
990
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
991
|
+
}
|
992
|
+
|
993
|
+
function _mockExternalPositionAddManagedAssets() {
|
994
|
+
_mockExternalPositionAddManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
995
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
996
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
997
|
+
while (1) {
|
998
|
+
switch (_context3.prev = _context3.next) {
|
999
|
+
case 0:
|
1000
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
1001
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1002
|
+
amounts: amounts,
|
1003
|
+
assets: assets
|
1004
|
+
});
|
1005
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
1006
|
+
actionArgs: actionArgs,
|
1007
|
+
actionId: MockGenericExternalPositionActionId.AddManagedAssets,
|
1008
|
+
comptrollerProxy: comptrollerProxy,
|
1009
|
+
externalPositionManager: externalPositionManager,
|
1010
|
+
externalPositionProxy: externalPositionProxy,
|
1011
|
+
signer: signer
|
1012
|
+
}));
|
1013
|
+
|
1014
|
+
case 3:
|
1015
|
+
case "end":
|
1016
|
+
return _context3.stop();
|
1017
|
+
}
|
1018
|
+
}
|
1019
|
+
}, _callee3);
|
1020
|
+
}));
|
1021
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1022
|
+
}
|
1023
|
+
|
1024
|
+
function mockExternalPositionRemoveDebtAssets(_x4) {
|
1025
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1026
|
+
}
|
1027
|
+
|
1028
|
+
function _mockExternalPositionRemoveDebtAssets() {
|
1029
|
+
_mockExternalPositionRemoveDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
1030
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1031
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1032
|
+
while (1) {
|
1033
|
+
switch (_context4.prev = _context4.next) {
|
1034
|
+
case 0:
|
1035
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
1036
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1037
|
+
amounts: amounts,
|
1038
|
+
assets: assets
|
1039
|
+
});
|
1040
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
1041
|
+
actionArgs: actionArgs,
|
1042
|
+
actionId: MockGenericExternalPositionActionId.RemoveDebtAssets,
|
1043
|
+
comptrollerProxy: comptrollerProxy,
|
1044
|
+
externalPositionManager: externalPositionManager,
|
1045
|
+
externalPositionProxy: externalPositionProxy,
|
1046
|
+
signer: signer
|
1047
|
+
}));
|
1048
|
+
|
1049
|
+
case 3:
|
1050
|
+
case "end":
|
1051
|
+
return _context4.stop();
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
}, _callee4);
|
1055
|
+
}));
|
1056
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
function mockExternalPositionRemoveManagedAssets(_x5) {
|
1060
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
function _mockExternalPositionRemoveManagedAssets() {
|
1064
|
+
_mockExternalPositionRemoveManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
1065
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1066
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1067
|
+
while (1) {
|
1068
|
+
switch (_context5.prev = _context5.next) {
|
1069
|
+
case 0:
|
1070
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
1071
|
+
actionArgs = mockGenericExternalPositionActionArgs({
|
1072
|
+
amounts: amounts,
|
1073
|
+
assets: assets
|
1074
|
+
});
|
1075
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
1076
|
+
actionArgs: actionArgs,
|
1077
|
+
actionId: MockGenericExternalPositionActionId.RemoveManagedAssets,
|
1078
|
+
comptrollerProxy: comptrollerProxy,
|
1079
|
+
externalPositionManager: externalPositionManager,
|
1080
|
+
externalPositionProxy: externalPositionProxy,
|
1081
|
+
signer: signer
|
1082
|
+
}));
|
1083
|
+
|
1084
|
+
case 3:
|
1085
|
+
case "end":
|
1086
|
+
return _context5.stop();
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
}, _callee5);
|
1090
|
+
}));
|
1091
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
var _templateObject$3;
|
1095
|
+
var UniswapV3FeeAmount;
|
1096
|
+
|
1097
|
+
(function (UniswapV3FeeAmount) {
|
1098
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
1099
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
1100
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
1101
|
+
})(UniswapV3FeeAmount || (UniswapV3FeeAmount = {}));
|
1102
|
+
|
1103
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
1104
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
1105
|
+
};
|
1106
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
1107
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
1108
|
+
};
|
1109
|
+
var IUniswapV3NonFungibleTokenManager = contract()(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n function positions(uint256 tokenId) view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1)\n"])));
|
1110
|
+
function createUniswapV3LiquidityPosition(_x) {
|
1111
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1112
|
+
}
|
1113
|
+
|
1114
|
+
function _createUniswapV3LiquidityPosition() {
|
1115
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1116
|
+
var signer, comptrollerProxy, externalPositionManager, token0, token1, initArgs, receipt, vaultProxy, externalPositions, externalPositionProxyAddress;
|
1117
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1118
|
+
while (1) {
|
1119
|
+
switch (_context.prev = _context.next) {
|
1120
|
+
case 0:
|
1121
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, token0 = _ref.token0, token1 = _ref.token1;
|
1122
|
+
initArgs = uniswapV3LiquidityPositionInitArgs({
|
1123
|
+
token0: token0,
|
1124
|
+
token1: token1
|
1125
|
+
});
|
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
|
+
|
1142
|
+
case 13:
|
1143
|
+
externalPositions = _context.sent;
|
1144
|
+
externalPositionProxyAddress = externalPositions[externalPositions.length - 1];
|
1145
|
+
return _context.abrupt("return", {
|
1146
|
+
externalPositionProxyAddress: externalPositionProxyAddress,
|
1147
|
+
receipt: receipt
|
1148
|
+
});
|
1149
|
+
|
1150
|
+
case 16:
|
1151
|
+
case "end":
|
1152
|
+
return _context.stop();
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
}, _callee);
|
1156
|
+
}));
|
1157
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
1161
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1162
|
+
}
|
1163
|
+
|
1164
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
1165
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
1166
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
1167
|
+
|
1168
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1169
|
+
while (1) {
|
1170
|
+
switch (_context2.prev = _context2.next) {
|
1171
|
+
case 0:
|
1172
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, nftId = _ref2.nftId, amount0Desired = _ref2.amount0Desired, amount1Desired = _ref2.amount1Desired, _ref2$amount0Min = _ref2.amount0Min, amount0Min = _ref2$amount0Min === void 0 ? 0 : _ref2$amount0Min, _ref2$amount1Min = _ref2.amount1Min, amount1Min = _ref2$amount1Min === void 0 ? 0 : _ref2$amount1Min;
|
1173
|
+
actionArgs = uniswapV3LiquidityPositionAddLiquidityArgs({
|
1174
|
+
amount0Desired: amount0Desired,
|
1175
|
+
amount0Min: amount0Min,
|
1176
|
+
amount1Desired: amount1Desired,
|
1177
|
+
amount1Min: amount1Min,
|
1178
|
+
nftId: nftId
|
1179
|
+
});
|
1180
|
+
callArgs = callOnExternalPositionArgs({
|
1181
|
+
actionArgs: actionArgs,
|
1182
|
+
actionId: UniswapV3LiquidityPositionActionId.AddLiquidity,
|
1183
|
+
externalPositionProxy: externalPositionProxy
|
1184
|
+
});
|
1185
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1186
|
+
|
1187
|
+
case 4:
|
1188
|
+
case "end":
|
1189
|
+
return _context2.stop();
|
1190
|
+
}
|
1191
|
+
}
|
1192
|
+
}, _callee2);
|
1193
|
+
}));
|
1194
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1195
|
+
}
|
1196
|
+
|
1197
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
1198
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1199
|
+
}
|
1200
|
+
|
1201
|
+
function _uniswapV3LiquidityPositionCollect() {
|
1202
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
1203
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
1204
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
1205
|
+
while (1) {
|
1206
|
+
switch (_context3.prev = _context3.next) {
|
1207
|
+
case 0:
|
1208
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
1209
|
+
actionArgs = uniswapV3LiquidityPositionCollectArgs({
|
1210
|
+
nftId: nftId
|
1211
|
+
});
|
1212
|
+
callArgs = callOnExternalPositionArgs({
|
1213
|
+
actionArgs: actionArgs,
|
1214
|
+
actionId: UniswapV3LiquidityPositionActionId.Collect,
|
1215
|
+
externalPositionProxy: externalPositionProxy
|
1216
|
+
});
|
1217
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1218
|
+
|
1219
|
+
case 4:
|
1220
|
+
case "end":
|
1221
|
+
return _context3.stop();
|
1222
|
+
}
|
1223
|
+
}
|
1224
|
+
}, _callee3);
|
1225
|
+
}));
|
1226
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
1230
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
function _uniswapV3LiquidityPositionMint() {
|
1234
|
+
_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;
|
1236
|
+
|
1237
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1238
|
+
while (1) {
|
1239
|
+
switch (_context4.prev = _context4.next) {
|
1240
|
+
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;
|
1242
|
+
actionArgs = uniswapV3LiquidityPositionMintArgs({
|
1243
|
+
amount0Desired: amount0Desired,
|
1244
|
+
amount0Min: amount0Min,
|
1245
|
+
amount1Desired: amount1Desired,
|
1246
|
+
amount1Min: amount1Min,
|
1247
|
+
fee: fee,
|
1248
|
+
tickLower: tickLower,
|
1249
|
+
tickUpper: tickUpper
|
1250
|
+
});
|
1251
|
+
callArgs = callOnExternalPositionArgs({
|
1252
|
+
actionArgs: actionArgs,
|
1253
|
+
actionId: UniswapV3LiquidityPositionActionId.Mint,
|
1254
|
+
externalPositionProxy: externalPositionProxy
|
1255
|
+
});
|
1256
|
+
_context4.next = 5;
|
1257
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
1258
|
+
|
1259
|
+
case 5:
|
1260
|
+
receipt = _context4.sent;
|
1261
|
+
externalPosition = new UniswapV3LiquidityPositionLib(externalPositionProxy, provider);
|
1262
|
+
nftId = extractEvent(receipt, externalPosition.abi.getEvent('NFTPositionAdded'))[0].args.tokenId;
|
1263
|
+
return _context4.abrupt("return", {
|
1264
|
+
nftId: nftId,
|
1265
|
+
receipt: receipt
|
1266
|
+
});
|
1267
|
+
|
1268
|
+
case 9:
|
1269
|
+
case "end":
|
1270
|
+
return _context4.stop();
|
1271
|
+
}
|
1272
|
+
}
|
1273
|
+
}, _callee4);
|
1274
|
+
}));
|
1275
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
function uniswapV3LiquidityPositionPurge(_x5) {
|
1279
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1280
|
+
}
|
1281
|
+
|
1282
|
+
function _uniswapV3LiquidityPositionPurge() {
|
1283
|
+
_uniswapV3LiquidityPositionPurge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
1284
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref5$amount0Min, amount0Min, _ref5$amount1Min, amount1Min, actionArgs, callArgs;
|
1285
|
+
|
1286
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
1287
|
+
while (1) {
|
1288
|
+
switch (_context5.prev = _context5.next) {
|
1289
|
+
case 0:
|
1290
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, nftId = _ref5.nftId, liquidity = _ref5.liquidity, _ref5$amount0Min = _ref5.amount0Min, amount0Min = _ref5$amount0Min === void 0 ? 0 : _ref5$amount0Min, _ref5$amount1Min = _ref5.amount1Min, amount1Min = _ref5$amount1Min === void 0 ? 0 : _ref5$amount1Min;
|
1291
|
+
actionArgs = uniswapV3LiquidityPositionPurgeArgs({
|
1292
|
+
amount0Min: amount0Min,
|
1293
|
+
amount1Min: amount1Min,
|
1294
|
+
liquidity: liquidity,
|
1295
|
+
nftId: nftId
|
1296
|
+
});
|
1297
|
+
callArgs = callOnExternalPositionArgs({
|
1298
|
+
actionArgs: actionArgs,
|
1299
|
+
actionId: UniswapV3LiquidityPositionActionId.Purge,
|
1300
|
+
externalPositionProxy: externalPositionProxy
|
1301
|
+
});
|
1302
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1303
|
+
|
1304
|
+
case 4:
|
1305
|
+
case "end":
|
1306
|
+
return _context5.stop();
|
1307
|
+
}
|
1308
|
+
}
|
1309
|
+
}, _callee5);
|
1310
|
+
}));
|
1311
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
function uniswapV3LiquidityPositionRemoveLiquidity(_x6) {
|
1315
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
function _uniswapV3LiquidityPositionRemoveLiquidity() {
|
1319
|
+
_uniswapV3LiquidityPositionRemoveLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
1320
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref6$amount0Min, amount0Min, _ref6$amount1Min, amount1Min, actionArgs, callArgs;
|
1321
|
+
|
1322
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
1323
|
+
while (1) {
|
1324
|
+
switch (_context6.prev = _context6.next) {
|
1325
|
+
case 0:
|
1326
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager, externalPositionProxy = _ref6.externalPositionProxy, nftId = _ref6.nftId, liquidity = _ref6.liquidity, _ref6$amount0Min = _ref6.amount0Min, amount0Min = _ref6$amount0Min === void 0 ? 0 : _ref6$amount0Min, _ref6$amount1Min = _ref6.amount1Min, amount1Min = _ref6$amount1Min === void 0 ? 0 : _ref6$amount1Min;
|
1327
|
+
actionArgs = uniswapV3LiquidityPositionRemoveLiquidityArgs({
|
1328
|
+
amount0Min: amount0Min,
|
1329
|
+
amount1Min: amount1Min,
|
1330
|
+
liquidity: liquidity,
|
1331
|
+
nftId: nftId
|
1332
|
+
});
|
1333
|
+
callArgs = callOnExternalPositionArgs({
|
1334
|
+
actionArgs: actionArgs,
|
1335
|
+
actionId: UniswapV3LiquidityPositionActionId.RemoveLiquidity,
|
1336
|
+
externalPositionProxy: externalPositionProxy
|
1337
|
+
});
|
1338
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1339
|
+
|
1340
|
+
case 4:
|
1341
|
+
case "end":
|
1342
|
+
return _context6.stop();
|
1343
|
+
}
|
1344
|
+
}
|
1345
|
+
}, _callee6);
|
1346
|
+
}));
|
1347
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
function uniswapV3OrderTokenPair(_ref7) {
|
1351
|
+
var tokenA = _ref7.tokenA,
|
1352
|
+
tokenB = _ref7.tokenB;
|
1353
|
+
var tokenAAddress = resolveAddress(tokenA);
|
1354
|
+
var tokenBAddress = resolveAddress(tokenB);
|
1355
|
+
return tokenAAddress < tokenBAddress ? {
|
1356
|
+
token0: tokenAAddress,
|
1357
|
+
token1: tokenBAddress
|
1358
|
+
} : {
|
1359
|
+
token0: tokenBAddress,
|
1360
|
+
token1: tokenAAddress
|
1361
|
+
};
|
1362
|
+
}
|
1363
|
+
|
843
1364
|
function generateFeeManagerConfigWithMockFees(_x) {
|
844
1365
|
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
845
1366
|
}
|
@@ -944,8 +1465,8 @@ function _aaveLend() {
|
|
944
1465
|
});
|
945
1466
|
callArgs = callOnIntegrationArgs({
|
946
1467
|
adapter: aaveAdapter,
|
947
|
-
|
948
|
-
|
1468
|
+
encodedCallArgs: lendArgs,
|
1469
|
+
selector: lendSelector
|
949
1470
|
});
|
950
1471
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
951
1472
|
return _context.abrupt("return", lendTx);
|
@@ -979,8 +1500,8 @@ function _aaveRedeem() {
|
|
979
1500
|
});
|
980
1501
|
callArgs = callOnIntegrationArgs({
|
981
1502
|
adapter: aaveAdapter,
|
982
|
-
|
983
|
-
|
1503
|
+
encodedCallArgs: redeemArgs,
|
1504
|
+
selector: redeemSelector
|
984
1505
|
});
|
985
1506
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
986
1507
|
return _context2.abrupt("return", redeemTx);
|
@@ -1012,13 +1533,13 @@ function _compoundLend() {
|
|
1012
1533
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, cToken = _ref.cToken, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? utils.parseEther('1') : _ref$tokenAmount, _ref$cTokenAmount = _ref.cTokenAmount, cTokenAmount = _ref$cTokenAmount === void 0 ? utils.parseEther('1') : _ref$cTokenAmount;
|
1013
1534
|
lendArgs = compoundArgs({
|
1014
1535
|
cToken: cToken,
|
1015
|
-
|
1016
|
-
|
1536
|
+
minIncomingAssetAmount: cTokenAmount,
|
1537
|
+
outgoingAssetAmount: tokenAmount
|
1017
1538
|
});
|
1018
1539
|
callArgs = callOnIntegrationArgs({
|
1019
1540
|
adapter: compoundAdapter,
|
1020
|
-
|
1021
|
-
|
1541
|
+
encodedCallArgs: lendArgs,
|
1542
|
+
selector: lendSelector
|
1022
1543
|
});
|
1023
1544
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1024
1545
|
return _context.abrupt("return", lendTx);
|
@@ -1048,13 +1569,13 @@ function _compoundRedeem() {
|
|
1048
1569
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, _ref2$tokenAmount = _ref2.tokenAmount, tokenAmount = _ref2$tokenAmount === void 0 ? utils.parseEther('1') : _ref2$tokenAmount, _ref2$cTokenAmount = _ref2.cTokenAmount, cTokenAmount = _ref2$cTokenAmount === void 0 ? utils.parseEther('1') : _ref2$cTokenAmount;
|
1049
1570
|
redeemArgs = compoundArgs({
|
1050
1571
|
cToken: resolveAddress(cToken),
|
1051
|
-
|
1052
|
-
|
1572
|
+
minIncomingAssetAmount: tokenAmount,
|
1573
|
+
outgoingAssetAmount: cTokenAmount
|
1053
1574
|
});
|
1054
1575
|
callArgs = callOnIntegrationArgs({
|
1055
1576
|
adapter: compoundAdapter,
|
1056
|
-
|
1057
|
-
|
1577
|
+
encodedCallArgs: redeemArgs,
|
1578
|
+
selector: redeemSelector
|
1058
1579
|
});
|
1059
1580
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1060
1581
|
return _context2.abrupt("return", redeemTx);
|
@@ -1089,16 +1610,16 @@ function _curveTakeOrder() {
|
|
1089
1610
|
case 0:
|
1090
1611
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, curveExchangeAdapter = _ref.curveExchangeAdapter, pool = _ref.pool, outgoingAsset = _ref.outgoingAsset, _ref$outgoingAssetAmo = _ref.outgoingAssetAmount, outgoingAssetAmount = _ref$outgoingAssetAmo === void 0 ? utils.parseEther('1') : _ref$outgoingAssetAmo, incomingAsset = _ref.incomingAsset, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? utils.parseEther('1') : _ref$minIncomingAsset;
|
1091
1612
|
takeOrderArgs = curveTakeOrderArgs({
|
1092
|
-
|
1613
|
+
incomingAsset: incomingAsset,
|
1614
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1093
1615
|
outgoingAsset: outgoingAsset,
|
1094
1616
|
outgoingAssetAmount: outgoingAssetAmount,
|
1095
|
-
|
1096
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
1617
|
+
pool: pool
|
1097
1618
|
});
|
1098
1619
|
callArgs = callOnIntegrationArgs({
|
1099
1620
|
adapter: curveExchangeAdapter,
|
1100
|
-
|
1101
|
-
|
1621
|
+
encodedCallArgs: takeOrderArgs,
|
1622
|
+
selector: takeOrderSelector
|
1102
1623
|
});
|
1103
1624
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1104
1625
|
|
@@ -1119,8 +1640,8 @@ function curveAaveClaimRewards(_ref2) {
|
|
1119
1640
|
curveLiquidityAaveAdapter = _ref2.curveLiquidityAaveAdapter;
|
1120
1641
|
var callArgs = callOnIntegrationArgs({
|
1121
1642
|
adapter: curveLiquidityAaveAdapter,
|
1122
|
-
|
1123
|
-
|
1643
|
+
encodedCallArgs: constants.HashZero,
|
1644
|
+
selector: claimRewardsSelector
|
1124
1645
|
});
|
1125
1646
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1126
1647
|
}
|
@@ -1141,14 +1662,14 @@ function curveAaveLend(_ref3) {
|
|
1141
1662
|
useUnderlyings = _ref3$useUnderlyings === void 0 ? false : _ref3$useUnderlyings;
|
1142
1663
|
var callArgs = callOnIntegrationArgs({
|
1143
1664
|
adapter: curveLiquidityAaveAdapter,
|
1144
|
-
selector: lendSelector,
|
1145
1665
|
encodedCallArgs: curveAaveLendArgs({
|
1666
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1146
1667
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1147
1668
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1148
1669
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1149
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1150
1670
|
useUnderlyings: useUnderlyings
|
1151
|
-
})
|
1671
|
+
}),
|
1672
|
+
selector: lendSelector
|
1152
1673
|
});
|
1153
1674
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1154
1675
|
}
|
@@ -1169,14 +1690,14 @@ function curveAaveLendAndStake(_ref4) {
|
|
1169
1690
|
useUnderlyings = _ref4$useUnderlyings === void 0 ? false : _ref4$useUnderlyings;
|
1170
1691
|
var callArgs = callOnIntegrationArgs({
|
1171
1692
|
adapter: curveLiquidityAaveAdapter,
|
1172
|
-
selector: lendAndStakeSelector,
|
1173
1693
|
encodedCallArgs: curveAaveLendAndStakeArgs({
|
1694
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1174
1695
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1175
1696
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1176
1697
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1177
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1178
1698
|
useUnderlyings: useUnderlyings
|
1179
|
-
})
|
1699
|
+
}),
|
1700
|
+
selector: lendAndStakeSelector
|
1180
1701
|
});
|
1181
1702
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1182
1703
|
}
|
@@ -1198,15 +1719,15 @@ function curveAaveRedeem(_ref5) {
|
|
1198
1719
|
useUnderlyings = _ref5$useUnderlyings === void 0 ? false : _ref5$useUnderlyings;
|
1199
1720
|
var callArgs = callOnIntegrationArgs({
|
1200
1721
|
adapter: curveLiquidityAaveAdapter,
|
1201
|
-
selector: redeemSelector,
|
1202
1722
|
encodedCallArgs: curveAaveRedeemArgs({
|
1203
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1204
1723
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1205
1724
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1206
1725
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1726
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1207
1727
|
receiveSingleAsset: receiveSingleAsset,
|
1208
1728
|
useUnderlyings: useUnderlyings
|
1209
|
-
})
|
1729
|
+
}),
|
1730
|
+
selector: redeemSelector
|
1210
1731
|
});
|
1211
1732
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1212
1733
|
}
|
@@ -1218,10 +1739,10 @@ function curveAaveStake(_ref6) {
|
|
1218
1739
|
outgoingLPTokenAmount = _ref6.outgoingLPTokenAmount;
|
1219
1740
|
var callArgs = callOnIntegrationArgs({
|
1220
1741
|
adapter: curveLiquidityAaveAdapter,
|
1221
|
-
selector: stakeSelector,
|
1222
1742
|
encodedCallArgs: curveAaveStakeArgs({
|
1223
1743
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1224
|
-
})
|
1744
|
+
}),
|
1745
|
+
selector: stakeSelector
|
1225
1746
|
});
|
1226
1747
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1227
1748
|
}
|
@@ -1243,15 +1764,15 @@ function curveAaveUnstakeAndRedeem(_ref7) {
|
|
1243
1764
|
useUnderlyings = _ref7$useUnderlyings === void 0 ? false : _ref7$useUnderlyings;
|
1244
1765
|
var callArgs = callOnIntegrationArgs({
|
1245
1766
|
adapter: curveLiquidityAaveAdapter,
|
1246
|
-
selector: unstakeAndRedeemSelector,
|
1247
1767
|
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
1248
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1249
1768
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1250
1769
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1251
1770
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1771
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1252
1772
|
receiveSingleAsset: receiveSingleAsset,
|
1253
1773
|
useUnderlyings: useUnderlyings
|
1254
|
-
})
|
1774
|
+
}),
|
1775
|
+
selector: unstakeAndRedeemSelector
|
1255
1776
|
});
|
1256
1777
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1257
1778
|
}
|
@@ -1263,10 +1784,10 @@ function curveAaveUnstake(_ref8) {
|
|
1263
1784
|
outgoingLiquidityGaugeTokenAmount = _ref8.outgoingLiquidityGaugeTokenAmount;
|
1264
1785
|
var callArgs = callOnIntegrationArgs({
|
1265
1786
|
adapter: curveLiquidityAaveAdapter,
|
1266
|
-
selector: unstakeSelector,
|
1267
1787
|
encodedCallArgs: curveAaveUnstakeArgs({
|
1268
1788
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1269
|
-
})
|
1789
|
+
}),
|
1790
|
+
selector: unstakeSelector
|
1270
1791
|
});
|
1271
1792
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1272
1793
|
} // eurs pool
|
@@ -1278,8 +1799,8 @@ function curveEursClaimRewards(_ref9) {
|
|
1278
1799
|
curveLiquidityEursAdapter = _ref9.curveLiquidityEursAdapter;
|
1279
1800
|
var callArgs = callOnIntegrationArgs({
|
1280
1801
|
adapter: curveLiquidityEursAdapter,
|
1281
|
-
|
1282
|
-
|
1802
|
+
encodedCallArgs: constants.HashZero,
|
1803
|
+
selector: claimRewardsSelector
|
1283
1804
|
});
|
1284
1805
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1285
1806
|
}
|
@@ -1293,12 +1814,12 @@ function curveEursLend(_ref10) {
|
|
1293
1814
|
minIncomingLPTokenAmount = _ref10.minIncomingLPTokenAmount;
|
1294
1815
|
var callArgs = callOnIntegrationArgs({
|
1295
1816
|
adapter: curveLiquidityEursAdapter,
|
1296
|
-
selector: lendSelector,
|
1297
1817
|
encodedCallArgs: curveEursLendArgs({
|
1818
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1298
1819
|
outgoingEursAmount: outgoingEursAmount,
|
1299
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1300
|
-
|
1301
|
-
|
1820
|
+
outgoingSeurAmount: outgoingSeurAmount
|
1821
|
+
}),
|
1822
|
+
selector: lendSelector
|
1302
1823
|
});
|
1303
1824
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1304
1825
|
}
|
@@ -1312,12 +1833,12 @@ function curveEursLendAndStake(_ref11) {
|
|
1312
1833
|
minIncomingLiquidityGaugeTokenAmount = _ref11.minIncomingLiquidityGaugeTokenAmount;
|
1313
1834
|
var callArgs = callOnIntegrationArgs({
|
1314
1835
|
adapter: curveLiquidityEursAdapter,
|
1315
|
-
selector: lendAndStakeSelector,
|
1316
1836
|
encodedCallArgs: curveEursLendAndStakeArgs({
|
1837
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1317
1838
|
outgoingEursAmount: outgoingEursAmount,
|
1318
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1319
|
-
|
1320
|
-
|
1839
|
+
outgoingSeurAmount: outgoingSeurAmount
|
1840
|
+
}),
|
1841
|
+
selector: lendAndStakeSelector
|
1321
1842
|
});
|
1322
1843
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1323
1844
|
}
|
@@ -1332,13 +1853,13 @@ function curveEursRedeem(_ref12) {
|
|
1332
1853
|
receiveSingleAsset = _ref12.receiveSingleAsset;
|
1333
1854
|
var callArgs = callOnIntegrationArgs({
|
1334
1855
|
adapter: curveLiquidityEursAdapter,
|
1335
|
-
selector: redeemSelector,
|
1336
1856
|
encodedCallArgs: curveEursRedeemArgs({
|
1337
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1338
1857
|
minIncomingEursAmount: minIncomingEursAmount,
|
1339
1858
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
1859
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1340
1860
|
receiveSingleAsset: receiveSingleAsset
|
1341
|
-
})
|
1861
|
+
}),
|
1862
|
+
selector: redeemSelector
|
1342
1863
|
});
|
1343
1864
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1344
1865
|
}
|
@@ -1350,10 +1871,10 @@ function curveEursStake(_ref13) {
|
|
1350
1871
|
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
1351
1872
|
var callArgs = callOnIntegrationArgs({
|
1352
1873
|
adapter: curveLiquidityEursAdapter,
|
1353
|
-
selector: stakeSelector,
|
1354
1874
|
encodedCallArgs: curveEursStakeArgs({
|
1355
1875
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1356
|
-
})
|
1876
|
+
}),
|
1877
|
+
selector: stakeSelector
|
1357
1878
|
});
|
1358
1879
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1359
1880
|
}
|
@@ -1368,13 +1889,13 @@ function curveEursUnstakeAndRedeem(_ref14) {
|
|
1368
1889
|
receiveSingleAsset = _ref14.receiveSingleAsset;
|
1369
1890
|
var callArgs = callOnIntegrationArgs({
|
1370
1891
|
adapter: curveLiquidityEursAdapter,
|
1371
|
-
selector: unstakeAndRedeemSelector,
|
1372
1892
|
encodedCallArgs: curveEursUnstakeAndRedeemArgs({
|
1373
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1374
1893
|
minIncomingEursAmount: minIncomingEursAmount,
|
1375
1894
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
1895
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1376
1896
|
receiveSingleAsset: receiveSingleAsset
|
1377
|
-
})
|
1897
|
+
}),
|
1898
|
+
selector: unstakeAndRedeemSelector
|
1378
1899
|
});
|
1379
1900
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1380
1901
|
}
|
@@ -1386,10 +1907,10 @@ function curveEursUnstake(_ref15) {
|
|
1386
1907
|
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
1387
1908
|
var callArgs = callOnIntegrationArgs({
|
1388
1909
|
adapter: curveLiquidityEursAdapter,
|
1389
|
-
selector: unstakeSelector,
|
1390
1910
|
encodedCallArgs: curveEursUnstakeArgs({
|
1391
1911
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1392
|
-
})
|
1912
|
+
}),
|
1913
|
+
selector: unstakeSelector
|
1393
1914
|
});
|
1394
1915
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1395
1916
|
} // sETH pool
|
@@ -1401,8 +1922,8 @@ function curveSethClaimRewards(_ref16) {
|
|
1401
1922
|
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
1402
1923
|
var callArgs = callOnIntegrationArgs({
|
1403
1924
|
adapter: curveLiquiditySethAdapter,
|
1404
|
-
|
1405
|
-
|
1925
|
+
encodedCallArgs: constants.HashZero,
|
1926
|
+
selector: claimRewardsSelector
|
1406
1927
|
});
|
1407
1928
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1408
1929
|
}
|
@@ -1416,12 +1937,12 @@ function curveSethLend(_ref17) {
|
|
1416
1937
|
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
1417
1938
|
var callArgs = callOnIntegrationArgs({
|
1418
1939
|
adapter: curveLiquiditySethAdapter,
|
1419
|
-
selector: lendSelector,
|
1420
1940
|
encodedCallArgs: curveSethLendArgs({
|
1421
|
-
|
1941
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1422
1942
|
outgoingSethAmount: outgoingSethAmount,
|
1423
|
-
|
1424
|
-
})
|
1943
|
+
outgoingWethAmount: outgoingWethAmount
|
1944
|
+
}),
|
1945
|
+
selector: lendSelector
|
1425
1946
|
});
|
1426
1947
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1427
1948
|
}
|
@@ -1435,12 +1956,12 @@ function curveSethLendAndStake(_ref18) {
|
|
1435
1956
|
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
1436
1957
|
var callArgs = callOnIntegrationArgs({
|
1437
1958
|
adapter: curveLiquiditySethAdapter,
|
1438
|
-
selector: lendAndStakeSelector,
|
1439
1959
|
encodedCallArgs: curveSethLendAndStakeArgs({
|
1440
|
-
|
1960
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1441
1961
|
outgoingSethAmount: outgoingSethAmount,
|
1442
|
-
|
1443
|
-
})
|
1962
|
+
outgoingWethAmount: outgoingWethAmount
|
1963
|
+
}),
|
1964
|
+
selector: lendAndStakeSelector
|
1444
1965
|
});
|
1445
1966
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1446
1967
|
}
|
@@ -1455,13 +1976,13 @@ function curveSethRedeem(_ref19) {
|
|
1455
1976
|
receiveSingleAsset = _ref19.receiveSingleAsset;
|
1456
1977
|
var callArgs = callOnIntegrationArgs({
|
1457
1978
|
adapter: curveLiquiditySethAdapter,
|
1458
|
-
selector: redeemSelector,
|
1459
1979
|
encodedCallArgs: curveSethRedeemArgs({
|
1460
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1461
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1462
1980
|
minIncomingSethAmount: minIncomingSethAmount,
|
1981
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
1982
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1463
1983
|
receiveSingleAsset: receiveSingleAsset
|
1464
|
-
})
|
1984
|
+
}),
|
1985
|
+
selector: redeemSelector
|
1465
1986
|
});
|
1466
1987
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1467
1988
|
}
|
@@ -1473,10 +1994,10 @@ function curveSethStake(_ref20) {
|
|
1473
1994
|
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
1474
1995
|
var callArgs = callOnIntegrationArgs({
|
1475
1996
|
adapter: curveLiquiditySethAdapter,
|
1476
|
-
selector: stakeSelector,
|
1477
1997
|
encodedCallArgs: curveSethStakeArgs({
|
1478
1998
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1479
|
-
})
|
1999
|
+
}),
|
2000
|
+
selector: stakeSelector
|
1480
2001
|
});
|
1481
2002
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1482
2003
|
}
|
@@ -1491,13 +2012,13 @@ function curveSethUnstakeAndRedeem(_ref21) {
|
|
1491
2012
|
receiveSingleAsset = _ref21.receiveSingleAsset;
|
1492
2013
|
var callArgs = callOnIntegrationArgs({
|
1493
2014
|
adapter: curveLiquiditySethAdapter,
|
1494
|
-
selector: unstakeAndRedeemSelector,
|
1495
2015
|
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
1496
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1497
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1498
2016
|
minIncomingSethAmount: minIncomingSethAmount,
|
2017
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2018
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1499
2019
|
receiveSingleAsset: receiveSingleAsset
|
1500
|
-
})
|
2020
|
+
}),
|
2021
|
+
selector: unstakeAndRedeemSelector
|
1501
2022
|
});
|
1502
2023
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1503
2024
|
}
|
@@ -1509,10 +2030,10 @@ function curveSethUnstake(_ref22) {
|
|
1509
2030
|
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
1510
2031
|
var callArgs = callOnIntegrationArgs({
|
1511
2032
|
adapter: curveLiquiditySethAdapter,
|
1512
|
-
selector: unstakeSelector,
|
1513
2033
|
encodedCallArgs: curveSethUnstakeArgs({
|
1514
2034
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1515
|
-
})
|
2035
|
+
}),
|
2036
|
+
selector: unstakeSelector
|
1516
2037
|
});
|
1517
2038
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1518
2039
|
} // stETH pool
|
@@ -1524,8 +2045,8 @@ function curveStethClaimRewards(_ref23) {
|
|
1524
2045
|
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
1525
2046
|
var callArgs = callOnIntegrationArgs({
|
1526
2047
|
adapter: curveLiquidityStethAdapter,
|
1527
|
-
|
1528
|
-
|
2048
|
+
encodedCallArgs: constants.HashZero,
|
2049
|
+
selector: claimRewardsSelector
|
1529
2050
|
});
|
1530
2051
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1531
2052
|
}
|
@@ -1539,12 +2060,12 @@ function curveStethLend(_ref24) {
|
|
1539
2060
|
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
1540
2061
|
var callArgs = callOnIntegrationArgs({
|
1541
2062
|
adapter: curveLiquidityStethAdapter,
|
1542
|
-
selector: lendSelector,
|
1543
2063
|
encodedCallArgs: curveStethLendArgs({
|
1544
|
-
|
2064
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1545
2065
|
outgoingStethAmount: outgoingStethAmount,
|
1546
|
-
|
1547
|
-
})
|
2066
|
+
outgoingWethAmount: outgoingWethAmount
|
2067
|
+
}),
|
2068
|
+
selector: lendSelector
|
1548
2069
|
});
|
1549
2070
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1550
2071
|
}
|
@@ -1558,12 +2079,12 @@ function curveStethLendAndStake(_ref25) {
|
|
1558
2079
|
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
1559
2080
|
var callArgs = callOnIntegrationArgs({
|
1560
2081
|
adapter: curveLiquidityStethAdapter,
|
1561
|
-
selector: lendAndStakeSelector,
|
1562
2082
|
encodedCallArgs: curveStethLendAndStakeArgs({
|
1563
|
-
|
2083
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1564
2084
|
outgoingStethAmount: outgoingStethAmount,
|
1565
|
-
|
1566
|
-
})
|
2085
|
+
outgoingWethAmount: outgoingWethAmount
|
2086
|
+
}),
|
2087
|
+
selector: lendAndStakeSelector
|
1567
2088
|
});
|
1568
2089
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1569
2090
|
}
|
@@ -1578,13 +2099,13 @@ function curveStethRedeem(_ref26) {
|
|
1578
2099
|
receiveSingleAsset = _ref26.receiveSingleAsset;
|
1579
2100
|
var callArgs = callOnIntegrationArgs({
|
1580
2101
|
adapter: curveLiquidityStethAdapter,
|
1581
|
-
selector: redeemSelector,
|
1582
2102
|
encodedCallArgs: curveStethRedeemArgs({
|
1583
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1584
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1585
2103
|
minIncomingStethAmount: minIncomingStethAmount,
|
2104
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2105
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1586
2106
|
receiveSingleAsset: receiveSingleAsset
|
1587
|
-
})
|
2107
|
+
}),
|
2108
|
+
selector: redeemSelector
|
1588
2109
|
});
|
1589
2110
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1590
2111
|
}
|
@@ -1596,10 +2117,10 @@ function curveStethStake(_ref27) {
|
|
1596
2117
|
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
1597
2118
|
var callArgs = callOnIntegrationArgs({
|
1598
2119
|
adapter: curveLiquidityStethAdapter,
|
1599
|
-
selector: stakeSelector,
|
1600
2120
|
encodedCallArgs: curveStethStakeArgs({
|
1601
2121
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1602
|
-
})
|
2122
|
+
}),
|
2123
|
+
selector: stakeSelector
|
1603
2124
|
});
|
1604
2125
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1605
2126
|
}
|
@@ -1614,13 +2135,13 @@ function curveStethUnstakeAndRedeem(_ref28) {
|
|
1614
2135
|
receiveSingleAsset = _ref28.receiveSingleAsset;
|
1615
2136
|
var callArgs = callOnIntegrationArgs({
|
1616
2137
|
adapter: curveLiquidityStethAdapter,
|
1617
|
-
selector: unstakeAndRedeemSelector,
|
1618
2138
|
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
1619
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1620
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1621
2139
|
minIncomingStethAmount: minIncomingStethAmount,
|
2140
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2141
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1622
2142
|
receiveSingleAsset: receiveSingleAsset
|
1623
|
-
})
|
2143
|
+
}),
|
2144
|
+
selector: unstakeAndRedeemSelector
|
1624
2145
|
});
|
1625
2146
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1626
2147
|
}
|
@@ -1632,10 +2153,10 @@ function curveStethUnstake(_ref29) {
|
|
1632
2153
|
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
1633
2154
|
var callArgs = callOnIntegrationArgs({
|
1634
2155
|
adapter: curveLiquidityStethAdapter,
|
1635
|
-
selector: unstakeSelector,
|
1636
2156
|
encodedCallArgs: curveStethUnstakeArgs({
|
1637
2157
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1638
|
-
})
|
2158
|
+
}),
|
2159
|
+
selector: unstakeSelector
|
1639
2160
|
});
|
1640
2161
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1641
2162
|
}
|
@@ -1654,10 +2175,10 @@ function _idleClaimRewards() {
|
|
1654
2175
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
1655
2176
|
callArgs = callOnIntegrationArgs({
|
1656
2177
|
adapter: idleAdapter,
|
1657
|
-
selector: claimRewardsSelector,
|
1658
2178
|
encodedCallArgs: idleClaimRewardsArgs({
|
1659
2179
|
idleToken: idleToken
|
1660
|
-
})
|
2180
|
+
}),
|
2181
|
+
selector: claimRewardsSelector
|
1661
2182
|
});
|
1662
2183
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1663
2184
|
|
@@ -1686,12 +2207,12 @@ function _idleLend() {
|
|
1686
2207
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, idleAdapter = _ref2.idleAdapter, idleToken = _ref2.idleToken, outgoingUnderlyingAmount = _ref2.outgoingUnderlyingAmount, _ref2$minIncomingIdle = _ref2.minIncomingIdleTokenAmount, minIncomingIdleTokenAmount = _ref2$minIncomingIdle === void 0 ? BigNumber.from(1) : _ref2$minIncomingIdle;
|
1687
2208
|
callArgs = callOnIntegrationArgs({
|
1688
2209
|
adapter: idleAdapter,
|
1689
|
-
selector: lendSelector,
|
1690
2210
|
encodedCallArgs: idleLendArgs({
|
1691
2211
|
idleToken: idleToken,
|
1692
|
-
|
1693
|
-
|
1694
|
-
})
|
2212
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
2213
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
2214
|
+
}),
|
2215
|
+
selector: lendSelector
|
1695
2216
|
});
|
1696
2217
|
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1697
2218
|
|
@@ -1720,12 +2241,12 @@ function _idleRedeem() {
|
|
1720
2241
|
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, idleAdapter = _ref3.idleAdapter, idleToken = _ref3.idleToken, outgoingIdleTokenAmount = _ref3.outgoingIdleTokenAmount, _ref3$minIncomingUnde = _ref3.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref3$minIncomingUnde === void 0 ? BigNumber.from(1) : _ref3$minIncomingUnde;
|
1721
2242
|
callArgs = callOnIntegrationArgs({
|
1722
2243
|
adapter: idleAdapter,
|
1723
|
-
selector: redeemSelector,
|
1724
2244
|
encodedCallArgs: idleRedeemArgs({
|
1725
2245
|
idleToken: idleToken,
|
1726
|
-
|
1727
|
-
|
1728
|
-
})
|
2246
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2247
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
2248
|
+
}),
|
2249
|
+
selector: redeemSelector
|
1729
2250
|
});
|
1730
2251
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1731
2252
|
|
@@ -1796,17 +2317,17 @@ function _mockGenericSwap() {
|
|
1796
2317
|
|
1797
2318
|
case 9:
|
1798
2319
|
swapArgs = mockGenericSwapArgs({
|
1799
|
-
|
1800
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2320
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
1801
2321
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
1802
2322
|
incomingAssets: incomingAssets,
|
2323
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
1803
2324
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
1804
|
-
|
2325
|
+
spendAssets: spendAssets
|
1805
2326
|
});
|
1806
2327
|
callArgs = callOnIntegrationArgs({
|
1807
2328
|
adapter: mockGenericAdapter,
|
1808
|
-
|
1809
|
-
|
2329
|
+
encodedCallArgs: swapArgs,
|
2330
|
+
selector: selector
|
1810
2331
|
});
|
1811
2332
|
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1812
2333
|
_context.next = 14;
|
@@ -1829,10 +2350,10 @@ function paraSwapV4GenerateDummyPaths(_ref) {
|
|
1829
2350
|
var toTokens = _ref.toTokens;
|
1830
2351
|
return toTokens.map(function (toToken) {
|
1831
2352
|
return {
|
1832
|
-
to: toToken,
|
1833
|
-
totalNetworkFee: 0,
|
1834
2353
|
// Not supported in our protocol
|
1835
|
-
routes: []
|
2354
|
+
routes: [],
|
2355
|
+
to: toToken,
|
2356
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
1836
2357
|
|
1837
2358
|
};
|
1838
2359
|
});
|
@@ -1851,16 +2372,16 @@ function _paraSwapV4TakeOrder() {
|
|
1851
2372
|
case 0:
|
1852
2373
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV4Adapter = _ref2.paraSwapV4Adapter, outgoingAsset = _ref2.outgoingAsset, _ref2$outgoingAssetAm = _ref2.outgoingAssetAmount, outgoingAssetAmount = _ref2$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref2$outgoingAssetAm, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, paths = _ref2.paths;
|
1853
2374
|
takeOrderArgs = paraSwapV4TakeOrderArgs({
|
1854
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
1855
2375
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2376
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1856
2377
|
outgoingAsset: outgoingAsset,
|
1857
2378
|
outgoingAssetAmount: outgoingAssetAmount,
|
1858
2379
|
paths: paths
|
1859
2380
|
});
|
1860
2381
|
callArgs = callOnIntegrationArgs({
|
1861
2382
|
adapter: paraSwapV4Adapter,
|
1862
|
-
|
1863
|
-
|
2383
|
+
encodedCallArgs: takeOrderArgs,
|
2384
|
+
selector: takeOrderSelector
|
1864
2385
|
});
|
1865
2386
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1866
2387
|
|
@@ -1874,6 +2395,161 @@ function _paraSwapV4TakeOrder() {
|
|
1874
2395
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
1875
2396
|
}
|
1876
2397
|
|
2398
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
2399
|
+
var toTokens = _ref.toTokens;
|
2400
|
+
return toTokens.map(function (toToken) {
|
2401
|
+
return {
|
2402
|
+
// Not supported in our protocol
|
2403
|
+
adapters: [],
|
2404
|
+
to: toToken,
|
2405
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2406
|
+
|
2407
|
+
};
|
2408
|
+
});
|
2409
|
+
}
|
2410
|
+
function paraSwapV5TakeOrder(_x) {
|
2411
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2412
|
+
}
|
2413
|
+
|
2414
|
+
function _paraSwapV5TakeOrder() {
|
2415
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
2416
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
2417
|
+
|
2418
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2419
|
+
while (1) {
|
2420
|
+
switch (_context.prev = _context.next) {
|
2421
|
+
case 0:
|
2422
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV5Adapter = _ref2.paraSwapV5Adapter, outgoingAsset = _ref2.outgoingAsset, outgoingAssetAmount = _ref2.outgoingAssetAmount, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, _ref2$uuid = _ref2.uuid, uuid = _ref2$uuid === void 0 ? utils.randomBytes(16) : _ref2$uuid, paths = _ref2.paths;
|
2423
|
+
takeOrderArgs = paraSwapV5TakeOrderArgs({
|
2424
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2425
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2426
|
+
outgoingAsset: outgoingAsset,
|
2427
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
2428
|
+
paths: paths,
|
2429
|
+
uuid: uuid
|
2430
|
+
});
|
2431
|
+
callArgs = callOnIntegrationArgs({
|
2432
|
+
adapter: paraSwapV5Adapter,
|
2433
|
+
encodedCallArgs: takeOrderArgs,
|
2434
|
+
selector: takeOrderSelector
|
2435
|
+
});
|
2436
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2437
|
+
|
2438
|
+
case 4:
|
2439
|
+
case "end":
|
2440
|
+
return _context.stop();
|
2441
|
+
}
|
2442
|
+
}
|
2443
|
+
}, _callee);
|
2444
|
+
}));
|
2445
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2446
|
+
}
|
2447
|
+
|
2448
|
+
function poolTogetherV4Lend(_x) {
|
2449
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2450
|
+
}
|
2451
|
+
|
2452
|
+
function _poolTogetherV4Lend() {
|
2453
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2454
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
2455
|
+
|
2456
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2457
|
+
while (1) {
|
2458
|
+
switch (_context.prev = _context.next) {
|
2459
|
+
case 0:
|
2460
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, poolTogetherV4Adapter = _ref.poolTogetherV4Adapter, ptToken = _ref.ptToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? utils.parseEther('1') : _ref$amount;
|
2461
|
+
lendArgs = poolTogetherV4LendArgs({
|
2462
|
+
amount: amount,
|
2463
|
+
ptToken: ptToken
|
2464
|
+
});
|
2465
|
+
callArgs = callOnIntegrationArgs({
|
2466
|
+
adapter: poolTogetherV4Adapter,
|
2467
|
+
encodedCallArgs: lendArgs,
|
2468
|
+
selector: lendSelector
|
2469
|
+
});
|
2470
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2471
|
+
return _context.abrupt("return", lendTx);
|
2472
|
+
|
2473
|
+
case 5:
|
2474
|
+
case "end":
|
2475
|
+
return _context.stop();
|
2476
|
+
}
|
2477
|
+
}
|
2478
|
+
}, _callee);
|
2479
|
+
}));
|
2480
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2481
|
+
}
|
2482
|
+
|
2483
|
+
function poolTogetherV4Redeem(_x2) {
|
2484
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2485
|
+
}
|
2486
|
+
|
2487
|
+
function _poolTogetherV4Redeem() {
|
2488
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2489
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
2490
|
+
|
2491
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2492
|
+
while (1) {
|
2493
|
+
switch (_context2.prev = _context2.next) {
|
2494
|
+
case 0:
|
2495
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, poolTogetherV4Adapter = _ref2.poolTogetherV4Adapter, ptToken = _ref2.ptToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? utils.parseEther('1') : _ref2$amount;
|
2496
|
+
redeemArgs = poolTogetherV4RedeemArgs({
|
2497
|
+
amount: amount,
|
2498
|
+
ptToken: ptToken
|
2499
|
+
});
|
2500
|
+
callArgs = callOnIntegrationArgs({
|
2501
|
+
adapter: poolTogetherV4Adapter,
|
2502
|
+
encodedCallArgs: redeemArgs,
|
2503
|
+
selector: redeemSelector
|
2504
|
+
});
|
2505
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2506
|
+
return _context2.abrupt("return", redeemTx);
|
2507
|
+
|
2508
|
+
case 5:
|
2509
|
+
case "end":
|
2510
|
+
return _context2.stop();
|
2511
|
+
}
|
2512
|
+
}
|
2513
|
+
}, _callee2);
|
2514
|
+
}));
|
2515
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2516
|
+
}
|
2517
|
+
|
2518
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
2519
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2520
|
+
}
|
2521
|
+
|
2522
|
+
function _poolTogetherV4ClaimRewards() {
|
2523
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2524
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
2525
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2526
|
+
while (1) {
|
2527
|
+
switch (_context3.prev = _context3.next) {
|
2528
|
+
case 0:
|
2529
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
2530
|
+
claimRewardsArgs = poolTogetherV4ClaimRewardsArgs({
|
2531
|
+
drawIds: drawIds,
|
2532
|
+
prizeDistributor: prizeDistributor,
|
2533
|
+
winningPicks: winningPicks
|
2534
|
+
});
|
2535
|
+
callArgs = callOnIntegrationArgs({
|
2536
|
+
adapter: poolTogetherV4Adapter,
|
2537
|
+
encodedCallArgs: claimRewardsArgs,
|
2538
|
+
selector: claimRewardsSelector
|
2539
|
+
});
|
2540
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2541
|
+
return _context3.abrupt("return", claimTx);
|
2542
|
+
|
2543
|
+
case 5:
|
2544
|
+
case "end":
|
2545
|
+
return _context3.stop();
|
2546
|
+
}
|
2547
|
+
}
|
2548
|
+
}, _callee3);
|
2549
|
+
}));
|
2550
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2551
|
+
}
|
2552
|
+
|
1877
2553
|
function synthetixAssignExchangeDelegate(_x) {
|
1878
2554
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
1879
2555
|
}
|
@@ -1931,26 +2607,58 @@ function _synthetixResolveAddress() {
|
|
1931
2607
|
return _synthetixResolveAddress.apply(this, arguments);
|
1932
2608
|
}
|
1933
2609
|
|
1934
|
-
function
|
2610
|
+
function synthetixRedeem(_x3) {
|
2611
|
+
return _synthetixRedeem.apply(this, arguments);
|
2612
|
+
}
|
2613
|
+
|
2614
|
+
function _synthetixRedeem() {
|
2615
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2616
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
2617
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2618
|
+
while (1) {
|
2619
|
+
switch (_context3.prev = _context3.next) {
|
2620
|
+
case 0:
|
2621
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, signer = _ref3.signer, synthetixAdapter = _ref3.synthetixAdapter, synths = _ref3.synths;
|
2622
|
+
redeemArgs = synthetixRedeemArgs({
|
2623
|
+
synths: synths
|
2624
|
+
});
|
2625
|
+
callArgs = callOnIntegrationArgs({
|
2626
|
+
adapter: synthetixAdapter,
|
2627
|
+
encodedCallArgs: redeemArgs,
|
2628
|
+
selector: redeemSelector
|
2629
|
+
});
|
2630
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2631
|
+
|
2632
|
+
case 4:
|
2633
|
+
case "end":
|
2634
|
+
return _context3.stop();
|
2635
|
+
}
|
2636
|
+
}
|
2637
|
+
}, _callee3);
|
2638
|
+
}));
|
2639
|
+
return _synthetixRedeem.apply(this, arguments);
|
2640
|
+
}
|
2641
|
+
|
2642
|
+
function synthetixTakeOrder(_x4) {
|
1935
2643
|
return _synthetixTakeOrder.apply(this, arguments);
|
1936
2644
|
}
|
1937
2645
|
|
1938
2646
|
function _synthetixTakeOrder() {
|
1939
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
1940
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
2647
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
2648
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref4$outgoingAssetAm, outgoingAssetAmount, incomingAsset, _ref4$minIncomingAsse, minIncomingAssetAmount, _ref4$seedFund, seedFund, takeOrderArgs, callArgs;
|
1941
2649
|
|
1942
|
-
return _regeneratorRuntime.wrap(function
|
2650
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
1943
2651
|
while (1) {
|
1944
|
-
switch (
|
2652
|
+
switch (_context4.prev = _context4.next) {
|
1945
2653
|
case 0:
|
1946
|
-
comptrollerProxy =
|
2654
|
+
comptrollerProxy = _ref4.comptrollerProxy, vaultProxy = _ref4.vaultProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, synthetixAdapter = _ref4.synthetixAdapter, outgoingAsset = _ref4.outgoingAsset, _ref4$outgoingAssetAm = _ref4.outgoingAssetAmount, outgoingAssetAmount = _ref4$outgoingAssetAm === void 0 ? utils.parseEther('1') : _ref4$outgoingAssetAm, incomingAsset = _ref4.incomingAsset, _ref4$minIncomingAsse = _ref4.minIncomingAssetAmount, minIncomingAssetAmount = _ref4$minIncomingAsse === void 0 ? utils.parseEther('1') : _ref4$minIncomingAsse, _ref4$seedFund = _ref4.seedFund, seedFund = _ref4$seedFund === void 0 ? false : _ref4$seedFund;
|
1947
2655
|
|
1948
2656
|
if (!seedFund) {
|
1949
|
-
|
2657
|
+
_context4.next = 4;
|
1950
2658
|
break;
|
1951
2659
|
}
|
1952
2660
|
|
1953
|
-
|
2661
|
+
_context4.next = 4;
|
1954
2662
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
1955
2663
|
|
1956
2664
|
case 4:
|
@@ -1960,23 +2668,23 @@ function _synthetixTakeOrder() {
|
|
1960
2668
|
outgoingAsset: outgoingAsset,
|
1961
2669
|
outgoingAssetAmount: outgoingAssetAmount
|
1962
2670
|
});
|
1963
|
-
|
2671
|
+
_context4.next = 7;
|
1964
2672
|
return callOnIntegrationArgs({
|
1965
2673
|
adapter: synthetixAdapter,
|
1966
|
-
|
1967
|
-
|
2674
|
+
encodedCallArgs: takeOrderArgs,
|
2675
|
+
selector: takeOrderSelector
|
1968
2676
|
});
|
1969
2677
|
|
1970
2678
|
case 7:
|
1971
|
-
callArgs =
|
1972
|
-
return
|
2679
|
+
callArgs = _context4.sent;
|
2680
|
+
return _context4.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1973
2681
|
|
1974
2682
|
case 9:
|
1975
2683
|
case "end":
|
1976
|
-
return
|
2684
|
+
return _context4.stop();
|
1977
2685
|
}
|
1978
2686
|
}
|
1979
|
-
},
|
2687
|
+
}, _callee4);
|
1980
2688
|
}));
|
1981
2689
|
return _synthetixTakeOrder.apply(this, arguments);
|
1982
2690
|
}
|
@@ -1989,13 +2697,13 @@ function uniswapV2Lend(_x) {
|
|
1989
2697
|
|
1990
2698
|
function _uniswapV2Lend() {
|
1991
2699
|
_uniswapV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
1992
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
2700
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, minPoolTokenAmount, _ref$seedFund, seedFund, lendArgs, callArgs, lendTx;
|
1993
2701
|
|
1994
2702
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
1995
2703
|
while (1) {
|
1996
2704
|
switch (_context.prev = _context.next) {
|
1997
2705
|
case 0:
|
1998
|
-
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner,
|
2706
|
+
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV2LiquidityAdapter = _ref.uniswapV2LiquidityAdapter, tokenA = _ref.tokenA, tokenB = _ref.tokenB, amountADesired = _ref.amountADesired, amountBDesired = _ref.amountBDesired, amountAMin = _ref.amountAMin, amountBMin = _ref.amountBMin, minPoolTokenAmount = _ref.minPoolTokenAmount, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
1999
2707
|
|
2000
2708
|
if (!seedFund) {
|
2001
2709
|
_context.next = 6;
|
@@ -2011,18 +2719,18 @@ function _uniswapV2Lend() {
|
|
2011
2719
|
|
2012
2720
|
case 6:
|
2013
2721
|
lendArgs = uniswapV2LendArgs({
|
2014
|
-
tokenA: tokenA,
|
2015
|
-
tokenB: tokenB,
|
2016
2722
|
amountADesired: amountADesired,
|
2017
|
-
amountBDesired: amountBDesired,
|
2018
2723
|
amountAMin: amountAMin,
|
2724
|
+
amountBDesired: amountBDesired,
|
2019
2725
|
amountBMin: amountBMin,
|
2020
|
-
minPoolTokenAmount: minPoolTokenAmount
|
2726
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
2727
|
+
tokenA: tokenA,
|
2728
|
+
tokenB: tokenB
|
2021
2729
|
});
|
2022
2730
|
callArgs = callOnIntegrationArgs({
|
2023
|
-
adapter:
|
2024
|
-
|
2025
|
-
|
2731
|
+
adapter: uniswapV2LiquidityAdapter,
|
2732
|
+
encodedCallArgs: lendArgs,
|
2733
|
+
selector: lendSelector
|
2026
2734
|
});
|
2027
2735
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2028
2736
|
_context.next = 11;
|
@@ -2047,23 +2755,23 @@ function uniswapV2Redeem(_x2) {
|
|
2047
2755
|
|
2048
2756
|
function _uniswapV2Redeem() {
|
2049
2757
|
_uniswapV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
2050
|
-
var comptrollerProxy, integrationManager, fundOwner,
|
2758
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, poolTokenAmount, tokenA, tokenB, amountAMin, amountBMin, redeemArgs, callArgs, redeemTx;
|
2051
2759
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2052
2760
|
while (1) {
|
2053
2761
|
switch (_context2.prev = _context2.next) {
|
2054
2762
|
case 0:
|
2055
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner,
|
2763
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, uniswapV2LiquidityAdapter = _ref2.uniswapV2LiquidityAdapter, poolTokenAmount = _ref2.poolTokenAmount, tokenA = _ref2.tokenA, tokenB = _ref2.tokenB, amountAMin = _ref2.amountAMin, amountBMin = _ref2.amountBMin;
|
2056
2764
|
redeemArgs = uniswapV2RedeemArgs({
|
2765
|
+
amountAMin: amountAMin,
|
2766
|
+
amountBMin: amountBMin,
|
2057
2767
|
poolTokenAmount: poolTokenAmount,
|
2058
2768
|
tokenA: tokenA,
|
2059
|
-
tokenB: tokenB
|
2060
|
-
amountAMin: amountAMin,
|
2061
|
-
amountBMin: amountBMin
|
2769
|
+
tokenB: tokenB
|
2062
2770
|
});
|
2063
2771
|
callArgs = callOnIntegrationArgs({
|
2064
|
-
adapter:
|
2065
|
-
|
2066
|
-
|
2772
|
+
adapter: uniswapV2LiquidityAdapter,
|
2773
|
+
encodedCallArgs: redeemArgs,
|
2774
|
+
selector: redeemSelector
|
2067
2775
|
});
|
2068
2776
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2069
2777
|
_context2.next = 6;
|
@@ -2088,13 +2796,13 @@ function uniswapV2TakeOrder(_x3) {
|
|
2088
2796
|
|
2089
2797
|
function _uniswapV2TakeOrder() {
|
2090
2798
|
_uniswapV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2091
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
2799
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2ExchangeAdapter, path, outgoingAssetAmount, minIncomingAssetAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
2092
2800
|
|
2093
2801
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2094
2802
|
while (1) {
|
2095
2803
|
switch (_context3.prev = _context3.next) {
|
2096
2804
|
case 0:
|
2097
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner,
|
2805
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, uniswapV2ExchangeAdapter = _ref3.uniswapV2ExchangeAdapter, path = _ref3.path, outgoingAssetAmount = _ref3.outgoingAssetAmount, minIncomingAssetAmount = _ref3.minIncomingAssetAmount, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
2098
2806
|
|
2099
2807
|
if (!seedFund) {
|
2100
2808
|
_context3.next = 4;
|
@@ -2106,14 +2814,14 @@ function _uniswapV2TakeOrder() {
|
|
2106
2814
|
|
2107
2815
|
case 4:
|
2108
2816
|
takeOrderArgs = uniswapV2TakeOrderArgs({
|
2109
|
-
|
2817
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2110
2818
|
outgoingAssetAmount: outgoingAssetAmount,
|
2111
|
-
|
2819
|
+
path: path
|
2112
2820
|
});
|
2113
2821
|
callArgs = callOnIntegrationArgs({
|
2114
|
-
adapter:
|
2115
|
-
|
2116
|
-
|
2822
|
+
adapter: uniswapV2ExchangeAdapter,
|
2823
|
+
encodedCallArgs: takeOrderArgs,
|
2824
|
+
selector: takeOrderSelector
|
2117
2825
|
});
|
2118
2826
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2119
2827
|
|
@@ -2133,7 +2841,7 @@ function uniswapV3TakeOrder(_x) {
|
|
2133
2841
|
|
2134
2842
|
function _uniswapV3TakeOrder() {
|
2135
2843
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
2136
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
2844
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
2137
2845
|
|
2138
2846
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
2139
2847
|
while (1) {
|
@@ -2142,35 +2850,33 @@ function _uniswapV3TakeOrder() {
|
|
2142
2850
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV3Adapter = _ref.uniswapV3Adapter, pathAddresses = _ref.pathAddresses, pathFees = _ref.pathFees, outgoingAssetAmount = _ref.outgoingAssetAmount, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? 1 : _ref$minIncomingAsset, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
2143
2851
|
|
2144
2852
|
if (!seedFund) {
|
2145
|
-
_context.next =
|
2853
|
+
_context.next = 7;
|
2146
2854
|
break;
|
2147
2855
|
}
|
2148
2856
|
|
2149
|
-
_context.
|
2150
|
-
_context.next = 5;
|
2857
|
+
_context.next = 4;
|
2151
2858
|
return comptrollerProxy.getVaultProxy();
|
2152
2859
|
|
2153
|
-
case
|
2154
|
-
|
2155
|
-
_context.
|
2156
|
-
|
2157
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
2860
|
+
case 4:
|
2861
|
+
vaultProxy = _context.sent;
|
2862
|
+
_context.next = 7;
|
2863
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
2158
2864
|
|
2159
|
-
case
|
2865
|
+
case 7:
|
2160
2866
|
takeOrderArgs = uniswapV3TakeOrderArgs({
|
2161
|
-
|
2162
|
-
pathFees: pathFees,
|
2867
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2163
2868
|
outgoingAssetAmount: outgoingAssetAmount,
|
2164
|
-
|
2869
|
+
pathAddresses: pathAddresses,
|
2870
|
+
pathFees: pathFees
|
2165
2871
|
});
|
2166
2872
|
callArgs = callOnIntegrationArgs({
|
2167
2873
|
adapter: uniswapV3Adapter,
|
2168
|
-
|
2169
|
-
|
2874
|
+
encodedCallArgs: takeOrderArgs,
|
2875
|
+
selector: takeOrderSelector
|
2170
2876
|
});
|
2171
2877
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2172
2878
|
|
2173
|
-
case
|
2879
|
+
case 10:
|
2174
2880
|
case "end":
|
2175
2881
|
return _context.stop();
|
2176
2882
|
}
|
@@ -2195,12 +2901,12 @@ function _yearnVaultV2Lend() {
|
|
2195
2901
|
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, yearnVaultV2Adapter = _ref.yearnVaultV2Adapter, yVault = _ref.yVault, outgoingUnderlyingAmount = _ref.outgoingUnderlyingAmount, _ref$minIncomingYVaul = _ref.minIncomingYVaultSharesAmount, minIncomingYVaultSharesAmount = _ref$minIncomingYVaul === void 0 ? BigNumber.from(1) : _ref$minIncomingYVaul;
|
2196
2902
|
callArgs = callOnIntegrationArgs({
|
2197
2903
|
adapter: yearnVaultV2Adapter,
|
2198
|
-
selector: lendSelector,
|
2199
2904
|
encodedCallArgs: yearnVaultV2LendArgs({
|
2200
|
-
|
2905
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
2201
2906
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
2202
|
-
|
2203
|
-
})
|
2907
|
+
yVault: yVault
|
2908
|
+
}),
|
2909
|
+
selector: lendSelector
|
2204
2910
|
});
|
2205
2911
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2206
2912
|
|
@@ -2229,13 +2935,13 @@ function _yearnVaultV2Redeem() {
|
|
2229
2935
|
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, yearnVaultV2Adapter = _ref2.yearnVaultV2Adapter, yVault = _ref2.yVault, maxOutgoingYVaultSharesAmount = _ref2.maxOutgoingYVaultSharesAmount, _ref2$minIncomingUnde = _ref2.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref2$minIncomingUnde === void 0 ? BigNumber.from(1) : _ref2$minIncomingUnde, _ref2$slippageToleran = _ref2.slippageToleranceBps, slippageToleranceBps = _ref2$slippageToleran === void 0 ? 1 : _ref2$slippageToleran;
|
2230
2936
|
callArgs = callOnIntegrationArgs({
|
2231
2937
|
adapter: yearnVaultV2Adapter,
|
2232
|
-
selector: redeemSelector,
|
2233
2938
|
encodedCallArgs: yearnVaultV2RedeemArgs({
|
2234
|
-
yVault: yVault,
|
2235
2939
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
2236
2940
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2237
|
-
slippageToleranceBps: slippageToleranceBps
|
2238
|
-
|
2941
|
+
slippageToleranceBps: slippageToleranceBps,
|
2942
|
+
yVault: yVault
|
2943
|
+
}),
|
2944
|
+
selector: redeemSelector
|
2239
2945
|
});
|
2240
2946
|
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2241
2947
|
|
@@ -2267,8 +2973,8 @@ function _zeroExV2TakeOrder() {
|
|
2267
2973
|
});
|
2268
2974
|
callArgs = callOnIntegrationArgs({
|
2269
2975
|
adapter: zeroExV2Adapter,
|
2270
|
-
|
2271
|
-
|
2976
|
+
encodedCallArgs: takeOrderArgs,
|
2977
|
+
selector: takeOrderSelector
|
2272
2978
|
});
|
2273
2979
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2274
2980
|
|
@@ -2411,7 +3117,8 @@ function assertEvent(receipt, event, match) {
|
|
2411
3117
|
var events = extractEvent(receipt, event);
|
2412
3118
|
expect(events.length).toBe(1);
|
2413
3119
|
expect(receipt).toHaveEmittedWith(event, match);
|
2414
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
3120
|
+
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
3121
|
+
|
2415
3122
|
return args;
|
2416
3123
|
}
|
2417
3124
|
function assertNoEvent(receipt, event) {
|
@@ -2572,6 +3279,7 @@ function _createComptrollerProxy() {
|
|
2572
3279
|
comptrollerProxyContract = _context.sent;
|
2573
3280
|
return _context.abrupt("return", {
|
2574
3281
|
comptrollerProxy: new ComptrollerLib(comptrollerProxyContract, signer),
|
3282
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
2575
3283
|
receipt: comptrollerProxyContract.deployment
|
2576
3284
|
});
|
2577
3285
|
|
@@ -2604,16 +3312,14 @@ function _createMigrationRequest() {
|
|
2604
3312
|
case 3:
|
2605
3313
|
receipt = _context2.sent;
|
2606
3314
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2607
|
-
creator: signer,
|
2608
3315
|
comptrollerProxy: expect.any(String),
|
3316
|
+
creator: signer,
|
2609
3317
|
denominationAsset: denominationAsset,
|
2610
|
-
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2611
|
-
feeManagerConfigData: utils.hexlify(feeManagerConfigData),
|
2612
|
-
policyManagerConfigData: utils.hexlify(policyManagerConfigData)
|
3318
|
+
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2613
3319
|
});
|
2614
3320
|
return _context2.abrupt("return", {
|
2615
|
-
|
2616
|
-
|
3321
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3322
|
+
receipt: receipt
|
2617
3323
|
});
|
2618
3324
|
|
2619
3325
|
case 6:
|
@@ -2632,31 +3338,29 @@ function createNewFund(_x3) {
|
|
2632
3338
|
|
2633
3339
|
function _createNewFund() {
|
2634
3340
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
2635
|
-
var signer, fundDeployer, denominationAsset, _ref3$sharesActionTim, sharesActionTimelock, _ref3$fundOwner, fundOwner, _ref3$fundName, fundName, _ref3$feeManagerConfi, feeManagerConfig, _ref3$policyManagerCo, policyManagerConfig, investment, receipt, comptrollerDeployedArgs, comptrollerProxy, newFundDeployedArgs, vaultProxy;
|
3341
|
+
var signer, fundDeployer, denominationAsset, _ref3$sharesActionTim, sharesActionTimelock, _ref3$fundOwner, fundOwner, _ref3$fundName, fundName, _ref3$fundSymbol, fundSymbol, _ref3$feeManagerConfi, feeManagerConfig, _ref3$policyManagerCo, policyManagerConfig, investment, receipt, comptrollerDeployedArgs, comptrollerProxy, newFundDeployedArgs, vaultProxy;
|
2636
3342
|
|
2637
3343
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2638
3344
|
while (1) {
|
2639
3345
|
switch (_context3.prev = _context3.next) {
|
2640
3346
|
case 0:
|
2641
|
-
signer = _ref3.signer, fundDeployer = _ref3.fundDeployer, denominationAsset = _ref3.denominationAsset, _ref3$sharesActionTim = _ref3.sharesActionTimelock, sharesActionTimelock = _ref3$sharesActionTim === void 0 ? 0 : _ref3$sharesActionTim, _ref3$fundOwner = _ref3.fundOwner, fundOwner = _ref3$fundOwner === void 0 ? randomAddress() : _ref3$fundOwner, _ref3$fundName = _ref3.fundName, fundName = _ref3$fundName === void 0 ? 'My Fund' : _ref3$fundName, _ref3$feeManagerConfi = _ref3.feeManagerConfig, feeManagerConfig = _ref3$feeManagerConfi === void 0 ? '0x' : _ref3$feeManagerConfi, _ref3$policyManagerCo = _ref3.policyManagerConfig, policyManagerConfig = _ref3$policyManagerCo === void 0 ? '0x' : _ref3$policyManagerCo, investment = _ref3.investment;
|
3347
|
+
signer = _ref3.signer, fundDeployer = _ref3.fundDeployer, denominationAsset = _ref3.denominationAsset, _ref3$sharesActionTim = _ref3.sharesActionTimelock, sharesActionTimelock = _ref3$sharesActionTim === void 0 ? 0 : _ref3$sharesActionTim, _ref3$fundOwner = _ref3.fundOwner, fundOwner = _ref3$fundOwner === void 0 ? randomAddress() : _ref3$fundOwner, _ref3$fundName = _ref3.fundName, fundName = _ref3$fundName === void 0 ? 'My Fund' : _ref3$fundName, _ref3$fundSymbol = _ref3.fundSymbol, fundSymbol = _ref3$fundSymbol === void 0 ? '' : _ref3$fundSymbol, _ref3$feeManagerConfi = _ref3.feeManagerConfig, feeManagerConfig = _ref3$feeManagerConfi === void 0 ? '0x' : _ref3$feeManagerConfi, _ref3$policyManagerCo = _ref3.policyManagerConfig, policyManagerConfig = _ref3$policyManagerCo === void 0 ? '0x' : _ref3$policyManagerCo, investment = _ref3.investment;
|
2642
3348
|
_context3.next = 3;
|
2643
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
3349
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
2644
3350
|
|
2645
3351
|
case 3:
|
2646
3352
|
receipt = _context3.sent;
|
2647
3353
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2648
|
-
creator: signer,
|
2649
3354
|
comptrollerProxy: expect.any(String),
|
3355
|
+
creator: signer,
|
2650
3356
|
denominationAsset: denominationAsset,
|
2651
|
-
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2652
|
-
feeManagerConfigData: utils.hexlify(feeManagerConfig),
|
2653
|
-
policyManagerConfigData: utils.hexlify(policyManagerConfig)
|
3357
|
+
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2654
3358
|
});
|
2655
3359
|
comptrollerProxy = new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
2656
3360
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
3361
|
+
comptrollerProxy: comptrollerProxy,
|
2657
3362
|
creator: signer,
|
2658
|
-
vaultProxy: expect.any(String)
|
2659
|
-
comptrollerProxy: comptrollerProxy
|
3363
|
+
vaultProxy: expect.any(String)
|
2660
3364
|
});
|
2661
3365
|
vaultProxy = new VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
2662
3366
|
|
@@ -2707,16 +3411,14 @@ function _createReconfigurationRequest() {
|
|
2707
3411
|
case 3:
|
2708
3412
|
receipt = _context4.sent;
|
2709
3413
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2710
|
-
creator: signer,
|
2711
3414
|
comptrollerProxy: expect.any(String),
|
3415
|
+
creator: signer,
|
2712
3416
|
denominationAsset: denominationAsset,
|
2713
|
-
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2714
|
-
feeManagerConfigData: utils.hexlify(feeManagerConfigData),
|
2715
|
-
policyManagerConfigData: utils.hexlify(policyManagerConfigData)
|
3417
|
+
sharesActionTimelock: BigNumber.from(sharesActionTimelock)
|
2716
3418
|
});
|
2717
3419
|
return _context4.abrupt("return", {
|
2718
|
-
|
2719
|
-
|
3420
|
+
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3421
|
+
receipt: receipt
|
2720
3422
|
});
|
2721
3423
|
|
2722
3424
|
case 6:
|
@@ -2798,16 +3500,49 @@ function _setupGasRelayerPaymaster() {
|
|
2798
3500
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
2799
3501
|
}
|
2800
3502
|
|
2801
|
-
function
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
3503
|
+
function vaultCallCreateNewList(_x) {
|
3504
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
3505
|
+
}
|
3506
|
+
|
3507
|
+
function _vaultCallCreateNewList() {
|
3508
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
3509
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
3510
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
3511
|
+
while (1) {
|
3512
|
+
switch (_context.prev = _context.next) {
|
3513
|
+
case 0:
|
3514
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
3515
|
+
_context.next = 3;
|
3516
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, addressListRegistryCreateListSelector, encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
3517
|
+
|
3518
|
+
case 3:
|
3519
|
+
_context.next = 5;
|
3520
|
+
return addressListRegistry.getListCount();
|
3521
|
+
|
3522
|
+
case 5:
|
3523
|
+
listCount = _context.sent;
|
3524
|
+
return _context.abrupt("return", listCount.sub(1));
|
3525
|
+
|
3526
|
+
case 7:
|
3527
|
+
case "end":
|
3528
|
+
return _context.stop();
|
3529
|
+
}
|
3530
|
+
}
|
3531
|
+
}, _callee);
|
3532
|
+
}));
|
3533
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
2806
3534
|
}
|
2807
|
-
|
3535
|
+
|
3536
|
+
function vaultCallCurveMinterMint(_ref2) {
|
2808
3537
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
2809
3538
|
minter = _ref2.minter,
|
2810
|
-
|
3539
|
+
gauge = _ref2.gauge;
|
3540
|
+
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintSelector, encodeArgs(['address'], [gauge]));
|
3541
|
+
}
|
3542
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
3543
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
3544
|
+
minter = _ref3.minter,
|
3545
|
+
gauges = _ref3.gauges;
|
2811
3546
|
var gaugesFormatted = new Array(8).fill(constants.AddressZero);
|
2812
3547
|
|
2813
3548
|
for (var i in gauges) {
|
@@ -2816,12 +3551,18 @@ function vaultCallCurveMinterMintMany(_ref2) {
|
|
2816
3551
|
|
2817
3552
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterMintManySelector, encodeArgs(['address[8]'], [gaugesFormatted]));
|
2818
3553
|
}
|
2819
|
-
function vaultCallCurveMinterToggleApproveMint(
|
2820
|
-
var comptrollerProxy =
|
2821
|
-
minter =
|
2822
|
-
account =
|
3554
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
3555
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
3556
|
+
minter = _ref4.minter,
|
3557
|
+
account = _ref4.account;
|
2823
3558
|
return comptrollerProxy.vaultCallOnContract(minter, curveMinterToggleApproveMintSelector, encodeArgs(['address'], [account]));
|
2824
3559
|
}
|
3560
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
3561
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
3562
|
+
contract = _ref5.contract,
|
3563
|
+
asset = _ref5.asset;
|
3564
|
+
return comptrollerProxy.vaultCallOnContract(contract, sighash(utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), encodeArgs(['address'], [asset]));
|
3565
|
+
}
|
2825
3566
|
|
2826
3567
|
function transactionTimestamp(_x) {
|
2827
3568
|
return _transactionTimestamp.apply(this, arguments);
|
@@ -2875,8 +3616,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2875
3616
|
// 50% discount
|
2876
3617
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
2877
3618
|
return _context2.abrupt("return", {
|
2878
|
-
|
2879
|
-
|
3619
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
3620
|
+
mlnValue: mlnValueOfBuyback
|
2880
3621
|
});
|
2881
3622
|
|
2882
3623
|
case 8:
|
@@ -2892,43 +3633,51 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2892
3633
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2893
3634
|
|
2894
3635
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
3636
|
+
|
3637
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
2895
3638
|
var whales = {
|
2896
|
-
|
2897
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
2898
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3639
|
+
// primitives
|
2899
3640
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
2900
3641
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
2901
|
-
bnt: '
|
2902
|
-
|
3642
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
3643
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3644
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
2903
3645
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
2904
|
-
dai: '
|
2905
|
-
knc: '
|
2906
|
-
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3646
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3647
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
2907
3648
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
2908
3649
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
2909
3650
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
2910
3651
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
2911
3652
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
3653
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
2912
3654
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
2913
3655
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
2914
3656
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
2915
3657
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
2916
3658
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
2917
|
-
|
3659
|
+
// aTokens
|
3660
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3661
|
+
// cTokens
|
2918
3662
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
2919
|
-
cdai: '
|
3663
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
2920
3664
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
2921
|
-
|
2922
|
-
cuni: '0x8889ff5b6323e71c28c26d2c34b8bb52654f00a6',
|
3665
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
2923
3666
|
cusdc: '0xb3bd459e0598dde1fe84b1d0a1430be175b5d5be',
|
2924
|
-
|
3667
|
+
// ptTokens
|
3668
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
3669
|
+
// synths
|
2925
3670
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
2926
|
-
seur: '
|
2927
|
-
|
3671
|
+
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
3672
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
3673
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
3674
|
+
// misc
|
2928
3675
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
2929
|
-
|
2930
|
-
|
3676
|
+
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3677
|
+
eurs: '0x98ed26de6451db36246672df78ae7c50f2c76f6d'
|
2931
3678
|
};
|
3679
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
3680
|
+
|
2932
3681
|
function unlockWhale(_x) {
|
2933
3682
|
return _unlockWhale.apply(this, arguments);
|
2934
3683
|
}
|
@@ -3100,8 +3849,8 @@ function _relayTransaction() {
|
|
3100
3849
|
defaultMaxAcceptance = BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
3101
3850
|
|
3102
3851
|
mergedRelayRequest = {
|
3103
|
-
|
3104
|
-
|
3852
|
+
relayData: relayData,
|
3853
|
+
request: relayRequest
|
3105
3854
|
};
|
3106
3855
|
relayHub = new IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
3107
3856
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
@@ -3120,14 +3869,14 @@ var relayed = utils.EventFragment.fromString('TransactionRelayed(address indexed
|
|
3120
3869
|
var rejected = utils.EventFragment.fromString('TransactionRejectedByPaymaster(address indexed relayManager, address indexed paymaster, address indexed from, address to, address relayWorker, bytes4 selector, uint256 innerGasUsed, bytes reason)');
|
3121
3870
|
function assertDidRelay(receipt) {
|
3122
3871
|
return assertEvent(receipt, relayed, {
|
3123
|
-
|
3124
|
-
relayWorker: expect.any(String),
|
3872
|
+
charge: expect.anything(),
|
3125
3873
|
from: expect.any(String),
|
3126
|
-
to: expect.any(String),
|
3127
3874
|
paymaster: expect.any(String),
|
3875
|
+
relayManager: expect.any(String),
|
3876
|
+
relayWorker: expect.any(String),
|
3128
3877
|
selector: expect.any(String),
|
3129
3878
|
status: expect.anything(),
|
3130
|
-
|
3879
|
+
to: expect.any(String)
|
3131
3880
|
});
|
3132
3881
|
}
|
3133
3882
|
function assertDidRelaySuccessfully(receipt) {
|
@@ -3144,14 +3893,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
3144
3893
|
}
|
3145
3894
|
function assertPaymasterDidReject(receipt) {
|
3146
3895
|
return assertEvent(receipt, rejected, {
|
3147
|
-
relayManager: expect.any(String),
|
3148
|
-
paymaster: expect.any(String),
|
3149
3896
|
from: expect.any(String),
|
3150
|
-
|
3897
|
+
innerGasUsed: expect.anything(),
|
3898
|
+
paymaster: expect.any(String),
|
3899
|
+
reason: expect.any(String),
|
3900
|
+
relayManager: expect.any(String),
|
3151
3901
|
relayWorker: expect.any(String),
|
3152
3902
|
selector: expect.any(String),
|
3153
|
-
|
3154
|
-
reason: expect.any(String)
|
3903
|
+
to: expect.any(String)
|
3155
3904
|
});
|
3156
3905
|
}
|
3157
3906
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
@@ -3159,4 +3908,4 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
3159
3908
|
expect(utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
3160
3909
|
}
|
3161
3910
|
|
3162
|
-
export { CurveLiquidityGaugeV2, CurveMinter, CurveSwaps, ICompoundComptroller, UniswapV2Factory, aaveLend, aaveRedeem,
|
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, curveAaveClaimRewards, curveAaveLend, curveAaveLendAndStake, curveAaveRedeem, curveAaveStake, curveAaveUnstake, curveAaveUnstakeAndRedeem, curveEursClaimRewards, curveEursLend, curveEursLendAndStake, curveEursRedeem, curveEursStake, curveEursUnstake, curveEursUnstakeAndRedeem, curveSethClaimRewards, curveSethLend, curveSethLendAndStake, curveSethRedeem, curveSethStake, curveSethUnstake, curveSethUnstakeAndRedeem, curveStethClaimRewards, curveStethLend, curveStethLendAndStake, curveStethRedeem, curveStethStake, curveStethUnstake, curveStethUnstakeAndRedeem, curveTakeOrder, deployProtocolFixture, generateFeeManagerConfigWithMockFees, generateMockFees, generateMockPolicies, generatePolicyManagerConfigWithMockPolicies, getAssetBalances, getAssetUnit, getNamedSigner, getUnnamedSigners, idleClaimRewards, idleLend, idleRedeem, mockExternalPositionAddDebtAssets, mockExternalPositionAddManagedAssets, mockExternalPositionRemoveDebtAssets, mockExternalPositionRemoveManagedAssets, mockGenericRemoveOnlySelector, mockGenericSwap, mockGenericSwapASelector, mockGenericSwapArgs, mockGenericSwapBSelector, mockGenericSwapDirectFromVaultSelector, mockGenericSwapViaApprovalSelector, paraSwapV4GenerateDummyPaths, paraSwapV4TakeOrder, paraSwapV5GenerateDummyPaths, paraSwapV5TakeOrder, poolTogetherV4ClaimRewards, poolTogetherV4Lend, poolTogetherV4Redeem, reactivateExternalPosition, redeemSharesForSpecificAssets, redeemSharesInKind, relayTransaction, removeExternalPosition, removeTrackedAssetsFromVault, setupGasRelayerPaymaster, synthetixAssignExchangeDelegate, synthetixRedeem, synthetixResolveAddress, synthetixTakeOrder, transactionTimestamp, uniswapV2Lend, uniswapV2Redeem, uniswapV2TakeOrder, uniswapV3LiquidityPositionAddLiquidity, uniswapV3LiquidityPositionCollect, uniswapV3LiquidityPositionGetMaxTick, uniswapV3LiquidityPositionGetMinTick, uniswapV3LiquidityPositionMint, uniswapV3LiquidityPositionPurge, uniswapV3LiquidityPositionRemoveLiquidity, uniswapV3OrderTokenPair, uniswapV3TakeOrder, unlockAllWhales, unlockWhale, unlockWhales, updateChainlinkAggregator, vaultCallCreateNewList, vaultCallCurveMinterMint, vaultCallCurveMinterMintMany, vaultCallCurveMinterToggleApproveMint, vaultCallStartAssetBypassTimelock, yearnVaultV2Lend, yearnVaultV2Redeem, zeroExV2TakeOrder };
|