@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
@@ -4,11 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
6
6
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
7
|
-
var protocol
|
7
|
+
var protocol = require('@enzymefinance/protocol');
|
8
8
|
var ethers = require('ethers');
|
9
|
-
var src = require('@enzymefinance/protocol/src');
|
10
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
11
9
|
var ethers$1 = require('@enzymefinance/ethers');
|
10
|
+
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
12
11
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
13
12
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
14
13
|
|
@@ -112,68 +111,81 @@ function _deployProtocolFixture() {
|
|
112
111
|
config = fixture['Config'].linkedData; // prettier-ignore
|
113
112
|
|
114
113
|
deployment = {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
managementFee: new protocol
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
protocolFeeReserveLib: new protocol
|
168
|
-
protocolFeeReserveProxy: new protocol
|
169
|
-
protocolFeeTracker: new protocol
|
170
|
-
|
114
|
+
aaveAdapter: new protocol.AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
115
|
+
aavePriceFeed: new protocol.AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
116
|
+
addressListRegistry: new protocol.AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
117
|
+
allowedAdapterIncomingAssetsPolicy: new protocol.AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
118
|
+
allowedAdaptersPolicy: new protocol.AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
119
|
+
allowedAssetsForRedemptionPolicy: new protocol.AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
120
|
+
allowedDepositRecipientsPolicy: new protocol.AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
121
|
+
allowedExternalPositionTypesPolicy: new protocol.AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
122
|
+
allowedSharesTransferRecipientsPolicy: new protocol.AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
123
|
+
assetFinalityResolver: new protocol.AssetFinalityResolver(fixture['AssetFinalityResolver'].address, deployer),
|
124
|
+
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
125
|
+
compoundDebtPositionLib: new protocol.CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
126
|
+
compoundDebtPositionParser: new protocol.CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
127
|
+
compoundPriceFeed: new protocol.CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
128
|
+
comptrollerLib: new protocol.ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
129
|
+
cumulativeSlippageTolerancePolicy: new protocol.CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
130
|
+
curveExchangeAdapter: new protocol.CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
131
|
+
curveLiquidityAaveAdapter: new protocol.CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
132
|
+
curveLiquidityEursAdapter: new protocol.CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
133
|
+
curveLiquiditySethAdapter: new protocol.CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
134
|
+
curveLiquidityStethAdapter: new protocol.CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
135
|
+
curvePriceFeed: new protocol.CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
136
|
+
depositWrapper: new protocol.DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
137
|
+
dispatcher: new protocol.Dispatcher(fixture['Dispatcher'].address, deployer),
|
138
|
+
entranceRateBurnFee: new protocol.EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
139
|
+
entranceRateDirectFee: new protocol.EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
140
|
+
exitRateBurnFee: new protocol.ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
141
|
+
exitRateDirectFee: new protocol.ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
142
|
+
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
143
|
+
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
144
|
+
feeManager: new protocol.FeeManager(fixture['FeeManager'].address, deployer),
|
145
|
+
fundDeployer: new protocol.FundDeployer(fixture['FundDeployer'].address, deployer),
|
146
|
+
fundValueCalculator: new protocol.FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
147
|
+
fundValueCalculatorRouter: new protocol.FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
148
|
+
fundValueCalculatorUsdWrapper: new protocol.FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
149
|
+
gasRelayPaymasterFactory: new protocol.GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
150
|
+
guaranteedRedemptionPolicy: new protocol.GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
151
|
+
idleAdapter: new protocol.IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
152
|
+
idlePriceFeed: new protocol.IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
153
|
+
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
154
|
+
lidoStethPriceFeed: new protocol.LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
155
|
+
managementFee: new protocol.ManagementFee(fixture['ManagementFee'].address, deployer),
|
156
|
+
minAssetBalancesPostRedemptionPolicy: new protocol.MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
157
|
+
minMaxInvestmentPolicy: new protocol.MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
158
|
+
onlyRemoveDustExternalPositionPolicy: new protocol.OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
159
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new protocol.OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
160
|
+
paraSwapV4Adapter: new protocol.ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
161
|
+
paraSwapV5Adapter: new protocol.ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
162
|
+
performanceFee: new protocol.PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
163
|
+
policyManager: new protocol.PolicyManager(fixture['PolicyManager'].address, deployer),
|
164
|
+
poolTogetherV4Adapter: new protocol.PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
165
|
+
poolTogetherV4PriceFeed: new protocol.PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
166
|
+
protocolFeeReserveLib: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
167
|
+
protocolFeeReserveProxy: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
168
|
+
protocolFeeTracker: new protocol.ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
169
|
+
revertingPriceFeed: new protocol.RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
170
|
+
stakehoundEthPriceFeed: new protocol.StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
171
|
+
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
172
|
+
synthetixPriceFeed: new protocol.SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
173
|
+
uniswapV2ExchangeAdapter: new protocol.UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
174
|
+
uniswapV2LiquidityAdapter: new protocol.UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
175
|
+
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
176
|
+
uniswapV3Adapter: new protocol.UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
177
|
+
unpermissionedActionsWrapper: new protocol.UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
178
|
+
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
179
|
+
vaultLib: new protocol.VaultLib(fixture['VaultLib'].address, deployer),
|
180
|
+
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
181
|
+
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
182
|
+
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
171
183
|
};
|
172
184
|
return _context3.abrupt("return", {
|
173
|
-
deployer: deployer,
|
174
|
-
deployment: deployment,
|
175
185
|
accounts: accounts,
|
176
|
-
config: config
|
186
|
+
config: config,
|
187
|
+
deployer: deployer,
|
188
|
+
deployment: deployment
|
177
189
|
});
|
178
190
|
|
179
191
|
case 12:
|
@@ -186,36 +198,12 @@ function _deployProtocolFixture() {
|
|
186
198
|
return _deployProtocolFixture.apply(this, arguments);
|
187
199
|
}
|
188
200
|
|
189
|
-
// TODO: Remove this.
|
190
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
191
|
-
function defaultTestDeployment(_x2) {
|
192
|
-
return _defaultTestDeployment.apply(this, arguments);
|
193
|
-
}
|
194
|
-
|
195
|
-
function _defaultTestDeployment() {
|
196
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_) {
|
197
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
198
|
-
while (1) {
|
199
|
-
switch (_context4.prev = _context4.next) {
|
200
|
-
case 0:
|
201
|
-
throw new Error('Removed');
|
202
|
-
|
203
|
-
case 1:
|
204
|
-
case "end":
|
205
|
-
return _context4.stop();
|
206
|
-
}
|
207
|
-
}
|
208
|
-
}, _callee4);
|
209
|
-
}));
|
210
|
-
return _defaultTestDeployment.apply(this, arguments);
|
211
|
-
}
|
212
|
-
|
213
201
|
function addTrackedAssetsToVault(_ref) {
|
214
202
|
var signer = _ref.signer,
|
215
203
|
comptrollerProxy = _ref.comptrollerProxy,
|
216
204
|
integrationManager = _ref.integrationManager,
|
217
205
|
assets = _ref.assets;
|
218
|
-
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol
|
206
|
+
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.AddTrackedAssetsToVault, protocol.addTrackedAssetsToVaultArgs({
|
219
207
|
assets: assets
|
220
208
|
}));
|
221
209
|
}
|
@@ -224,7 +212,7 @@ function removeTrackedAssetsFromVault(_ref2) {
|
|
224
212
|
comptrollerProxy = _ref2.comptrollerProxy,
|
225
213
|
integrationManager = _ref2.integrationManager,
|
226
214
|
assets = _ref2.assets;
|
227
|
-
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol
|
215
|
+
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.RemoveTrackedAssetsFromVault, protocol.removeTrackedAssetsFromVaultArgs({
|
228
216
|
assets: assets
|
229
217
|
}));
|
230
218
|
}
|
@@ -244,10 +232,10 @@ function _addNewAssetsToFund() {
|
|
244
232
|
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;
|
245
233
|
// First, add tracked assets while their balances are 0
|
246
234
|
receipt = addTrackedAssetsToVault({
|
247
|
-
|
235
|
+
assets: assets,
|
248
236
|
comptrollerProxy: comptrollerProxy,
|
249
237
|
integrationManager: integrationManager,
|
250
|
-
|
238
|
+
signer: signer
|
251
239
|
}); // Then seed the vault with balances as necessary
|
252
240
|
|
253
241
|
_context.next = 4;
|
@@ -350,7 +338,7 @@ function _getAssetBalances() {
|
|
350
338
|
case 0:
|
351
339
|
account = _ref.account, assets = _ref.assets;
|
352
340
|
return _context.abrupt("return", Promise.all(assets.map(function (asset) {
|
353
|
-
return new protocol
|
341
|
+
return new protocol.StandardToken(asset, provider).balanceOf(account);
|
354
342
|
})));
|
355
343
|
|
356
344
|
case 2:
|
@@ -399,13 +387,13 @@ function createFundDeployer(_x) {
|
|
399
387
|
|
400
388
|
function _createFundDeployer() {
|
401
389
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
402
|
-
var deployer, assetFinalityResolver, externalPositionManager, dispatcher,
|
390
|
+
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;
|
403
391
|
|
404
392
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
405
393
|
while (1) {
|
406
394
|
switch (_context.prev = _context.next) {
|
407
395
|
case 0:
|
408
|
-
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher,
|
396
|
+
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;
|
409
397
|
_context.next = 3;
|
410
398
|
return vaultLib.getMlnToken();
|
411
399
|
|
@@ -422,82 +410,111 @@ function _createFundDeployer() {
|
|
422
410
|
case 9:
|
423
411
|
protocolFeeReserve = _context.sent;
|
424
412
|
_context.next = 12;
|
425
|
-
return protocol
|
413
|
+
return protocol.FundDeployer.deploy(deployer, dispatcher, gasRelayPaymasterFactory);
|
426
414
|
|
427
415
|
case 12:
|
428
416
|
nextFundDeployer = _context.sent;
|
429
417
|
_context.next = 15;
|
430
|
-
return protocol
|
418
|
+
return protocol.PolicyManager.deploy(deployer, nextFundDeployer, gasRelayPaymasterFactory);
|
431
419
|
|
432
420
|
case 15:
|
421
|
+
nextPolicyManager = _context.sent;
|
422
|
+
_context.t0 = protocol.ExternalPositionManager;
|
423
|
+
_context.t1 = deployer;
|
424
|
+
_context.t2 = nextFundDeployer;
|
425
|
+
_context.next = 21;
|
426
|
+
return externalPositionManager.getExternalPositionFactory();
|
427
|
+
|
428
|
+
case 21:
|
429
|
+
_context.t3 = _context.sent;
|
430
|
+
_context.t4 = nextPolicyManager;
|
431
|
+
_context.next = 25;
|
432
|
+
return _context.t0.deploy.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4);
|
433
|
+
|
434
|
+
case 25:
|
435
|
+
nextExternalPositionManager = _context.sent;
|
436
|
+
_context.next = 28;
|
437
|
+
return protocol.FeeManager.deploy(deployer, nextFundDeployer);
|
438
|
+
|
439
|
+
case 28:
|
440
|
+
nextFeeManager = _context.sent;
|
441
|
+
_context.next = 31;
|
442
|
+
return protocol.IntegrationManager.deploy(deployer, nextFundDeployer, nextPolicyManager, valueInterpreter);
|
443
|
+
|
444
|
+
case 31:
|
445
|
+
nextIntegrationManager = _context.sent;
|
446
|
+
_context.next = 34;
|
447
|
+
return protocol.ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, assetFinalityResolver, gasRelayPaymasterFactory, mlnToken, wethToken);
|
448
|
+
|
449
|
+
case 34:
|
433
450
|
nextComptrollerLib = _context.sent;
|
434
|
-
_context.next =
|
451
|
+
_context.next = 37;
|
435
452
|
return nextFundDeployer.setComptrollerLib(nextComptrollerLib);
|
436
453
|
|
437
|
-
case
|
438
|
-
_context.next =
|
439
|
-
return protocol
|
454
|
+
case 37:
|
455
|
+
_context.next = 39;
|
456
|
+
return protocol.ProtocolFeeTracker.deploy(deployer, nextFundDeployer);
|
440
457
|
|
441
|
-
case
|
458
|
+
case 39:
|
442
459
|
nextProtocolFeeTracker = _context.sent;
|
443
|
-
_context.next =
|
460
|
+
_context.next = 42;
|
444
461
|
return nextFundDeployer.setProtocolFeeTracker(nextProtocolFeeTracker);
|
445
462
|
|
446
|
-
case
|
447
|
-
_context.
|
448
|
-
_context.
|
449
|
-
_context.
|
450
|
-
_context.next =
|
463
|
+
case 42:
|
464
|
+
_context.t5 = protocol.VaultLib;
|
465
|
+
_context.t6 = deployer;
|
466
|
+
_context.t7 = externalPositionManager;
|
467
|
+
_context.next = 47;
|
451
468
|
return vaultLib.getGasRelayPaymasterFactory();
|
452
469
|
|
453
|
-
case
|
454
|
-
_context.
|
455
|
-
_context.next =
|
470
|
+
case 47:
|
471
|
+
_context.t8 = _context.sent;
|
472
|
+
_context.next = 50;
|
456
473
|
return vaultLib.getProtocolFeeReserve();
|
457
474
|
|
458
|
-
case
|
459
|
-
_context.
|
460
|
-
_context.
|
461
|
-
_context.next =
|
475
|
+
case 50:
|
476
|
+
_context.t9 = _context.sent;
|
477
|
+
_context.t10 = nextProtocolFeeTracker;
|
478
|
+
_context.next = 54;
|
462
479
|
return vaultLib.getMlnToken();
|
463
480
|
|
464
|
-
case
|
465
|
-
_context.
|
466
|
-
_context.next =
|
481
|
+
case 54:
|
482
|
+
_context.t11 = _context.sent;
|
483
|
+
_context.next = 57;
|
467
484
|
return vaultLib.getWethToken();
|
468
485
|
|
469
|
-
case
|
470
|
-
_context.
|
471
|
-
_context.next =
|
472
|
-
return _context.
|
486
|
+
case 57:
|
487
|
+
_context.t12 = _context.sent;
|
488
|
+
_context.next = 60;
|
489
|
+
return _context.t5.deploy.call(_context.t5, _context.t6, _context.t7, _context.t8, _context.t9, _context.t10, _context.t11, _context.t12);
|
473
490
|
|
474
|
-
case
|
491
|
+
case 60:
|
475
492
|
nextVaultLib = _context.sent;
|
476
|
-
_context.next =
|
493
|
+
_context.next = 63;
|
477
494
|
return nextFundDeployer.setVaultLib(nextVaultLib);
|
478
495
|
|
479
|
-
case
|
496
|
+
case 63:
|
480
497
|
if (!setReleaseLive) {
|
481
|
-
_context.next =
|
498
|
+
_context.next = 66;
|
482
499
|
break;
|
483
500
|
}
|
484
501
|
|
485
|
-
_context.next =
|
502
|
+
_context.next = 66;
|
486
503
|
return nextFundDeployer.setReleaseLive();
|
487
504
|
|
488
|
-
case
|
505
|
+
case 66:
|
489
506
|
if (!setOnDispatcher) {
|
490
|
-
_context.next =
|
507
|
+
_context.next = 69;
|
491
508
|
break;
|
492
509
|
}
|
493
510
|
|
494
|
-
_context.next =
|
511
|
+
_context.next = 69;
|
495
512
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
496
513
|
|
497
|
-
case
|
514
|
+
case 69:
|
498
515
|
return _context.abrupt("return", nextFundDeployer);
|
499
516
|
|
500
|
-
case
|
517
|
+
case 70:
|
501
518
|
case "end":
|
502
519
|
return _context.stop();
|
503
520
|
}
|
@@ -543,21 +560,24 @@ function _callOnExtension() {
|
|
543
560
|
return _callOnExtension.apply(this, arguments);
|
544
561
|
}
|
545
562
|
|
546
|
-
|
547
|
-
|
548
|
-
return _createExternalPosition.apply(this, arguments);
|
563
|
+
function callOnExternalPosition(_x) {
|
564
|
+
return _callOnExternalPosition.apply(this, arguments);
|
549
565
|
}
|
550
566
|
|
551
|
-
function
|
552
|
-
|
553
|
-
var comptrollerProxy, externalPositionManager,
|
567
|
+
function _callOnExternalPosition() {
|
568
|
+
_callOnExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
569
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, actionId, actionArgs, callArgs;
|
554
570
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
555
571
|
while (1) {
|
556
572
|
switch (_context.prev = _context.next) {
|
557
573
|
case 0:
|
558
|
-
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager,
|
559
|
-
|
560
|
-
|
574
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
575
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
576
|
+
actionArgs: actionArgs,
|
577
|
+
actionId: actionId,
|
578
|
+
externalPositionProxy: externalPositionProxy
|
579
|
+
});
|
580
|
+
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
561
581
|
|
562
582
|
case 3:
|
563
583
|
case "end":
|
@@ -566,214 +586,305 @@ function _createExternalPosition() {
|
|
566
586
|
}
|
567
587
|
}, _callee);
|
568
588
|
}));
|
569
|
-
return
|
589
|
+
return _callOnExternalPosition.apply(this, arguments);
|
570
590
|
}
|
571
591
|
|
572
|
-
function
|
573
|
-
return
|
592
|
+
function createExternalPosition(_x2) {
|
593
|
+
return _createExternalPosition.apply(this, arguments);
|
574
594
|
}
|
575
595
|
|
576
|
-
function
|
577
|
-
|
578
|
-
var comptrollerProxy, externalPositionManager,
|
596
|
+
function _createExternalPosition() {
|
597
|
+
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
598
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
599
|
+
|
579
600
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
580
601
|
while (1) {
|
581
602
|
switch (_context2.prev = _context2.next) {
|
582
603
|
case 0:
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
604
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
605
|
+
_context2.next = 3;
|
606
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
607
|
+
|
608
|
+
case 3:
|
609
|
+
receipt = _context2.sent;
|
610
|
+
event = ethers$1.extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
611
|
+
externalPositionProxy = new protocol.IExternalPositionProxy(event[0].args.externalPosition, signer);
|
612
|
+
return _context2.abrupt("return", {
|
590
613
|
externalPositionProxy: externalPositionProxy,
|
591
|
-
|
592
|
-
encodedCallArgs: actionArgs
|
614
|
+
receipt: receipt
|
593
615
|
});
|
594
|
-
addCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol$1.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
595
|
-
return _context2.abrupt("return", addCollateralTx);
|
596
616
|
|
597
|
-
case
|
617
|
+
case 7:
|
598
618
|
case "end":
|
599
619
|
return _context2.stop();
|
600
620
|
}
|
601
621
|
}
|
602
622
|
}, _callee2);
|
603
623
|
}));
|
604
|
-
return
|
624
|
+
return _createExternalPosition.apply(this, arguments);
|
605
625
|
}
|
606
626
|
|
607
|
-
function
|
608
|
-
return
|
627
|
+
function reactivateExternalPosition(_x3) {
|
628
|
+
return _reactivateExternalPosition.apply(this, arguments);
|
609
629
|
}
|
610
630
|
|
611
|
-
function
|
612
|
-
|
613
|
-
var comptrollerProxy, externalPositionManager,
|
631
|
+
function _reactivateExternalPosition() {
|
632
|
+
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
633
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
614
634
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
615
635
|
while (1) {
|
616
636
|
switch (_context3.prev = _context3.next) {
|
617
637
|
case 0:
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
amounts: amounts,
|
622
|
-
data: protocol$1.encodeArgs(['address[]'], [cTokens])
|
623
|
-
});
|
624
|
-
callArgs = protocol$1.callOnExternalPositionArgs({
|
625
|
-
externalPositionProxy: externalPositionProxy,
|
626
|
-
actionId: protocol$1.CompoundDebtPositionActionId.RemoveCollateralAssets,
|
627
|
-
encodedCallArgs: actionArgs
|
638
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy;
|
639
|
+
callArgs = protocol.externalPositionReactivateArgs({
|
640
|
+
externalPositionProxy: externalPositionProxy
|
628
641
|
});
|
629
|
-
|
630
|
-
return _context3.abrupt("return", removeCollateralTx);
|
642
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.ReactivateExternalPosition, callArgs));
|
631
643
|
|
632
|
-
case
|
644
|
+
case 3:
|
633
645
|
case "end":
|
634
646
|
return _context3.stop();
|
635
647
|
}
|
636
648
|
}
|
637
649
|
}, _callee3);
|
638
650
|
}));
|
639
|
-
return
|
651
|
+
return _reactivateExternalPosition.apply(this, arguments);
|
640
652
|
}
|
641
653
|
|
642
|
-
function
|
643
|
-
return
|
654
|
+
function removeExternalPosition(_x4) {
|
655
|
+
return _removeExternalPosition.apply(this, arguments);
|
644
656
|
}
|
645
657
|
|
646
|
-
function
|
647
|
-
|
648
|
-
var comptrollerProxy, externalPositionManager,
|
658
|
+
function _removeExternalPosition() {
|
659
|
+
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
660
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
649
661
|
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
650
662
|
while (1) {
|
651
663
|
switch (_context4.prev = _context4.next) {
|
652
664
|
case 0:
|
653
|
-
|
654
|
-
|
655
|
-
|
665
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy;
|
666
|
+
callArgs = protocol.externalPositionRemoveArgs({
|
667
|
+
externalPositionProxy: externalPositionProxy
|
668
|
+
});
|
669
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.RemoveExternalPosition, callArgs));
|
670
|
+
|
671
|
+
case 3:
|
672
|
+
case "end":
|
673
|
+
return _context4.stop();
|
674
|
+
}
|
675
|
+
}
|
676
|
+
}, _callee4);
|
677
|
+
}));
|
678
|
+
return _removeExternalPosition.apply(this, arguments);
|
679
|
+
}
|
680
|
+
|
681
|
+
function compoundDebtPositionAddCollateral(_x) {
|
682
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
683
|
+
}
|
684
|
+
|
685
|
+
function _compoundDebtPositionAddCollateral() {
|
686
|
+
_compoundDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
687
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
688
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
689
|
+
while (1) {
|
690
|
+
switch (_context.prev = _context.next) {
|
691
|
+
case 0:
|
692
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
693
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
656
694
|
amounts: amounts,
|
657
|
-
|
695
|
+
assets: assets,
|
696
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
658
697
|
});
|
659
|
-
|
698
|
+
return _context.abrupt("return", callOnExternalPosition({
|
699
|
+
actionArgs: actionArgs,
|
700
|
+
actionId: protocol.CompoundDebtPositionActionId.AddCollateralAssets,
|
701
|
+
comptrollerProxy: comptrollerProxy,
|
702
|
+
externalPositionManager: externalPositionManager,
|
660
703
|
externalPositionProxy: externalPositionProxy,
|
661
|
-
|
662
|
-
|
704
|
+
signer: fundOwner
|
705
|
+
}));
|
706
|
+
|
707
|
+
case 3:
|
708
|
+
case "end":
|
709
|
+
return _context.stop();
|
710
|
+
}
|
711
|
+
}
|
712
|
+
}, _callee);
|
713
|
+
}));
|
714
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
715
|
+
}
|
716
|
+
|
717
|
+
function compoundDebtPositionBorrow(_x2) {
|
718
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
719
|
+
}
|
720
|
+
|
721
|
+
function _compoundDebtPositionBorrow() {
|
722
|
+
_compoundDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
723
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, assets, amounts, cTokens, actionArgs;
|
724
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
725
|
+
while (1) {
|
726
|
+
switch (_context2.prev = _context2.next) {
|
727
|
+
case 0:
|
728
|
+
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
729
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
730
|
+
amounts: amounts,
|
731
|
+
assets: assets,
|
732
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
663
733
|
});
|
664
|
-
|
665
|
-
|
734
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
735
|
+
actionArgs: actionArgs,
|
736
|
+
actionId: protocol.CompoundDebtPositionActionId.BorrowAsset,
|
737
|
+
comptrollerProxy: comptrollerProxy,
|
738
|
+
externalPositionManager: externalPositionManager,
|
739
|
+
externalPositionProxy: externalPositionProxy,
|
740
|
+
signer: fundOwner
|
741
|
+
}));
|
666
742
|
|
667
|
-
case
|
743
|
+
case 3:
|
668
744
|
case "end":
|
669
|
-
return
|
745
|
+
return _context2.stop();
|
670
746
|
}
|
671
747
|
}
|
672
|
-
},
|
748
|
+
}, _callee2);
|
673
749
|
}));
|
674
|
-
return
|
750
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
675
751
|
}
|
676
752
|
|
677
|
-
function
|
678
|
-
return
|
753
|
+
function compoundDebtPositionClaimComp(_x3) {
|
754
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
679
755
|
}
|
680
756
|
|
681
|
-
function
|
682
|
-
|
683
|
-
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs
|
684
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
757
|
+
function _compoundDebtPositionClaimComp() {
|
758
|
+
_compoundDebtPositionClaimComp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
759
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs;
|
760
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
685
761
|
while (1) {
|
686
|
-
switch (
|
762
|
+
switch (_context3.prev = _context3.next) {
|
687
763
|
case 0:
|
688
|
-
comptrollerProxy =
|
689
|
-
actionArgs = protocol
|
690
|
-
assets: [],
|
764
|
+
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
765
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
691
766
|
amounts: [],
|
767
|
+
assets: [],
|
692
768
|
data: '0x'
|
693
769
|
});
|
694
|
-
|
770
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
771
|
+
actionArgs: actionArgs,
|
772
|
+
actionId: protocol.CompoundDebtPositionActionId.ClaimComp,
|
773
|
+
comptrollerProxy: comptrollerProxy,
|
774
|
+
externalPositionManager: externalPositionManager,
|
695
775
|
externalPositionProxy: externalPositionProxy,
|
696
|
-
|
697
|
-
|
698
|
-
});
|
699
|
-
claimCompTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol$1.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
700
|
-
return _context5.abrupt("return", claimCompTx);
|
776
|
+
signer: fundOwner
|
777
|
+
}));
|
701
778
|
|
702
|
-
case
|
779
|
+
case 3:
|
703
780
|
case "end":
|
704
|
-
return
|
781
|
+
return _context3.stop();
|
705
782
|
}
|
706
783
|
}
|
707
|
-
},
|
784
|
+
}, _callee3);
|
708
785
|
}));
|
709
|
-
return
|
786
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
710
787
|
}
|
711
788
|
|
712
|
-
function
|
713
|
-
return
|
789
|
+
function compoundDebtPositionRemoveCollateral(_x4) {
|
790
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
714
791
|
}
|
715
792
|
|
716
|
-
function
|
717
|
-
|
718
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs
|
719
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
793
|
+
function _compoundDebtPositionRemoveCollateral() {
|
794
|
+
_compoundDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
795
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
796
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
720
797
|
while (1) {
|
721
|
-
switch (
|
798
|
+
switch (_context4.prev = _context4.next) {
|
722
799
|
case 0:
|
723
|
-
comptrollerProxy =
|
724
|
-
actionArgs = protocol
|
725
|
-
assets: assets,
|
800
|
+
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
801
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
726
802
|
amounts: amounts,
|
727
|
-
|
803
|
+
assets: assets,
|
804
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
728
805
|
});
|
729
|
-
|
806
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
807
|
+
actionArgs: actionArgs,
|
808
|
+
actionId: protocol.CompoundDebtPositionActionId.RemoveCollateralAssets,
|
809
|
+
comptrollerProxy: comptrollerProxy,
|
810
|
+
externalPositionManager: externalPositionManager,
|
730
811
|
externalPositionProxy: externalPositionProxy,
|
731
|
-
|
732
|
-
|
733
|
-
});
|
734
|
-
repayTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol$1.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
735
|
-
return _context6.abrupt("return", repayTx);
|
812
|
+
signer: fundOwner
|
813
|
+
}));
|
736
814
|
|
737
|
-
case
|
815
|
+
case 3:
|
738
816
|
case "end":
|
739
|
-
return
|
817
|
+
return _context4.stop();
|
740
818
|
}
|
741
819
|
}
|
742
|
-
},
|
820
|
+
}, _callee4);
|
743
821
|
}));
|
744
|
-
return
|
822
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
745
823
|
}
|
746
824
|
|
747
|
-
function
|
748
|
-
return
|
825
|
+
function compoundDebtPositionRepayBorrow(_x5) {
|
826
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
749
827
|
}
|
750
828
|
|
751
|
-
function
|
752
|
-
|
753
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
754
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
829
|
+
function _compoundDebtPositionRepayBorrow() {
|
830
|
+
_compoundDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
831
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
832
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
755
833
|
while (1) {
|
756
|
-
switch (
|
834
|
+
switch (_context5.prev = _context5.next) {
|
757
835
|
case 0:
|
758
|
-
comptrollerProxy =
|
759
|
-
actionArgs = protocol
|
760
|
-
|
836
|
+
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
837
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
838
|
+
amounts: amounts,
|
839
|
+
assets: assets,
|
840
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
761
841
|
});
|
762
|
-
|
842
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
843
|
+
actionArgs: actionArgs,
|
844
|
+
actionId: protocol.CompoundDebtPositionActionId.RepayBorrowedAssets,
|
845
|
+
comptrollerProxy: comptrollerProxy,
|
846
|
+
externalPositionManager: externalPositionManager,
|
763
847
|
externalPositionProxy: externalPositionProxy,
|
764
|
-
|
765
|
-
});
|
766
|
-
removeExternalPositionTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol$1.ExternalPositionManagerActionId.RemoveExternalPosition, callArgs);
|
767
|
-
return _context7.abrupt("return", removeExternalPositionTx);
|
848
|
+
signer: fundOwner
|
849
|
+
}));
|
768
850
|
|
769
|
-
case
|
851
|
+
case 3:
|
770
852
|
case "end":
|
771
|
-
return
|
853
|
+
return _context5.stop();
|
772
854
|
}
|
773
855
|
}
|
774
|
-
},
|
856
|
+
}, _callee5);
|
775
857
|
}));
|
776
|
-
return
|
858
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
859
|
+
}
|
860
|
+
|
861
|
+
function createCompoundDebtPosition(_x6) {
|
862
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
863
|
+
}
|
864
|
+
|
865
|
+
function _createCompoundDebtPosition() {
|
866
|
+
_createCompoundDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
867
|
+
var signer, comptrollerProxy, externalPositionManager;
|
868
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
869
|
+
while (1) {
|
870
|
+
switch (_context6.prev = _context6.next) {
|
871
|
+
case 0:
|
872
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
873
|
+
return _context6.abrupt("return", createExternalPosition({
|
874
|
+
comptrollerProxy: comptrollerProxy,
|
875
|
+
externalPositionManager: externalPositionManager,
|
876
|
+
externalPositionTypeId: protocol.ExternalPositionType.CompoundDebtPosition,
|
877
|
+
signer: signer
|
878
|
+
}));
|
879
|
+
|
880
|
+
case 2:
|
881
|
+
case "end":
|
882
|
+
return _context6.stop();
|
883
|
+
}
|
884
|
+
}
|
885
|
+
}, _callee6);
|
886
|
+
}));
|
887
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
777
888
|
}
|
778
889
|
|
779
890
|
function createMockExternalPosition(_x) {
|
@@ -788,7 +899,7 @@ function _createMockExternalPosition() {
|
|
788
899
|
switch (_context.prev = _context.next) {
|
789
900
|
case 0:
|
790
901
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
791
|
-
_context.t0 =
|
902
|
+
_context.t0 = protocol.VaultLib;
|
792
903
|
_context.next = 4;
|
793
904
|
return comptrollerProxy.getVaultProxy();
|
794
905
|
|
@@ -806,12 +917,12 @@ function _createMockExternalPosition() {
|
|
806
917
|
|
807
918
|
case 12:
|
808
919
|
_context.next = 14;
|
809
|
-
return
|
920
|
+
return protocol.MockGenericExternalPositionLib.deploy(deployer);
|
810
921
|
|
811
922
|
case 14:
|
812
923
|
mockGenericExternalPositionLib = _context.sent;
|
813
924
|
_context.next = 17;
|
814
|
-
return
|
925
|
+
return protocol.MockGenericExternalPositionParser.deploy(deployer);
|
815
926
|
|
816
927
|
case 17:
|
817
928
|
mockExternalPositionParser = _context.sent;
|
@@ -821,7 +932,7 @@ function _createMockExternalPosition() {
|
|
821
932
|
|
822
933
|
case 21:
|
823
934
|
_context.next = 23;
|
824
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager,
|
935
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [typeId, '0x']));
|
825
936
|
|
826
937
|
case 23:
|
827
938
|
receipt = _context.sent;
|
@@ -831,21 +942,431 @@ function _createMockExternalPosition() {
|
|
831
942
|
case 26:
|
832
943
|
externalPositionProxy = _context.sent[0];
|
833
944
|
return _context.abrupt("return", {
|
834
|
-
|
835
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
945
|
+
externalPositionProxy: externalPositionProxy,
|
836
946
|
mockExternalPositionParser: mockExternalPositionParser,
|
947
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
948
|
+
receipt: receipt,
|
949
|
+
typeId: typeId
|
950
|
+
});
|
951
|
+
|
952
|
+
case 28:
|
953
|
+
case "end":
|
954
|
+
return _context.stop();
|
955
|
+
}
|
956
|
+
}
|
957
|
+
}, _callee);
|
958
|
+
}));
|
959
|
+
return _createMockExternalPosition.apply(this, arguments);
|
960
|
+
}
|
961
|
+
|
962
|
+
function mockExternalPositionAddDebtAssets(_x2) {
|
963
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
964
|
+
}
|
965
|
+
|
966
|
+
function _mockExternalPositionAddDebtAssets() {
|
967
|
+
_mockExternalPositionAddDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
968
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
969
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
970
|
+
while (1) {
|
971
|
+
switch (_context2.prev = _context2.next) {
|
972
|
+
case 0:
|
973
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
974
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
975
|
+
amounts: amounts,
|
976
|
+
assets: assets
|
977
|
+
});
|
978
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
979
|
+
actionArgs: actionArgs,
|
980
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddDebtAssets,
|
981
|
+
comptrollerProxy: comptrollerProxy,
|
982
|
+
externalPositionManager: externalPositionManager,
|
983
|
+
externalPositionProxy: externalPositionProxy,
|
984
|
+
signer: signer
|
985
|
+
}));
|
986
|
+
|
987
|
+
case 3:
|
988
|
+
case "end":
|
989
|
+
return _context2.stop();
|
990
|
+
}
|
991
|
+
}
|
992
|
+
}, _callee2);
|
993
|
+
}));
|
994
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
995
|
+
}
|
996
|
+
|
997
|
+
function mockExternalPositionAddManagedAssets(_x3) {
|
998
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
999
|
+
}
|
1000
|
+
|
1001
|
+
function _mockExternalPositionAddManagedAssets() {
|
1002
|
+
_mockExternalPositionAddManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1003
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1004
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1005
|
+
while (1) {
|
1006
|
+
switch (_context3.prev = _context3.next) {
|
1007
|
+
case 0:
|
1008
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
1009
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1010
|
+
amounts: amounts,
|
1011
|
+
assets: assets
|
1012
|
+
});
|
1013
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
1014
|
+
actionArgs: actionArgs,
|
1015
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddManagedAssets,
|
1016
|
+
comptrollerProxy: comptrollerProxy,
|
1017
|
+
externalPositionManager: externalPositionManager,
|
1018
|
+
externalPositionProxy: externalPositionProxy,
|
1019
|
+
signer: signer
|
1020
|
+
}));
|
1021
|
+
|
1022
|
+
case 3:
|
1023
|
+
case "end":
|
1024
|
+
return _context3.stop();
|
1025
|
+
}
|
1026
|
+
}
|
1027
|
+
}, _callee3);
|
1028
|
+
}));
|
1029
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
function mockExternalPositionRemoveDebtAssets(_x4) {
|
1033
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1034
|
+
}
|
1035
|
+
|
1036
|
+
function _mockExternalPositionRemoveDebtAssets() {
|
1037
|
+
_mockExternalPositionRemoveDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1038
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1039
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1040
|
+
while (1) {
|
1041
|
+
switch (_context4.prev = _context4.next) {
|
1042
|
+
case 0:
|
1043
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
1044
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1045
|
+
amounts: amounts,
|
1046
|
+
assets: assets
|
1047
|
+
});
|
1048
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
1049
|
+
actionArgs: actionArgs,
|
1050
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveDebtAssets,
|
1051
|
+
comptrollerProxy: comptrollerProxy,
|
1052
|
+
externalPositionManager: externalPositionManager,
|
1053
|
+
externalPositionProxy: externalPositionProxy,
|
1054
|
+
signer: signer
|
1055
|
+
}));
|
1056
|
+
|
1057
|
+
case 3:
|
1058
|
+
case "end":
|
1059
|
+
return _context4.stop();
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
}, _callee4);
|
1063
|
+
}));
|
1064
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1065
|
+
}
|
1066
|
+
|
1067
|
+
function mockExternalPositionRemoveManagedAssets(_x5) {
|
1068
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1069
|
+
}
|
1070
|
+
|
1071
|
+
function _mockExternalPositionRemoveManagedAssets() {
|
1072
|
+
_mockExternalPositionRemoveManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1073
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1074
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1075
|
+
while (1) {
|
1076
|
+
switch (_context5.prev = _context5.next) {
|
1077
|
+
case 0:
|
1078
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
1079
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1080
|
+
amounts: amounts,
|
1081
|
+
assets: assets
|
1082
|
+
});
|
1083
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
1084
|
+
actionArgs: actionArgs,
|
1085
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveManagedAssets,
|
1086
|
+
comptrollerProxy: comptrollerProxy,
|
1087
|
+
externalPositionManager: externalPositionManager,
|
837
1088
|
externalPositionProxy: externalPositionProxy,
|
1089
|
+
signer: signer
|
1090
|
+
}));
|
1091
|
+
|
1092
|
+
case 3:
|
1093
|
+
case "end":
|
1094
|
+
return _context5.stop();
|
1095
|
+
}
|
1096
|
+
}
|
1097
|
+
}, _callee5);
|
1098
|
+
}));
|
1099
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1100
|
+
}
|
1101
|
+
|
1102
|
+
var _templateObject$3;
|
1103
|
+
exports.UniswapV3FeeAmount = void 0;
|
1104
|
+
|
1105
|
+
(function (UniswapV3FeeAmount) {
|
1106
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
1107
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
1108
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
1109
|
+
})(exports.UniswapV3FeeAmount || (exports.UniswapV3FeeAmount = {}));
|
1110
|
+
|
1111
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
1112
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
1113
|
+
};
|
1114
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
1115
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
1116
|
+
};
|
1117
|
+
var IUniswapV3NonFungibleTokenManager = ethers$1.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"])));
|
1118
|
+
function createUniswapV3LiquidityPosition(_x) {
|
1119
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
function _createUniswapV3LiquidityPosition() {
|
1123
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1124
|
+
var signer, comptrollerProxy, externalPositionManager, token0, token1, initArgs, receipt, vaultProxy, externalPositions, externalPositionProxyAddress;
|
1125
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1126
|
+
while (1) {
|
1127
|
+
switch (_context.prev = _context.next) {
|
1128
|
+
case 0:
|
1129
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, token0 = _ref.token0, token1 = _ref.token1;
|
1130
|
+
initArgs = protocol.uniswapV3LiquidityPositionInitArgs({
|
1131
|
+
token0: token0,
|
1132
|
+
token1: token1
|
1133
|
+
});
|
1134
|
+
_context.next = 4;
|
1135
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [protocol.ExternalPositionType.UniswapV3LiquidityPosition, initArgs]));
|
1136
|
+
|
1137
|
+
case 4:
|
1138
|
+
receipt = _context.sent;
|
1139
|
+
_context.t0 = protocol.VaultLib;
|
1140
|
+
_context.next = 8;
|
1141
|
+
return comptrollerProxy.getVaultProxy();
|
1142
|
+
|
1143
|
+
case 8:
|
1144
|
+
_context.t1 = _context.sent;
|
1145
|
+
_context.t2 = signer;
|
1146
|
+
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
1147
|
+
_context.next = 13;
|
1148
|
+
return vaultProxy.getActiveExternalPositions.call();
|
1149
|
+
|
1150
|
+
case 13:
|
1151
|
+
externalPositions = _context.sent;
|
1152
|
+
externalPositionProxyAddress = externalPositions[externalPositions.length - 1];
|
1153
|
+
return _context.abrupt("return", {
|
1154
|
+
externalPositionProxyAddress: externalPositionProxyAddress,
|
838
1155
|
receipt: receipt
|
839
1156
|
});
|
840
1157
|
|
841
|
-
case
|
1158
|
+
case 16:
|
1159
|
+
case "end":
|
1160
|
+
return _context.stop();
|
1161
|
+
}
|
1162
|
+
}
|
1163
|
+
}, _callee);
|
1164
|
+
}));
|
1165
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1166
|
+
}
|
1167
|
+
|
1168
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
1169
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
1173
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1174
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
1175
|
+
|
1176
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1177
|
+
while (1) {
|
1178
|
+
switch (_context2.prev = _context2.next) {
|
1179
|
+
case 0:
|
1180
|
+
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;
|
1181
|
+
actionArgs = protocol.uniswapV3LiquidityPositionAddLiquidityArgs({
|
1182
|
+
amount0Desired: amount0Desired,
|
1183
|
+
amount0Min: amount0Min,
|
1184
|
+
amount1Desired: amount1Desired,
|
1185
|
+
amount1Min: amount1Min,
|
1186
|
+
nftId: nftId
|
1187
|
+
});
|
1188
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1189
|
+
actionArgs: actionArgs,
|
1190
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.AddLiquidity,
|
1191
|
+
externalPositionProxy: externalPositionProxy
|
1192
|
+
});
|
1193
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1194
|
+
|
1195
|
+
case 4:
|
1196
|
+
case "end":
|
1197
|
+
return _context2.stop();
|
1198
|
+
}
|
1199
|
+
}
|
1200
|
+
}, _callee2);
|
1201
|
+
}));
|
1202
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
1206
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
function _uniswapV3LiquidityPositionCollect() {
|
1210
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1211
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
1212
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1213
|
+
while (1) {
|
1214
|
+
switch (_context3.prev = _context3.next) {
|
1215
|
+
case 0:
|
1216
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
1217
|
+
actionArgs = protocol.uniswapV3LiquidityPositionCollectArgs({
|
1218
|
+
nftId: nftId
|
1219
|
+
});
|
1220
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1221
|
+
actionArgs: actionArgs,
|
1222
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Collect,
|
1223
|
+
externalPositionProxy: externalPositionProxy
|
1224
|
+
});
|
1225
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1226
|
+
|
1227
|
+
case 4:
|
1228
|
+
case "end":
|
1229
|
+
return _context3.stop();
|
1230
|
+
}
|
1231
|
+
}
|
1232
|
+
}, _callee3);
|
1233
|
+
}));
|
1234
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1235
|
+
}
|
1236
|
+
|
1237
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
1238
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
function _uniswapV3LiquidityPositionMint() {
|
1242
|
+
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1243
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1244
|
+
|
1245
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1246
|
+
while (1) {
|
1247
|
+
switch (_context4.prev = _context4.next) {
|
1248
|
+
case 0:
|
1249
|
+
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;
|
1250
|
+
actionArgs = protocol.uniswapV3LiquidityPositionMintArgs({
|
1251
|
+
amount0Desired: amount0Desired,
|
1252
|
+
amount0Min: amount0Min,
|
1253
|
+
amount1Desired: amount1Desired,
|
1254
|
+
amount1Min: amount1Min,
|
1255
|
+
fee: fee,
|
1256
|
+
tickLower: tickLower,
|
1257
|
+
tickUpper: tickUpper
|
1258
|
+
});
|
1259
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1260
|
+
actionArgs: actionArgs,
|
1261
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Mint,
|
1262
|
+
externalPositionProxy: externalPositionProxy
|
1263
|
+
});
|
1264
|
+
_context4.next = 5;
|
1265
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
1266
|
+
|
1267
|
+
case 5:
|
1268
|
+
receipt = _context4.sent;
|
1269
|
+
externalPosition = new protocol.UniswapV3LiquidityPositionLib(externalPositionProxy, provider);
|
1270
|
+
nftId = ethers$1.extractEvent(receipt, externalPosition.abi.getEvent('NFTPositionAdded'))[0].args.tokenId;
|
1271
|
+
return _context4.abrupt("return", {
|
1272
|
+
nftId: nftId,
|
1273
|
+
receipt: receipt
|
1274
|
+
});
|
1275
|
+
|
1276
|
+
case 9:
|
1277
|
+
case "end":
|
1278
|
+
return _context4.stop();
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
}, _callee4);
|
1282
|
+
}));
|
1283
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1284
|
+
}
|
1285
|
+
|
1286
|
+
function uniswapV3LiquidityPositionPurge(_x5) {
|
1287
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1288
|
+
}
|
1289
|
+
|
1290
|
+
function _uniswapV3LiquidityPositionPurge() {
|
1291
|
+
_uniswapV3LiquidityPositionPurge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1292
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref5$amount0Min, amount0Min, _ref5$amount1Min, amount1Min, actionArgs, callArgs;
|
1293
|
+
|
1294
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1295
|
+
while (1) {
|
1296
|
+
switch (_context5.prev = _context5.next) {
|
1297
|
+
case 0:
|
1298
|
+
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;
|
1299
|
+
actionArgs = protocol.uniswapV3LiquidityPositionPurgeArgs({
|
1300
|
+
amount0Min: amount0Min,
|
1301
|
+
amount1Min: amount1Min,
|
1302
|
+
liquidity: liquidity,
|
1303
|
+
nftId: nftId
|
1304
|
+
});
|
1305
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1306
|
+
actionArgs: actionArgs,
|
1307
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Purge,
|
1308
|
+
externalPositionProxy: externalPositionProxy
|
1309
|
+
});
|
1310
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1311
|
+
|
1312
|
+
case 4:
|
1313
|
+
case "end":
|
1314
|
+
return _context5.stop();
|
1315
|
+
}
|
1316
|
+
}
|
1317
|
+
}, _callee5);
|
1318
|
+
}));
|
1319
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
function uniswapV3LiquidityPositionRemoveLiquidity(_x6) {
|
1323
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1324
|
+
}
|
1325
|
+
|
1326
|
+
function _uniswapV3LiquidityPositionRemoveLiquidity() {
|
1327
|
+
_uniswapV3LiquidityPositionRemoveLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
1328
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref6$amount0Min, amount0Min, _ref6$amount1Min, amount1Min, actionArgs, callArgs;
|
1329
|
+
|
1330
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
1331
|
+
while (1) {
|
1332
|
+
switch (_context6.prev = _context6.next) {
|
1333
|
+
case 0:
|
1334
|
+
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;
|
1335
|
+
actionArgs = protocol.uniswapV3LiquidityPositionRemoveLiquidityArgs({
|
1336
|
+
amount0Min: amount0Min,
|
1337
|
+
amount1Min: amount1Min,
|
1338
|
+
liquidity: liquidity,
|
1339
|
+
nftId: nftId
|
1340
|
+
});
|
1341
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1342
|
+
actionArgs: actionArgs,
|
1343
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.RemoveLiquidity,
|
1344
|
+
externalPositionProxy: externalPositionProxy
|
1345
|
+
});
|
1346
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1347
|
+
|
1348
|
+
case 4:
|
842
1349
|
case "end":
|
843
|
-
return
|
1350
|
+
return _context6.stop();
|
844
1351
|
}
|
845
1352
|
}
|
846
|
-
},
|
1353
|
+
}, _callee6);
|
847
1354
|
}));
|
848
|
-
return
|
1355
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1356
|
+
}
|
1357
|
+
|
1358
|
+
function uniswapV3OrderTokenPair(_ref7) {
|
1359
|
+
var tokenA = _ref7.tokenA,
|
1360
|
+
tokenB = _ref7.tokenB;
|
1361
|
+
var tokenAAddress = ethers$1.resolveAddress(tokenA);
|
1362
|
+
var tokenBAddress = ethers$1.resolveAddress(tokenB);
|
1363
|
+
return tokenAAddress < tokenBAddress ? {
|
1364
|
+
token0: tokenAAddress,
|
1365
|
+
token1: tokenBAddress
|
1366
|
+
} : {
|
1367
|
+
token0: tokenBAddress,
|
1368
|
+
token1: tokenAAddress
|
1369
|
+
};
|
849
1370
|
}
|
850
1371
|
|
851
1372
|
function generateFeeManagerConfigWithMockFees(_x) {
|
@@ -868,7 +1389,7 @@ function _generateFeeManagerConfigWithMockFees() {
|
|
868
1389
|
case 3:
|
869
1390
|
fees = _context.sent;
|
870
1391
|
feeManagerSettingsData = [ethers.utils.randomBytes(10), '0x', ethers.utils.randomBytes(2)];
|
871
|
-
return _context.abrupt("return", protocol
|
1392
|
+
return _context.abrupt("return", protocol.feeManagerConfigArgs({
|
872
1393
|
fees: Object.values(fees),
|
873
1394
|
settings: feeManagerSettingsData
|
874
1395
|
}));
|
@@ -896,25 +1417,25 @@ function _generateMockFees() {
|
|
896
1417
|
case 0:
|
897
1418
|
deployer = _ref2.deployer;
|
898
1419
|
_context2.next = 3;
|
899
|
-
return protocol
|
1420
|
+
return protocol.IFee.mock(deployer);
|
900
1421
|
|
901
1422
|
case 3:
|
902
1423
|
mockContinuousFeeSettleOnly = _context2.sent;
|
903
1424
|
_context2.next = 6;
|
904
|
-
return protocol
|
1425
|
+
return protocol.IFee.mock(deployer);
|
905
1426
|
|
906
1427
|
case 6:
|
907
1428
|
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
908
1429
|
_context2.next = 9;
|
909
|
-
return protocol
|
1430
|
+
return protocol.IFee.mock(deployer);
|
910
1431
|
|
911
1432
|
case 9:
|
912
1433
|
mockPostBuySharesFee = _context2.sent;
|
913
1434
|
_context2.next = 12;
|
914
1435
|
return Promise.all([// Continuous fee the mimics ManagementFee
|
915
|
-
mockContinuousFeeSettleOnly.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeSettleOnly.settle.returns(protocol
|
916
|
-
mockContinuousFeeWithGavAndUpdates.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeWithGavAndUpdates.settle.returns(protocol
|
917
|
-
mockPostBuySharesFee.getRecipientForFund.returns(ethers.constants.AddressZero), mockPostBuySharesFee.settle.returns(protocol
|
1436
|
+
mockContinuousFeeSettleOnly.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeSettleOnly.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockContinuousFeeSettleOnly.payout.returns(false), mockContinuousFeeSettleOnly.addFundSettings.returns(undefined), mockContinuousFeeSettleOnly.activateForFund.returns(undefined), mockContinuousFeeSettleOnly.update.returns(undefined), mockContinuousFeeSettleOnly.settlesOnHook.returns(false, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.Continuous).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.PreBuyShares).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, false), mockContinuousFeeSettleOnly.updatesOnHook.returns(false, false), // Continuous fee the mimics PerformanceFee
|
1437
|
+
mockContinuousFeeWithGavAndUpdates.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeWithGavAndUpdates.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockContinuousFeeWithGavAndUpdates.payout.returns(false), mockContinuousFeeWithGavAndUpdates.addFundSettings.returns(undefined), mockContinuousFeeWithGavAndUpdates.activateForFund.returns(undefined), mockContinuousFeeWithGavAndUpdates.update.returns(undefined), mockContinuousFeeWithGavAndUpdates.settlesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.PreBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.PostBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, true), // PostBuyShares fee
|
1438
|
+
mockPostBuySharesFee.getRecipientForFund.returns(ethers.constants.AddressZero), mockPostBuySharesFee.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockPostBuySharesFee.payout.returns(false), mockPostBuySharesFee.addFundSettings.returns(undefined), mockPostBuySharesFee.activateForFund.returns(undefined), mockPostBuySharesFee.update.returns(undefined), mockPostBuySharesFee.settlesOnHook.returns(false, false), mockPostBuySharesFee.settlesOnHook.given(protocol.FeeHook.PostBuyShares).returns(true, false), mockPostBuySharesFee.updatesOnHook.returns(false, false)]);
|
918
1439
|
|
919
1440
|
case 12:
|
920
1441
|
return _context2.abrupt("return", {
|
@@ -946,16 +1467,16 @@ function _aaveLend() {
|
|
946
1467
|
switch (_context.prev = _context.next) {
|
947
1468
|
case 0:
|
948
1469
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, aaveAdapter = _ref.aaveAdapter, aToken = _ref.aToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? ethers.utils.parseEther('1') : _ref$amount;
|
949
|
-
lendArgs = protocol
|
1470
|
+
lendArgs = protocol.aaveLendArgs({
|
950
1471
|
aToken: aToken,
|
951
1472
|
amount: amount
|
952
1473
|
});
|
953
|
-
callArgs = protocol
|
1474
|
+
callArgs = protocol.callOnIntegrationArgs({
|
954
1475
|
adapter: aaveAdapter,
|
955
|
-
|
956
|
-
|
1476
|
+
encodedCallArgs: lendArgs,
|
1477
|
+
selector: protocol.lendSelector
|
957
1478
|
});
|
958
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1479
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
959
1480
|
return _context.abrupt("return", lendTx);
|
960
1481
|
|
961
1482
|
case 5:
|
@@ -981,16 +1502,16 @@ function _aaveRedeem() {
|
|
981
1502
|
switch (_context2.prev = _context2.next) {
|
982
1503
|
case 0:
|
983
1504
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, aaveAdapter = _ref2.aaveAdapter, aToken = _ref2.aToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? ethers.utils.parseEther('1') : _ref2$amount;
|
984
|
-
redeemArgs = protocol
|
1505
|
+
redeemArgs = protocol.aaveRedeemArgs({
|
985
1506
|
aToken: aToken,
|
986
1507
|
amount: amount
|
987
1508
|
});
|
988
|
-
callArgs = protocol
|
1509
|
+
callArgs = protocol.callOnIntegrationArgs({
|
989
1510
|
adapter: aaveAdapter,
|
990
|
-
|
991
|
-
|
1511
|
+
encodedCallArgs: redeemArgs,
|
1512
|
+
selector: protocol.redeemSelector
|
992
1513
|
});
|
993
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1514
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
994
1515
|
return _context2.abrupt("return", redeemTx);
|
995
1516
|
|
996
1517
|
case 5:
|
@@ -1018,17 +1539,17 @@ function _compoundLend() {
|
|
1018
1539
|
switch (_context.prev = _context.next) {
|
1019
1540
|
case 0:
|
1020
1541
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, cToken = _ref.cToken, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$tokenAmount, _ref$cTokenAmount = _ref.cTokenAmount, cTokenAmount = _ref$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$cTokenAmount;
|
1021
|
-
lendArgs = protocol
|
1542
|
+
lendArgs = protocol.compoundArgs({
|
1022
1543
|
cToken: cToken,
|
1023
|
-
|
1024
|
-
|
1544
|
+
minIncomingAssetAmount: cTokenAmount,
|
1545
|
+
outgoingAssetAmount: tokenAmount
|
1025
1546
|
});
|
1026
|
-
callArgs = protocol
|
1547
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1027
1548
|
adapter: compoundAdapter,
|
1028
|
-
|
1029
|
-
|
1549
|
+
encodedCallArgs: lendArgs,
|
1550
|
+
selector: protocol.lendSelector
|
1030
1551
|
});
|
1031
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1552
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1032
1553
|
return _context.abrupt("return", lendTx);
|
1033
1554
|
|
1034
1555
|
case 5:
|
@@ -1054,17 +1575,17 @@ function _compoundRedeem() {
|
|
1054
1575
|
switch (_context2.prev = _context2.next) {
|
1055
1576
|
case 0:
|
1056
1577
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, _ref2$tokenAmount = _ref2.tokenAmount, tokenAmount = _ref2$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref2$tokenAmount, _ref2$cTokenAmount = _ref2.cTokenAmount, cTokenAmount = _ref2$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref2$cTokenAmount;
|
1057
|
-
redeemArgs = protocol
|
1578
|
+
redeemArgs = protocol.compoundArgs({
|
1058
1579
|
cToken: ethers$1.resolveAddress(cToken),
|
1059
|
-
|
1060
|
-
|
1580
|
+
minIncomingAssetAmount: tokenAmount,
|
1581
|
+
outgoingAssetAmount: cTokenAmount
|
1061
1582
|
});
|
1062
|
-
callArgs = protocol
|
1583
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1063
1584
|
adapter: compoundAdapter,
|
1064
|
-
|
1065
|
-
|
1585
|
+
encodedCallArgs: redeemArgs,
|
1586
|
+
selector: protocol.redeemSelector
|
1066
1587
|
});
|
1067
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1588
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1068
1589
|
return _context2.abrupt("return", redeemTx);
|
1069
1590
|
|
1070
1591
|
case 5:
|
@@ -1096,19 +1617,19 @@ function _curveTakeOrder() {
|
|
1096
1617
|
switch (_context.prev = _context.next) {
|
1097
1618
|
case 0:
|
1098
1619
|
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 ? ethers.utils.parseEther('1') : _ref$outgoingAssetAmo, incomingAsset = _ref.incomingAsset, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? ethers.utils.parseEther('1') : _ref$minIncomingAsset;
|
1099
|
-
takeOrderArgs = protocol
|
1100
|
-
|
1620
|
+
takeOrderArgs = protocol.curveTakeOrderArgs({
|
1621
|
+
incomingAsset: incomingAsset,
|
1622
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1101
1623
|
outgoingAsset: outgoingAsset,
|
1102
1624
|
outgoingAssetAmount: outgoingAssetAmount,
|
1103
|
-
|
1104
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
1625
|
+
pool: pool
|
1105
1626
|
});
|
1106
|
-
callArgs = protocol
|
1627
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1107
1628
|
adapter: curveExchangeAdapter,
|
1108
|
-
|
1109
|
-
|
1629
|
+
encodedCallArgs: takeOrderArgs,
|
1630
|
+
selector: protocol.takeOrderSelector
|
1110
1631
|
});
|
1111
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1632
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1112
1633
|
|
1113
1634
|
case 4:
|
1114
1635
|
case "end":
|
@@ -1125,12 +1646,12 @@ function curveAaveClaimRewards(_ref2) {
|
|
1125
1646
|
integrationManager = _ref2.integrationManager,
|
1126
1647
|
fundOwner = _ref2.fundOwner,
|
1127
1648
|
curveLiquidityAaveAdapter = _ref2.curveLiquidityAaveAdapter;
|
1128
|
-
var callArgs = protocol
|
1649
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1129
1650
|
adapter: curveLiquidityAaveAdapter,
|
1130
|
-
|
1131
|
-
|
1651
|
+
encodedCallArgs: ethers.constants.HashZero,
|
1652
|
+
selector: protocol.claimRewardsSelector
|
1132
1653
|
});
|
1133
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1654
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1134
1655
|
}
|
1135
1656
|
function curveAaveLend(_ref3) {
|
1136
1657
|
var comptrollerProxy = _ref3.comptrollerProxy,
|
@@ -1147,18 +1668,18 @@ function curveAaveLend(_ref3) {
|
|
1147
1668
|
minIncomingLPTokenAmount = _ref3$minIncomingLPTo === void 0 ? ethers.BigNumber.from(1) : _ref3$minIncomingLPTo,
|
1148
1669
|
_ref3$useUnderlyings = _ref3.useUnderlyings,
|
1149
1670
|
useUnderlyings = _ref3$useUnderlyings === void 0 ? false : _ref3$useUnderlyings;
|
1150
|
-
var callArgs = protocol
|
1671
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1151
1672
|
adapter: curveLiquidityAaveAdapter,
|
1152
|
-
|
1153
|
-
|
1673
|
+
encodedCallArgs: protocol.curveAaveLendArgs({
|
1674
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1154
1675
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1155
1676
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1156
1677
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1157
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1158
1678
|
useUnderlyings: useUnderlyings
|
1159
|
-
})
|
1679
|
+
}),
|
1680
|
+
selector: protocol.lendSelector
|
1160
1681
|
});
|
1161
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1682
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1162
1683
|
}
|
1163
1684
|
function curveAaveLendAndStake(_ref4) {
|
1164
1685
|
var comptrollerProxy = _ref4.comptrollerProxy,
|
@@ -1175,18 +1696,18 @@ function curveAaveLendAndStake(_ref4) {
|
|
1175
1696
|
minIncomingLiquidityGaugeTokenAmount = _ref4$minIncomingLiqu === void 0 ? ethers.BigNumber.from(1) : _ref4$minIncomingLiqu,
|
1176
1697
|
_ref4$useUnderlyings = _ref4.useUnderlyings,
|
1177
1698
|
useUnderlyings = _ref4$useUnderlyings === void 0 ? false : _ref4$useUnderlyings;
|
1178
|
-
var callArgs = protocol
|
1699
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1179
1700
|
adapter: curveLiquidityAaveAdapter,
|
1180
|
-
|
1181
|
-
|
1701
|
+
encodedCallArgs: protocol.curveAaveLendAndStakeArgs({
|
1702
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1182
1703
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1183
1704
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1184
1705
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1185
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1186
1706
|
useUnderlyings: useUnderlyings
|
1187
|
-
})
|
1707
|
+
}),
|
1708
|
+
selector: protocol.lendAndStakeSelector
|
1188
1709
|
});
|
1189
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1710
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1190
1711
|
}
|
1191
1712
|
function curveAaveRedeem(_ref5) {
|
1192
1713
|
var comptrollerProxy = _ref5.comptrollerProxy,
|
@@ -1204,19 +1725,19 @@ function curveAaveRedeem(_ref5) {
|
|
1204
1725
|
receiveSingleAsset = _ref5$receiveSingleAs === void 0 ? false : _ref5$receiveSingleAs,
|
1205
1726
|
_ref5$useUnderlyings = _ref5.useUnderlyings,
|
1206
1727
|
useUnderlyings = _ref5$useUnderlyings === void 0 ? false : _ref5$useUnderlyings;
|
1207
|
-
var callArgs = protocol
|
1728
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1208
1729
|
adapter: curveLiquidityAaveAdapter,
|
1209
|
-
|
1210
|
-
encodedCallArgs: protocol$1.curveAaveRedeemArgs({
|
1211
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1730
|
+
encodedCallArgs: protocol.curveAaveRedeemArgs({
|
1212
1731
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1213
1732
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1214
1733
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1734
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1215
1735
|
receiveSingleAsset: receiveSingleAsset,
|
1216
1736
|
useUnderlyings: useUnderlyings
|
1217
|
-
})
|
1737
|
+
}),
|
1738
|
+
selector: protocol.redeemSelector
|
1218
1739
|
});
|
1219
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1740
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1220
1741
|
}
|
1221
1742
|
function curveAaveStake(_ref6) {
|
1222
1743
|
var comptrollerProxy = _ref6.comptrollerProxy,
|
@@ -1224,14 +1745,14 @@ function curveAaveStake(_ref6) {
|
|
1224
1745
|
fundOwner = _ref6.fundOwner,
|
1225
1746
|
curveLiquidityAaveAdapter = _ref6.curveLiquidityAaveAdapter,
|
1226
1747
|
outgoingLPTokenAmount = _ref6.outgoingLPTokenAmount;
|
1227
|
-
var callArgs = protocol
|
1748
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1228
1749
|
adapter: curveLiquidityAaveAdapter,
|
1229
|
-
|
1230
|
-
encodedCallArgs: protocol$1.curveAaveStakeArgs({
|
1750
|
+
encodedCallArgs: protocol.curveAaveStakeArgs({
|
1231
1751
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1232
|
-
})
|
1752
|
+
}),
|
1753
|
+
selector: protocol.stakeSelector
|
1233
1754
|
});
|
1234
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1755
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1235
1756
|
}
|
1236
1757
|
function curveAaveUnstakeAndRedeem(_ref7) {
|
1237
1758
|
var comptrollerProxy = _ref7.comptrollerProxy,
|
@@ -1249,19 +1770,19 @@ function curveAaveUnstakeAndRedeem(_ref7) {
|
|
1249
1770
|
receiveSingleAsset = _ref7$receiveSingleAs === void 0 ? false : _ref7$receiveSingleAs,
|
1250
1771
|
_ref7$useUnderlyings = _ref7.useUnderlyings,
|
1251
1772
|
useUnderlyings = _ref7$useUnderlyings === void 0 ? false : _ref7$useUnderlyings;
|
1252
|
-
var callArgs = protocol
|
1773
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1253
1774
|
adapter: curveLiquidityAaveAdapter,
|
1254
|
-
|
1255
|
-
encodedCallArgs: protocol$1.curveAaveUnstakeAndRedeemArgs({
|
1256
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1775
|
+
encodedCallArgs: protocol.curveAaveUnstakeAndRedeemArgs({
|
1257
1776
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1258
1777
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1259
1778
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1779
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1260
1780
|
receiveSingleAsset: receiveSingleAsset,
|
1261
1781
|
useUnderlyings: useUnderlyings
|
1262
|
-
})
|
1782
|
+
}),
|
1783
|
+
selector: protocol.unstakeAndRedeemSelector
|
1263
1784
|
});
|
1264
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1785
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1265
1786
|
}
|
1266
1787
|
function curveAaveUnstake(_ref8) {
|
1267
1788
|
var comptrollerProxy = _ref8.comptrollerProxy,
|
@@ -1269,14 +1790,14 @@ function curveAaveUnstake(_ref8) {
|
|
1269
1790
|
fundOwner = _ref8.fundOwner,
|
1270
1791
|
curveLiquidityAaveAdapter = _ref8.curveLiquidityAaveAdapter,
|
1271
1792
|
outgoingLiquidityGaugeTokenAmount = _ref8.outgoingLiquidityGaugeTokenAmount;
|
1272
|
-
var callArgs = protocol
|
1793
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1273
1794
|
adapter: curveLiquidityAaveAdapter,
|
1274
|
-
|
1275
|
-
encodedCallArgs: protocol$1.curveAaveUnstakeArgs({
|
1795
|
+
encodedCallArgs: protocol.curveAaveUnstakeArgs({
|
1276
1796
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1277
|
-
})
|
1797
|
+
}),
|
1798
|
+
selector: protocol.unstakeSelector
|
1278
1799
|
});
|
1279
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1800
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1280
1801
|
} // eurs pool
|
1281
1802
|
|
1282
1803
|
function curveEursClaimRewards(_ref9) {
|
@@ -1284,12 +1805,12 @@ function curveEursClaimRewards(_ref9) {
|
|
1284
1805
|
integrationManager = _ref9.integrationManager,
|
1285
1806
|
fundOwner = _ref9.fundOwner,
|
1286
1807
|
curveLiquidityEursAdapter = _ref9.curveLiquidityEursAdapter;
|
1287
|
-
var callArgs = protocol
|
1808
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1288
1809
|
adapter: curveLiquidityEursAdapter,
|
1289
|
-
|
1290
|
-
|
1810
|
+
encodedCallArgs: ethers.constants.HashZero,
|
1811
|
+
selector: protocol.claimRewardsSelector
|
1291
1812
|
});
|
1292
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1813
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1293
1814
|
}
|
1294
1815
|
function curveEursLend(_ref10) {
|
1295
1816
|
var comptrollerProxy = _ref10.comptrollerProxy,
|
@@ -1299,16 +1820,16 @@ function curveEursLend(_ref10) {
|
|
1299
1820
|
outgoingEursAmount = _ref10.outgoingEursAmount,
|
1300
1821
|
outgoingSeurAmount = _ref10.outgoingSeurAmount,
|
1301
1822
|
minIncomingLPTokenAmount = _ref10.minIncomingLPTokenAmount;
|
1302
|
-
var callArgs = protocol
|
1823
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1303
1824
|
adapter: curveLiquidityEursAdapter,
|
1304
|
-
|
1305
|
-
|
1825
|
+
encodedCallArgs: protocol.curveEursLendArgs({
|
1826
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1306
1827
|
outgoingEursAmount: outgoingEursAmount,
|
1307
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1308
|
-
|
1309
|
-
|
1828
|
+
outgoingSeurAmount: outgoingSeurAmount
|
1829
|
+
}),
|
1830
|
+
selector: protocol.lendSelector
|
1310
1831
|
});
|
1311
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1832
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1312
1833
|
}
|
1313
1834
|
function curveEursLendAndStake(_ref11) {
|
1314
1835
|
var comptrollerProxy = _ref11.comptrollerProxy,
|
@@ -1318,16 +1839,16 @@ function curveEursLendAndStake(_ref11) {
|
|
1318
1839
|
outgoingEursAmount = _ref11.outgoingEursAmount,
|
1319
1840
|
outgoingSeurAmount = _ref11.outgoingSeurAmount,
|
1320
1841
|
minIncomingLiquidityGaugeTokenAmount = _ref11.minIncomingLiquidityGaugeTokenAmount;
|
1321
|
-
var callArgs = protocol
|
1842
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1322
1843
|
adapter: curveLiquidityEursAdapter,
|
1323
|
-
|
1324
|
-
|
1844
|
+
encodedCallArgs: protocol.curveEursLendAndStakeArgs({
|
1845
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1325
1846
|
outgoingEursAmount: outgoingEursAmount,
|
1326
|
-
outgoingSeurAmount: outgoingSeurAmount
|
1327
|
-
|
1328
|
-
|
1847
|
+
outgoingSeurAmount: outgoingSeurAmount
|
1848
|
+
}),
|
1849
|
+
selector: protocol.lendAndStakeSelector
|
1329
1850
|
});
|
1330
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1851
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1331
1852
|
}
|
1332
1853
|
function curveEursRedeem(_ref12) {
|
1333
1854
|
var comptrollerProxy = _ref12.comptrollerProxy,
|
@@ -1338,17 +1859,17 @@ function curveEursRedeem(_ref12) {
|
|
1338
1859
|
minIncomingEursAmount = _ref12.minIncomingEursAmount,
|
1339
1860
|
minIncomingSeurAmount = _ref12.minIncomingSeurAmount,
|
1340
1861
|
receiveSingleAsset = _ref12.receiveSingleAsset;
|
1341
|
-
var callArgs = protocol
|
1862
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1342
1863
|
adapter: curveLiquidityEursAdapter,
|
1343
|
-
|
1344
|
-
encodedCallArgs: protocol$1.curveEursRedeemArgs({
|
1345
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1864
|
+
encodedCallArgs: protocol.curveEursRedeemArgs({
|
1346
1865
|
minIncomingEursAmount: minIncomingEursAmount,
|
1347
1866
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
1867
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1348
1868
|
receiveSingleAsset: receiveSingleAsset
|
1349
|
-
})
|
1869
|
+
}),
|
1870
|
+
selector: protocol.redeemSelector
|
1350
1871
|
});
|
1351
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1872
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1352
1873
|
}
|
1353
1874
|
function curveEursStake(_ref13) {
|
1354
1875
|
var comptrollerProxy = _ref13.comptrollerProxy,
|
@@ -1356,14 +1877,14 @@ function curveEursStake(_ref13) {
|
|
1356
1877
|
fundOwner = _ref13.fundOwner,
|
1357
1878
|
curveLiquidityEursAdapter = _ref13.curveLiquidityEursAdapter,
|
1358
1879
|
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
1359
|
-
var callArgs = protocol
|
1880
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1360
1881
|
adapter: curveLiquidityEursAdapter,
|
1361
|
-
|
1362
|
-
encodedCallArgs: protocol$1.curveEursStakeArgs({
|
1882
|
+
encodedCallArgs: protocol.curveEursStakeArgs({
|
1363
1883
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1364
|
-
})
|
1884
|
+
}),
|
1885
|
+
selector: protocol.stakeSelector
|
1365
1886
|
});
|
1366
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1887
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1367
1888
|
}
|
1368
1889
|
function curveEursUnstakeAndRedeem(_ref14) {
|
1369
1890
|
var comptrollerProxy = _ref14.comptrollerProxy,
|
@@ -1374,17 +1895,17 @@ function curveEursUnstakeAndRedeem(_ref14) {
|
|
1374
1895
|
minIncomingEursAmount = _ref14.minIncomingEursAmount,
|
1375
1896
|
minIncomingSeurAmount = _ref14.minIncomingSeurAmount,
|
1376
1897
|
receiveSingleAsset = _ref14.receiveSingleAsset;
|
1377
|
-
var callArgs = protocol
|
1898
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1378
1899
|
adapter: curveLiquidityEursAdapter,
|
1379
|
-
|
1380
|
-
encodedCallArgs: protocol$1.curveEursUnstakeAndRedeemArgs({
|
1381
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1900
|
+
encodedCallArgs: protocol.curveEursUnstakeAndRedeemArgs({
|
1382
1901
|
minIncomingEursAmount: minIncomingEursAmount,
|
1383
1902
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
1903
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1384
1904
|
receiveSingleAsset: receiveSingleAsset
|
1385
|
-
})
|
1905
|
+
}),
|
1906
|
+
selector: protocol.unstakeAndRedeemSelector
|
1386
1907
|
});
|
1387
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1908
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1388
1909
|
}
|
1389
1910
|
function curveEursUnstake(_ref15) {
|
1390
1911
|
var comptrollerProxy = _ref15.comptrollerProxy,
|
@@ -1392,14 +1913,14 @@ function curveEursUnstake(_ref15) {
|
|
1392
1913
|
fundOwner = _ref15.fundOwner,
|
1393
1914
|
curveLiquidityEursAdapter = _ref15.curveLiquidityEursAdapter,
|
1394
1915
|
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
1395
|
-
var callArgs = protocol
|
1916
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1396
1917
|
adapter: curveLiquidityEursAdapter,
|
1397
|
-
|
1398
|
-
encodedCallArgs: protocol$1.curveEursUnstakeArgs({
|
1918
|
+
encodedCallArgs: protocol.curveEursUnstakeArgs({
|
1399
1919
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1400
|
-
})
|
1920
|
+
}),
|
1921
|
+
selector: protocol.unstakeSelector
|
1401
1922
|
});
|
1402
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1923
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1403
1924
|
} // sETH pool
|
1404
1925
|
|
1405
1926
|
function curveSethClaimRewards(_ref16) {
|
@@ -1407,12 +1928,12 @@ function curveSethClaimRewards(_ref16) {
|
|
1407
1928
|
integrationManager = _ref16.integrationManager,
|
1408
1929
|
fundOwner = _ref16.fundOwner,
|
1409
1930
|
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
1410
|
-
var callArgs = protocol
|
1931
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1411
1932
|
adapter: curveLiquiditySethAdapter,
|
1412
|
-
|
1413
|
-
|
1933
|
+
encodedCallArgs: ethers.constants.HashZero,
|
1934
|
+
selector: protocol.claimRewardsSelector
|
1414
1935
|
});
|
1415
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1936
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1416
1937
|
}
|
1417
1938
|
function curveSethLend(_ref17) {
|
1418
1939
|
var comptrollerProxy = _ref17.comptrollerProxy,
|
@@ -1422,16 +1943,16 @@ function curveSethLend(_ref17) {
|
|
1422
1943
|
outgoingWethAmount = _ref17.outgoingWethAmount,
|
1423
1944
|
outgoingSethAmount = _ref17.outgoingSethAmount,
|
1424
1945
|
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
1425
|
-
var callArgs = protocol
|
1946
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1426
1947
|
adapter: curveLiquiditySethAdapter,
|
1427
|
-
|
1428
|
-
|
1429
|
-
outgoingWethAmount: outgoingWethAmount,
|
1948
|
+
encodedCallArgs: protocol.curveSethLendArgs({
|
1949
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1430
1950
|
outgoingSethAmount: outgoingSethAmount,
|
1431
|
-
|
1432
|
-
})
|
1951
|
+
outgoingWethAmount: outgoingWethAmount
|
1952
|
+
}),
|
1953
|
+
selector: protocol.lendSelector
|
1433
1954
|
});
|
1434
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1955
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1435
1956
|
}
|
1436
1957
|
function curveSethLendAndStake(_ref18) {
|
1437
1958
|
var comptrollerProxy = _ref18.comptrollerProxy,
|
@@ -1441,16 +1962,16 @@ function curveSethLendAndStake(_ref18) {
|
|
1441
1962
|
outgoingWethAmount = _ref18.outgoingWethAmount,
|
1442
1963
|
outgoingSethAmount = _ref18.outgoingSethAmount,
|
1443
1964
|
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
1444
|
-
var callArgs = protocol
|
1965
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1445
1966
|
adapter: curveLiquiditySethAdapter,
|
1446
|
-
|
1447
|
-
|
1448
|
-
outgoingWethAmount: outgoingWethAmount,
|
1967
|
+
encodedCallArgs: protocol.curveSethLendAndStakeArgs({
|
1968
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1449
1969
|
outgoingSethAmount: outgoingSethAmount,
|
1450
|
-
|
1451
|
-
})
|
1970
|
+
outgoingWethAmount: outgoingWethAmount
|
1971
|
+
}),
|
1972
|
+
selector: protocol.lendAndStakeSelector
|
1452
1973
|
});
|
1453
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1974
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1454
1975
|
}
|
1455
1976
|
function curveSethRedeem(_ref19) {
|
1456
1977
|
var comptrollerProxy = _ref19.comptrollerProxy,
|
@@ -1461,17 +1982,17 @@ function curveSethRedeem(_ref19) {
|
|
1461
1982
|
minIncomingWethAmount = _ref19.minIncomingWethAmount,
|
1462
1983
|
minIncomingSethAmount = _ref19.minIncomingSethAmount,
|
1463
1984
|
receiveSingleAsset = _ref19.receiveSingleAsset;
|
1464
|
-
var callArgs = protocol
|
1985
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1465
1986
|
adapter: curveLiquiditySethAdapter,
|
1466
|
-
|
1467
|
-
encodedCallArgs: protocol$1.curveSethRedeemArgs({
|
1468
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1469
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1987
|
+
encodedCallArgs: protocol.curveSethRedeemArgs({
|
1470
1988
|
minIncomingSethAmount: minIncomingSethAmount,
|
1989
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
1990
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1471
1991
|
receiveSingleAsset: receiveSingleAsset
|
1472
|
-
})
|
1992
|
+
}),
|
1993
|
+
selector: protocol.redeemSelector
|
1473
1994
|
});
|
1474
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
1995
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1475
1996
|
}
|
1476
1997
|
function curveSethStake(_ref20) {
|
1477
1998
|
var comptrollerProxy = _ref20.comptrollerProxy,
|
@@ -1479,14 +2000,14 @@ function curveSethStake(_ref20) {
|
|
1479
2000
|
fundOwner = _ref20.fundOwner,
|
1480
2001
|
curveLiquiditySethAdapter = _ref20.curveLiquiditySethAdapter,
|
1481
2002
|
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
1482
|
-
var callArgs = protocol
|
2003
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1483
2004
|
adapter: curveLiquiditySethAdapter,
|
1484
|
-
|
1485
|
-
encodedCallArgs: protocol$1.curveSethStakeArgs({
|
2005
|
+
encodedCallArgs: protocol.curveSethStakeArgs({
|
1486
2006
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1487
|
-
})
|
2007
|
+
}),
|
2008
|
+
selector: protocol.stakeSelector
|
1488
2009
|
});
|
1489
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2010
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1490
2011
|
}
|
1491
2012
|
function curveSethUnstakeAndRedeem(_ref21) {
|
1492
2013
|
var comptrollerProxy = _ref21.comptrollerProxy,
|
@@ -1497,17 +2018,17 @@ function curveSethUnstakeAndRedeem(_ref21) {
|
|
1497
2018
|
minIncomingWethAmount = _ref21.minIncomingWethAmount,
|
1498
2019
|
minIncomingSethAmount = _ref21.minIncomingSethAmount,
|
1499
2020
|
receiveSingleAsset = _ref21.receiveSingleAsset;
|
1500
|
-
var callArgs = protocol
|
2021
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1501
2022
|
adapter: curveLiquiditySethAdapter,
|
1502
|
-
|
1503
|
-
encodedCallArgs: protocol$1.curveSethUnstakeAndRedeemArgs({
|
1504
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1505
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2023
|
+
encodedCallArgs: protocol.curveSethUnstakeAndRedeemArgs({
|
1506
2024
|
minIncomingSethAmount: minIncomingSethAmount,
|
2025
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2026
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1507
2027
|
receiveSingleAsset: receiveSingleAsset
|
1508
|
-
})
|
2028
|
+
}),
|
2029
|
+
selector: protocol.unstakeAndRedeemSelector
|
1509
2030
|
});
|
1510
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2031
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1511
2032
|
}
|
1512
2033
|
function curveSethUnstake(_ref22) {
|
1513
2034
|
var comptrollerProxy = _ref22.comptrollerProxy,
|
@@ -1515,14 +2036,14 @@ function curveSethUnstake(_ref22) {
|
|
1515
2036
|
fundOwner = _ref22.fundOwner,
|
1516
2037
|
curveLiquiditySethAdapter = _ref22.curveLiquiditySethAdapter,
|
1517
2038
|
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
1518
|
-
var callArgs = protocol
|
2039
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1519
2040
|
adapter: curveLiquiditySethAdapter,
|
1520
|
-
|
1521
|
-
encodedCallArgs: protocol$1.curveSethUnstakeArgs({
|
2041
|
+
encodedCallArgs: protocol.curveSethUnstakeArgs({
|
1522
2042
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1523
|
-
})
|
2043
|
+
}),
|
2044
|
+
selector: protocol.unstakeSelector
|
1524
2045
|
});
|
1525
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2046
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1526
2047
|
} // stETH pool
|
1527
2048
|
|
1528
2049
|
function curveStethClaimRewards(_ref23) {
|
@@ -1530,12 +2051,12 @@ function curveStethClaimRewards(_ref23) {
|
|
1530
2051
|
integrationManager = _ref23.integrationManager,
|
1531
2052
|
fundOwner = _ref23.fundOwner,
|
1532
2053
|
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
1533
|
-
var callArgs = protocol
|
2054
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1534
2055
|
adapter: curveLiquidityStethAdapter,
|
1535
|
-
|
1536
|
-
|
2056
|
+
encodedCallArgs: ethers.constants.HashZero,
|
2057
|
+
selector: protocol.claimRewardsSelector
|
1537
2058
|
});
|
1538
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2059
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1539
2060
|
}
|
1540
2061
|
function curveStethLend(_ref24) {
|
1541
2062
|
var comptrollerProxy = _ref24.comptrollerProxy,
|
@@ -1545,16 +2066,16 @@ function curveStethLend(_ref24) {
|
|
1545
2066
|
outgoingWethAmount = _ref24.outgoingWethAmount,
|
1546
2067
|
outgoingStethAmount = _ref24.outgoingStethAmount,
|
1547
2068
|
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
1548
|
-
var callArgs = protocol
|
2069
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1549
2070
|
adapter: curveLiquidityStethAdapter,
|
1550
|
-
|
1551
|
-
|
1552
|
-
outgoingWethAmount: outgoingWethAmount,
|
2071
|
+
encodedCallArgs: protocol.curveStethLendArgs({
|
2072
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1553
2073
|
outgoingStethAmount: outgoingStethAmount,
|
1554
|
-
|
1555
|
-
})
|
2074
|
+
outgoingWethAmount: outgoingWethAmount
|
2075
|
+
}),
|
2076
|
+
selector: protocol.lendSelector
|
1556
2077
|
});
|
1557
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2078
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1558
2079
|
}
|
1559
2080
|
function curveStethLendAndStake(_ref25) {
|
1560
2081
|
var comptrollerProxy = _ref25.comptrollerProxy,
|
@@ -1564,16 +2085,16 @@ function curveStethLendAndStake(_ref25) {
|
|
1564
2085
|
outgoingWethAmount = _ref25.outgoingWethAmount,
|
1565
2086
|
outgoingStethAmount = _ref25.outgoingStethAmount,
|
1566
2087
|
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
1567
|
-
var callArgs = protocol
|
2088
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1568
2089
|
adapter: curveLiquidityStethAdapter,
|
1569
|
-
|
1570
|
-
|
1571
|
-
outgoingWethAmount: outgoingWethAmount,
|
2090
|
+
encodedCallArgs: protocol.curveStethLendAndStakeArgs({
|
2091
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1572
2092
|
outgoingStethAmount: outgoingStethAmount,
|
1573
|
-
|
1574
|
-
})
|
2093
|
+
outgoingWethAmount: outgoingWethAmount
|
2094
|
+
}),
|
2095
|
+
selector: protocol.lendAndStakeSelector
|
1575
2096
|
});
|
1576
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2097
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1577
2098
|
}
|
1578
2099
|
function curveStethRedeem(_ref26) {
|
1579
2100
|
var comptrollerProxy = _ref26.comptrollerProxy,
|
@@ -1584,17 +2105,17 @@ function curveStethRedeem(_ref26) {
|
|
1584
2105
|
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
1585
2106
|
minIncomingStethAmount = _ref26.minIncomingStethAmount,
|
1586
2107
|
receiveSingleAsset = _ref26.receiveSingleAsset;
|
1587
|
-
var callArgs = protocol
|
2108
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1588
2109
|
adapter: curveLiquidityStethAdapter,
|
1589
|
-
|
1590
|
-
encodedCallArgs: protocol$1.curveStethRedeemArgs({
|
1591
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1592
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2110
|
+
encodedCallArgs: protocol.curveStethRedeemArgs({
|
1593
2111
|
minIncomingStethAmount: minIncomingStethAmount,
|
2112
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2113
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1594
2114
|
receiveSingleAsset: receiveSingleAsset
|
1595
|
-
})
|
2115
|
+
}),
|
2116
|
+
selector: protocol.redeemSelector
|
1596
2117
|
});
|
1597
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2118
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1598
2119
|
}
|
1599
2120
|
function curveStethStake(_ref27) {
|
1600
2121
|
var comptrollerProxy = _ref27.comptrollerProxy,
|
@@ -1602,14 +2123,14 @@ function curveStethStake(_ref27) {
|
|
1602
2123
|
fundOwner = _ref27.fundOwner,
|
1603
2124
|
curveLiquidityStethAdapter = _ref27.curveLiquidityStethAdapter,
|
1604
2125
|
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
1605
|
-
var callArgs = protocol
|
2126
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1606
2127
|
adapter: curveLiquidityStethAdapter,
|
1607
|
-
|
1608
|
-
encodedCallArgs: protocol$1.curveStethStakeArgs({
|
2128
|
+
encodedCallArgs: protocol.curveStethStakeArgs({
|
1609
2129
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1610
|
-
})
|
2130
|
+
}),
|
2131
|
+
selector: protocol.stakeSelector
|
1611
2132
|
});
|
1612
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2133
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1613
2134
|
}
|
1614
2135
|
function curveStethUnstakeAndRedeem(_ref28) {
|
1615
2136
|
var comptrollerProxy = _ref28.comptrollerProxy,
|
@@ -1620,17 +2141,17 @@ function curveStethUnstakeAndRedeem(_ref28) {
|
|
1620
2141
|
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
1621
2142
|
minIncomingStethAmount = _ref28.minIncomingStethAmount,
|
1622
2143
|
receiveSingleAsset = _ref28.receiveSingleAsset;
|
1623
|
-
var callArgs = protocol
|
2144
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1624
2145
|
adapter: curveLiquidityStethAdapter,
|
1625
|
-
|
1626
|
-
encodedCallArgs: protocol$1.curveStethUnstakeAndRedeemArgs({
|
1627
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1628
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2146
|
+
encodedCallArgs: protocol.curveStethUnstakeAndRedeemArgs({
|
1629
2147
|
minIncomingStethAmount: minIncomingStethAmount,
|
2148
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2149
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1630
2150
|
receiveSingleAsset: receiveSingleAsset
|
1631
|
-
})
|
2151
|
+
}),
|
2152
|
+
selector: protocol.unstakeAndRedeemSelector
|
1632
2153
|
});
|
1633
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2154
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1634
2155
|
}
|
1635
2156
|
function curveStethUnstake(_ref29) {
|
1636
2157
|
var comptrollerProxy = _ref29.comptrollerProxy,
|
@@ -1638,14 +2159,14 @@ function curveStethUnstake(_ref29) {
|
|
1638
2159
|
fundOwner = _ref29.fundOwner,
|
1639
2160
|
curveLiquidityStethAdapter = _ref29.curveLiquidityStethAdapter,
|
1640
2161
|
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
1641
|
-
var callArgs = protocol
|
2162
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
1642
2163
|
adapter: curveLiquidityStethAdapter,
|
1643
|
-
|
1644
|
-
encodedCallArgs: protocol$1.curveStethUnstakeArgs({
|
2164
|
+
encodedCallArgs: protocol.curveStethUnstakeArgs({
|
1645
2165
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1646
|
-
})
|
2166
|
+
}),
|
2167
|
+
selector: protocol.unstakeSelector
|
1647
2168
|
});
|
1648
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2169
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1649
2170
|
}
|
1650
2171
|
|
1651
2172
|
function idleClaimRewards(_x) {
|
@@ -1660,14 +2181,14 @@ function _idleClaimRewards() {
|
|
1660
2181
|
switch (_context.prev = _context.next) {
|
1661
2182
|
case 0:
|
1662
2183
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
1663
|
-
callArgs = protocol
|
2184
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1664
2185
|
adapter: idleAdapter,
|
1665
|
-
|
1666
|
-
encodedCallArgs: protocol$1.idleClaimRewardsArgs({
|
2186
|
+
encodedCallArgs: protocol.idleClaimRewardsArgs({
|
1667
2187
|
idleToken: idleToken
|
1668
|
-
})
|
2188
|
+
}),
|
2189
|
+
selector: protocol.claimRewardsSelector
|
1669
2190
|
});
|
1670
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2191
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1671
2192
|
|
1672
2193
|
case 3:
|
1673
2194
|
case "end":
|
@@ -1692,16 +2213,16 @@ function _idleLend() {
|
|
1692
2213
|
switch (_context2.prev = _context2.next) {
|
1693
2214
|
case 0:
|
1694
2215
|
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 ? ethers.BigNumber.from(1) : _ref2$minIncomingIdle;
|
1695
|
-
callArgs = protocol
|
2216
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1696
2217
|
adapter: idleAdapter,
|
1697
|
-
|
1698
|
-
encodedCallArgs: protocol$1.idleLendArgs({
|
2218
|
+
encodedCallArgs: protocol.idleLendArgs({
|
1699
2219
|
idleToken: idleToken,
|
1700
|
-
|
1701
|
-
|
1702
|
-
})
|
2220
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
2221
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
2222
|
+
}),
|
2223
|
+
selector: protocol.lendSelector
|
1703
2224
|
});
|
1704
|
-
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2225
|
+
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1705
2226
|
|
1706
2227
|
case 3:
|
1707
2228
|
case "end":
|
@@ -1726,16 +2247,16 @@ function _idleRedeem() {
|
|
1726
2247
|
switch (_context3.prev = _context3.next) {
|
1727
2248
|
case 0:
|
1728
2249
|
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 ? ethers.BigNumber.from(1) : _ref3$minIncomingUnde;
|
1729
|
-
callArgs = protocol
|
2250
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1730
2251
|
adapter: idleAdapter,
|
1731
|
-
|
1732
|
-
encodedCallArgs: protocol$1.idleRedeemArgs({
|
2252
|
+
encodedCallArgs: protocol.idleRedeemArgs({
|
1733
2253
|
idleToken: idleToken,
|
1734
|
-
|
1735
|
-
|
1736
|
-
})
|
2254
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2255
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
2256
|
+
}),
|
2257
|
+
selector: protocol.redeemSelector
|
1737
2258
|
});
|
1738
|
-
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2259
|
+
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1739
2260
|
|
1740
2261
|
case 3:
|
1741
2262
|
case "end":
|
@@ -1747,11 +2268,11 @@ function _idleRedeem() {
|
|
1747
2268
|
return _idleRedeem.apply(this, arguments);
|
1748
2269
|
}
|
1749
2270
|
|
1750
|
-
var mockGenericRemoveOnlySelector = protocol
|
1751
|
-
var mockGenericSwapASelector = protocol
|
1752
|
-
var mockGenericSwapBSelector = protocol
|
1753
|
-
var mockGenericSwapDirectFromVaultSelector = protocol
|
1754
|
-
var mockGenericSwapViaApprovalSelector = protocol
|
2271
|
+
var mockGenericRemoveOnlySelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('removeOnly(address,bytes,bytes)'));
|
2272
|
+
var mockGenericSwapASelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapA(address,bytes,bytes)'));
|
2273
|
+
var mockGenericSwapBSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapB(address,bytes,bytes)'));
|
2274
|
+
var mockGenericSwapDirectFromVaultSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapDirectFromVault(address,bytes,bytes)'));
|
2275
|
+
var mockGenericSwapViaApprovalSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapViaApproval(address,bytes,bytes)'));
|
1755
2276
|
function mockGenericSwapArgs(_ref) {
|
1756
2277
|
var _ref$spendAssets = _ref.spendAssets,
|
1757
2278
|
spendAssets = _ref$spendAssets === void 0 ? [] : _ref$spendAssets,
|
@@ -1765,7 +2286,7 @@ function mockGenericSwapArgs(_ref) {
|
|
1765
2286
|
actualIncomingAssetAmounts = _ref$actualIncomingAs === void 0 ? [] : _ref$actualIncomingAs,
|
1766
2287
|
_ref$minIncomingAsset = _ref.minIncomingAssetAmounts,
|
1767
2288
|
minIncomingAssetAmounts = _ref$minIncomingAsset === void 0 ? actualIncomingAssetAmounts : _ref$minIncomingAsset;
|
1768
|
-
return protocol
|
2289
|
+
return protocol.encodeArgs(['address[]', 'uint256[]', 'uint256[]', 'address[]', 'uint256[]', 'uint256[]'], [spendAssets, maxSpendAssetAmounts, actualSpendAssetAmounts, incomingAssets, minIncomingAssetAmounts, actualIncomingAssetAmounts]);
|
1769
2290
|
}
|
1770
2291
|
function mockGenericSwap(_x) {
|
1771
2292
|
return _mockGenericSwap.apply(this, arguments);
|
@@ -1804,19 +2325,19 @@ function _mockGenericSwap() {
|
|
1804
2325
|
|
1805
2326
|
case 9:
|
1806
2327
|
swapArgs = mockGenericSwapArgs({
|
1807
|
-
|
1808
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2328
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
1809
2329
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
1810
2330
|
incomingAssets: incomingAssets,
|
2331
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
1811
2332
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
1812
|
-
|
2333
|
+
spendAssets: spendAssets
|
1813
2334
|
});
|
1814
|
-
callArgs = protocol
|
2335
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1815
2336
|
adapter: mockGenericAdapter,
|
1816
|
-
|
1817
|
-
|
2337
|
+
encodedCallArgs: swapArgs,
|
2338
|
+
selector: selector
|
1818
2339
|
});
|
1819
|
-
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2340
|
+
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1820
2341
|
_context.next = 14;
|
1821
2342
|
return expect(swapTx).resolves.toBeReceipt();
|
1822
2343
|
|
@@ -1837,10 +2358,10 @@ function paraSwapV4GenerateDummyPaths(_ref) {
|
|
1837
2358
|
var toTokens = _ref.toTokens;
|
1838
2359
|
return toTokens.map(function (toToken) {
|
1839
2360
|
return {
|
1840
|
-
to: toToken,
|
1841
|
-
totalNetworkFee: 0,
|
1842
2361
|
// Not supported in our protocol
|
1843
|
-
routes: []
|
2362
|
+
routes: [],
|
2363
|
+
to: toToken,
|
2364
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
1844
2365
|
|
1845
2366
|
};
|
1846
2367
|
});
|
@@ -1858,19 +2379,19 @@ function _paraSwapV4TakeOrder() {
|
|
1858
2379
|
switch (_context.prev = _context.next) {
|
1859
2380
|
case 0:
|
1860
2381
|
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV4Adapter = _ref2.paraSwapV4Adapter, outgoingAsset = _ref2.outgoingAsset, _ref2$outgoingAssetAm = _ref2.outgoingAssetAmount, outgoingAssetAmount = _ref2$outgoingAssetAm === void 0 ? ethers.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;
|
1861
|
-
takeOrderArgs = protocol
|
1862
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2382
|
+
takeOrderArgs = protocol.paraSwapV4TakeOrderArgs({
|
1863
2383
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2384
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1864
2385
|
outgoingAsset: outgoingAsset,
|
1865
2386
|
outgoingAssetAmount: outgoingAssetAmount,
|
1866
2387
|
paths: paths
|
1867
2388
|
});
|
1868
|
-
callArgs = protocol
|
2389
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1869
2390
|
adapter: paraSwapV4Adapter,
|
1870
|
-
|
1871
|
-
|
2391
|
+
encodedCallArgs: takeOrderArgs,
|
2392
|
+
selector: protocol.takeOrderSelector
|
1872
2393
|
});
|
1873
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2394
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1874
2395
|
|
1875
2396
|
case 4:
|
1876
2397
|
case "end":
|
@@ -1882,6 +2403,161 @@ function _paraSwapV4TakeOrder() {
|
|
1882
2403
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
1883
2404
|
}
|
1884
2405
|
|
2406
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
2407
|
+
var toTokens = _ref.toTokens;
|
2408
|
+
return toTokens.map(function (toToken) {
|
2409
|
+
return {
|
2410
|
+
// Not supported in our protocol
|
2411
|
+
adapters: [],
|
2412
|
+
to: toToken,
|
2413
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2414
|
+
|
2415
|
+
};
|
2416
|
+
});
|
2417
|
+
}
|
2418
|
+
function paraSwapV5TakeOrder(_x) {
|
2419
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2420
|
+
}
|
2421
|
+
|
2422
|
+
function _paraSwapV5TakeOrder() {
|
2423
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
2424
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
2425
|
+
|
2426
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2427
|
+
while (1) {
|
2428
|
+
switch (_context.prev = _context.next) {
|
2429
|
+
case 0:
|
2430
|
+
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 ? ethers.utils.randomBytes(16) : _ref2$uuid, paths = _ref2.paths;
|
2431
|
+
takeOrderArgs = protocol.paraSwapV5TakeOrderArgs({
|
2432
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2433
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2434
|
+
outgoingAsset: outgoingAsset,
|
2435
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
2436
|
+
paths: paths,
|
2437
|
+
uuid: uuid
|
2438
|
+
});
|
2439
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2440
|
+
adapter: paraSwapV5Adapter,
|
2441
|
+
encodedCallArgs: takeOrderArgs,
|
2442
|
+
selector: protocol.takeOrderSelector
|
2443
|
+
});
|
2444
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2445
|
+
|
2446
|
+
case 4:
|
2447
|
+
case "end":
|
2448
|
+
return _context.stop();
|
2449
|
+
}
|
2450
|
+
}
|
2451
|
+
}, _callee);
|
2452
|
+
}));
|
2453
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2454
|
+
}
|
2455
|
+
|
2456
|
+
function poolTogetherV4Lend(_x) {
|
2457
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2458
|
+
}
|
2459
|
+
|
2460
|
+
function _poolTogetherV4Lend() {
|
2461
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2462
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
2463
|
+
|
2464
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2465
|
+
while (1) {
|
2466
|
+
switch (_context.prev = _context.next) {
|
2467
|
+
case 0:
|
2468
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, poolTogetherV4Adapter = _ref.poolTogetherV4Adapter, ptToken = _ref.ptToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? ethers.utils.parseEther('1') : _ref$amount;
|
2469
|
+
lendArgs = protocol.poolTogetherV4LendArgs({
|
2470
|
+
amount: amount,
|
2471
|
+
ptToken: ptToken
|
2472
|
+
});
|
2473
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2474
|
+
adapter: poolTogetherV4Adapter,
|
2475
|
+
encodedCallArgs: lendArgs,
|
2476
|
+
selector: protocol.lendSelector
|
2477
|
+
});
|
2478
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2479
|
+
return _context.abrupt("return", lendTx);
|
2480
|
+
|
2481
|
+
case 5:
|
2482
|
+
case "end":
|
2483
|
+
return _context.stop();
|
2484
|
+
}
|
2485
|
+
}
|
2486
|
+
}, _callee);
|
2487
|
+
}));
|
2488
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2489
|
+
}
|
2490
|
+
|
2491
|
+
function poolTogetherV4Redeem(_x2) {
|
2492
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2493
|
+
}
|
2494
|
+
|
2495
|
+
function _poolTogetherV4Redeem() {
|
2496
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2497
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
2498
|
+
|
2499
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2500
|
+
while (1) {
|
2501
|
+
switch (_context2.prev = _context2.next) {
|
2502
|
+
case 0:
|
2503
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, poolTogetherV4Adapter = _ref2.poolTogetherV4Adapter, ptToken = _ref2.ptToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? ethers.utils.parseEther('1') : _ref2$amount;
|
2504
|
+
redeemArgs = protocol.poolTogetherV4RedeemArgs({
|
2505
|
+
amount: amount,
|
2506
|
+
ptToken: ptToken
|
2507
|
+
});
|
2508
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2509
|
+
adapter: poolTogetherV4Adapter,
|
2510
|
+
encodedCallArgs: redeemArgs,
|
2511
|
+
selector: protocol.redeemSelector
|
2512
|
+
});
|
2513
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2514
|
+
return _context2.abrupt("return", redeemTx);
|
2515
|
+
|
2516
|
+
case 5:
|
2517
|
+
case "end":
|
2518
|
+
return _context2.stop();
|
2519
|
+
}
|
2520
|
+
}
|
2521
|
+
}, _callee2);
|
2522
|
+
}));
|
2523
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2524
|
+
}
|
2525
|
+
|
2526
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
2527
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2528
|
+
}
|
2529
|
+
|
2530
|
+
function _poolTogetherV4ClaimRewards() {
|
2531
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2532
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
2533
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2534
|
+
while (1) {
|
2535
|
+
switch (_context3.prev = _context3.next) {
|
2536
|
+
case 0:
|
2537
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
2538
|
+
claimRewardsArgs = protocol.poolTogetherV4ClaimRewardsArgs({
|
2539
|
+
drawIds: drawIds,
|
2540
|
+
prizeDistributor: prizeDistributor,
|
2541
|
+
winningPicks: winningPicks
|
2542
|
+
});
|
2543
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2544
|
+
adapter: poolTogetherV4Adapter,
|
2545
|
+
encodedCallArgs: claimRewardsArgs,
|
2546
|
+
selector: protocol.claimRewardsSelector
|
2547
|
+
});
|
2548
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2549
|
+
return _context3.abrupt("return", claimTx);
|
2550
|
+
|
2551
|
+
case 5:
|
2552
|
+
case "end":
|
2553
|
+
return _context3.stop();
|
2554
|
+
}
|
2555
|
+
}
|
2556
|
+
}, _callee3);
|
2557
|
+
}));
|
2558
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2559
|
+
}
|
2560
|
+
|
1885
2561
|
function synthetixAssignExchangeDelegate(_x) {
|
1886
2562
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
1887
2563
|
}
|
@@ -1903,7 +2579,7 @@ function _synthetixAssignExchangeDelegate() {
|
|
1903
2579
|
case 3:
|
1904
2580
|
delegateApprovals = _context.sent;
|
1905
2581
|
_context.next = 6;
|
1906
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, protocol
|
2582
|
+
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, protocol.synthetixAssignExchangeDelegateSelector, protocol.encodeArgs(['address'], [delegate]));
|
1907
2583
|
|
1908
2584
|
case 6:
|
1909
2585
|
case "end":
|
@@ -1939,52 +2615,84 @@ function _synthetixResolveAddress() {
|
|
1939
2615
|
return _synthetixResolveAddress.apply(this, arguments);
|
1940
2616
|
}
|
1941
2617
|
|
1942
|
-
function
|
2618
|
+
function synthetixRedeem(_x3) {
|
2619
|
+
return _synthetixRedeem.apply(this, arguments);
|
2620
|
+
}
|
2621
|
+
|
2622
|
+
function _synthetixRedeem() {
|
2623
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2624
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
2625
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2626
|
+
while (1) {
|
2627
|
+
switch (_context3.prev = _context3.next) {
|
2628
|
+
case 0:
|
2629
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, signer = _ref3.signer, synthetixAdapter = _ref3.synthetixAdapter, synths = _ref3.synths;
|
2630
|
+
redeemArgs = protocol.synthetixRedeemArgs({
|
2631
|
+
synths: synths
|
2632
|
+
});
|
2633
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2634
|
+
adapter: synthetixAdapter,
|
2635
|
+
encodedCallArgs: redeemArgs,
|
2636
|
+
selector: protocol.redeemSelector
|
2637
|
+
});
|
2638
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2639
|
+
|
2640
|
+
case 4:
|
2641
|
+
case "end":
|
2642
|
+
return _context3.stop();
|
2643
|
+
}
|
2644
|
+
}
|
2645
|
+
}, _callee3);
|
2646
|
+
}));
|
2647
|
+
return _synthetixRedeem.apply(this, arguments);
|
2648
|
+
}
|
2649
|
+
|
2650
|
+
function synthetixTakeOrder(_x4) {
|
1943
2651
|
return _synthetixTakeOrder.apply(this, arguments);
|
1944
2652
|
}
|
1945
2653
|
|
1946
2654
|
function _synthetixTakeOrder() {
|
1947
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
1948
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
2655
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
2656
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref4$outgoingAssetAm, outgoingAssetAmount, incomingAsset, _ref4$minIncomingAsse, minIncomingAssetAmount, _ref4$seedFund, seedFund, takeOrderArgs, callArgs;
|
1949
2657
|
|
1950
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
2658
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1951
2659
|
while (1) {
|
1952
|
-
switch (
|
2660
|
+
switch (_context4.prev = _context4.next) {
|
1953
2661
|
case 0:
|
1954
|
-
comptrollerProxy =
|
2662
|
+
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 ? ethers.utils.parseEther('1') : _ref4$outgoingAssetAm, incomingAsset = _ref4.incomingAsset, _ref4$minIncomingAsse = _ref4.minIncomingAssetAmount, minIncomingAssetAmount = _ref4$minIncomingAsse === void 0 ? ethers.utils.parseEther('1') : _ref4$minIncomingAsse, _ref4$seedFund = _ref4.seedFund, seedFund = _ref4$seedFund === void 0 ? false : _ref4$seedFund;
|
1955
2663
|
|
1956
2664
|
if (!seedFund) {
|
1957
|
-
|
2665
|
+
_context4.next = 4;
|
1958
2666
|
break;
|
1959
2667
|
}
|
1960
2668
|
|
1961
|
-
|
2669
|
+
_context4.next = 4;
|
1962
2670
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
1963
2671
|
|
1964
2672
|
case 4:
|
1965
|
-
takeOrderArgs = protocol
|
2673
|
+
takeOrderArgs = protocol.synthetixTakeOrderArgs({
|
1966
2674
|
incomingAsset: incomingAsset,
|
1967
2675
|
minIncomingAssetAmount: minIncomingAssetAmount,
|
1968
2676
|
outgoingAsset: outgoingAsset,
|
1969
2677
|
outgoingAssetAmount: outgoingAssetAmount
|
1970
2678
|
});
|
1971
|
-
|
1972
|
-
return protocol
|
2679
|
+
_context4.next = 7;
|
2680
|
+
return protocol.callOnIntegrationArgs({
|
1973
2681
|
adapter: synthetixAdapter,
|
1974
|
-
|
1975
|
-
|
2682
|
+
encodedCallArgs: takeOrderArgs,
|
2683
|
+
selector: protocol.takeOrderSelector
|
1976
2684
|
});
|
1977
2685
|
|
1978
2686
|
case 7:
|
1979
|
-
callArgs =
|
1980
|
-
return
|
2687
|
+
callArgs = _context4.sent;
|
2688
|
+
return _context4.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1981
2689
|
|
1982
2690
|
case 9:
|
1983
2691
|
case "end":
|
1984
|
-
return
|
2692
|
+
return _context4.stop();
|
1985
2693
|
}
|
1986
2694
|
}
|
1987
|
-
},
|
2695
|
+
}, _callee4);
|
1988
2696
|
}));
|
1989
2697
|
return _synthetixTakeOrder.apply(this, arguments);
|
1990
2698
|
}
|
@@ -1997,13 +2705,13 @@ function uniswapV2Lend(_x) {
|
|
1997
2705
|
|
1998
2706
|
function _uniswapV2Lend() {
|
1999
2707
|
_uniswapV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2000
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
2708
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, minPoolTokenAmount, _ref$seedFund, seedFund, lendArgs, callArgs, lendTx;
|
2001
2709
|
|
2002
2710
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2003
2711
|
while (1) {
|
2004
2712
|
switch (_context.prev = _context.next) {
|
2005
2713
|
case 0:
|
2006
|
-
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner,
|
2714
|
+
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;
|
2007
2715
|
|
2008
2716
|
if (!seedFund) {
|
2009
2717
|
_context.next = 6;
|
@@ -2018,21 +2726,21 @@ function _uniswapV2Lend() {
|
|
2018
2726
|
return tokenB.transfer(vaultProxy, amountBDesired);
|
2019
2727
|
|
2020
2728
|
case 6:
|
2021
|
-
lendArgs = protocol
|
2022
|
-
tokenA: tokenA,
|
2023
|
-
tokenB: tokenB,
|
2729
|
+
lendArgs = protocol.uniswapV2LendArgs({
|
2024
2730
|
amountADesired: amountADesired,
|
2025
|
-
amountBDesired: amountBDesired,
|
2026
2731
|
amountAMin: amountAMin,
|
2732
|
+
amountBDesired: amountBDesired,
|
2027
2733
|
amountBMin: amountBMin,
|
2028
|
-
minPoolTokenAmount: minPoolTokenAmount
|
2734
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
2735
|
+
tokenA: tokenA,
|
2736
|
+
tokenB: tokenB
|
2029
2737
|
});
|
2030
|
-
callArgs = protocol
|
2031
|
-
adapter:
|
2032
|
-
|
2033
|
-
|
2738
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2739
|
+
adapter: uniswapV2LiquidityAdapter,
|
2740
|
+
encodedCallArgs: lendArgs,
|
2741
|
+
selector: protocol.lendSelector
|
2034
2742
|
});
|
2035
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2743
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2036
2744
|
_context.next = 11;
|
2037
2745
|
return expect(lendTx).resolves.toBeReceipt();
|
2038
2746
|
|
@@ -2055,25 +2763,25 @@ function uniswapV2Redeem(_x2) {
|
|
2055
2763
|
|
2056
2764
|
function _uniswapV2Redeem() {
|
2057
2765
|
_uniswapV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2058
|
-
var comptrollerProxy, integrationManager, fundOwner,
|
2766
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, poolTokenAmount, tokenA, tokenB, amountAMin, amountBMin, redeemArgs, callArgs, redeemTx;
|
2059
2767
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2060
2768
|
while (1) {
|
2061
2769
|
switch (_context2.prev = _context2.next) {
|
2062
2770
|
case 0:
|
2063
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner,
|
2064
|
-
redeemArgs = protocol
|
2771
|
+
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;
|
2772
|
+
redeemArgs = protocol.uniswapV2RedeemArgs({
|
2773
|
+
amountAMin: amountAMin,
|
2774
|
+
amountBMin: amountBMin,
|
2065
2775
|
poolTokenAmount: poolTokenAmount,
|
2066
2776
|
tokenA: tokenA,
|
2067
|
-
tokenB: tokenB
|
2068
|
-
amountAMin: amountAMin,
|
2069
|
-
amountBMin: amountBMin
|
2777
|
+
tokenB: tokenB
|
2070
2778
|
});
|
2071
|
-
callArgs = protocol
|
2072
|
-
adapter:
|
2073
|
-
|
2074
|
-
|
2779
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2780
|
+
adapter: uniswapV2LiquidityAdapter,
|
2781
|
+
encodedCallArgs: redeemArgs,
|
2782
|
+
selector: protocol.redeemSelector
|
2075
2783
|
});
|
2076
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2784
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2077
2785
|
_context2.next = 6;
|
2078
2786
|
return expect(redeemTx).resolves.toBeReceipt();
|
2079
2787
|
|
@@ -2096,13 +2804,13 @@ function uniswapV2TakeOrder(_x3) {
|
|
2096
2804
|
|
2097
2805
|
function _uniswapV2TakeOrder() {
|
2098
2806
|
_uniswapV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2099
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
2807
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2ExchangeAdapter, path, outgoingAssetAmount, minIncomingAssetAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
2100
2808
|
|
2101
2809
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2102
2810
|
while (1) {
|
2103
2811
|
switch (_context3.prev = _context3.next) {
|
2104
2812
|
case 0:
|
2105
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner,
|
2813
|
+
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;
|
2106
2814
|
|
2107
2815
|
if (!seedFund) {
|
2108
2816
|
_context3.next = 4;
|
@@ -2113,17 +2821,17 @@ function _uniswapV2TakeOrder() {
|
|
2113
2821
|
return path[0].transfer(vaultProxy, outgoingAssetAmount);
|
2114
2822
|
|
2115
2823
|
case 4:
|
2116
|
-
takeOrderArgs = protocol
|
2117
|
-
|
2824
|
+
takeOrderArgs = protocol.uniswapV2TakeOrderArgs({
|
2825
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2118
2826
|
outgoingAssetAmount: outgoingAssetAmount,
|
2119
|
-
|
2827
|
+
path: path
|
2120
2828
|
});
|
2121
|
-
callArgs = protocol
|
2122
|
-
adapter:
|
2123
|
-
|
2124
|
-
|
2829
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2830
|
+
adapter: uniswapV2ExchangeAdapter,
|
2831
|
+
encodedCallArgs: takeOrderArgs,
|
2832
|
+
selector: protocol.takeOrderSelector
|
2125
2833
|
});
|
2126
|
-
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2834
|
+
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2127
2835
|
|
2128
2836
|
case 7:
|
2129
2837
|
case "end":
|
@@ -2141,7 +2849,7 @@ function uniswapV3TakeOrder(_x) {
|
|
2141
2849
|
|
2142
2850
|
function _uniswapV3TakeOrder() {
|
2143
2851
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2144
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
2852
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
2145
2853
|
|
2146
2854
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2147
2855
|
while (1) {
|
@@ -2150,35 +2858,33 @@ function _uniswapV3TakeOrder() {
|
|
2150
2858
|
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;
|
2151
2859
|
|
2152
2860
|
if (!seedFund) {
|
2153
|
-
_context.next =
|
2861
|
+
_context.next = 7;
|
2154
2862
|
break;
|
2155
2863
|
}
|
2156
2864
|
|
2157
|
-
_context.
|
2158
|
-
_context.next = 5;
|
2865
|
+
_context.next = 4;
|
2159
2866
|
return comptrollerProxy.getVaultProxy();
|
2160
2867
|
|
2161
|
-
case
|
2162
|
-
|
2163
|
-
_context.
|
2164
|
-
|
2165
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
2868
|
+
case 4:
|
2869
|
+
vaultProxy = _context.sent;
|
2870
|
+
_context.next = 7;
|
2871
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
2166
2872
|
|
2167
|
-
case
|
2168
|
-
takeOrderArgs = protocol
|
2169
|
-
|
2170
|
-
pathFees: pathFees,
|
2873
|
+
case 7:
|
2874
|
+
takeOrderArgs = protocol.uniswapV3TakeOrderArgs({
|
2875
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2171
2876
|
outgoingAssetAmount: outgoingAssetAmount,
|
2172
|
-
|
2877
|
+
pathAddresses: pathAddresses,
|
2878
|
+
pathFees: pathFees
|
2173
2879
|
});
|
2174
|
-
callArgs = protocol
|
2880
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2175
2881
|
adapter: uniswapV3Adapter,
|
2176
|
-
|
2177
|
-
|
2882
|
+
encodedCallArgs: takeOrderArgs,
|
2883
|
+
selector: protocol.takeOrderSelector
|
2178
2884
|
});
|
2179
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2885
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2180
2886
|
|
2181
|
-
case
|
2887
|
+
case 10:
|
2182
2888
|
case "end":
|
2183
2889
|
return _context.stop();
|
2184
2890
|
}
|
@@ -2201,16 +2907,16 @@ function _yearnVaultV2Lend() {
|
|
2201
2907
|
switch (_context.prev = _context.next) {
|
2202
2908
|
case 0:
|
2203
2909
|
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 ? ethers.BigNumber.from(1) : _ref$minIncomingYVaul;
|
2204
|
-
callArgs = protocol
|
2910
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2205
2911
|
adapter: yearnVaultV2Adapter,
|
2206
|
-
|
2207
|
-
|
2208
|
-
yVault: yVault,
|
2912
|
+
encodedCallArgs: protocol.yearnVaultV2LendArgs({
|
2913
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
2209
2914
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
2210
|
-
|
2211
|
-
})
|
2915
|
+
yVault: yVault
|
2916
|
+
}),
|
2917
|
+
selector: protocol.lendSelector
|
2212
2918
|
});
|
2213
|
-
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol
|
2919
|
+
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2214
2920
|
|
2215
2921
|
case 3:
|
2216
2922
|
case "end":
|
@@ -2235,17 +2941,17 @@ function _yearnVaultV2Redeem() {
|
|
2235
2941
|
switch (_context2.prev = _context2.next) {
|
2236
2942
|
case 0:
|
2237
2943
|
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 ? ethers.BigNumber.from(1) : _ref2$minIncomingUnde, _ref2$slippageToleran = _ref2.slippageToleranceBps, slippageToleranceBps = _ref2$slippageToleran === void 0 ? 1 : _ref2$slippageToleran;
|
2238
|
-
callArgs = protocol
|
2944
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2239
2945
|
adapter: yearnVaultV2Adapter,
|
2240
|
-
|
2241
|
-
encodedCallArgs: protocol$1.yearnVaultV2RedeemArgs({
|
2242
|
-
yVault: yVault,
|
2946
|
+
encodedCallArgs: protocol.yearnVaultV2RedeemArgs({
|
2243
2947
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
2244
2948
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2245
|
-
slippageToleranceBps: slippageToleranceBps
|
2246
|
-
|
2949
|
+
slippageToleranceBps: slippageToleranceBps,
|
2950
|
+
yVault: yVault
|
2951
|
+
}),
|
2952
|
+
selector: protocol.redeemSelector
|
2247
2953
|
});
|
2248
|
-
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol
|
2954
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2249
2955
|
|
2250
2956
|
case 3:
|
2251
2957
|
case "end":
|
@@ -2269,16 +2975,16 @@ function _zeroExV2TakeOrder() {
|
|
2269
2975
|
switch (_context.prev = _context.next) {
|
2270
2976
|
case 0:
|
2271
2977
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, zeroExV2Adapter = _ref.zeroExV2Adapter, signedOrder = _ref.signedOrder, takerAssetFillAmount = _ref.takerAssetFillAmount;
|
2272
|
-
takeOrderArgs = protocol
|
2978
|
+
takeOrderArgs = protocol.zeroExV2TakeOrderArgs({
|
2273
2979
|
signedOrder: signedOrder,
|
2274
2980
|
takerAssetFillAmount: takerAssetFillAmount
|
2275
2981
|
});
|
2276
|
-
callArgs = protocol
|
2982
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2277
2983
|
adapter: zeroExV2Adapter,
|
2278
|
-
|
2279
|
-
|
2984
|
+
encodedCallArgs: takeOrderArgs,
|
2985
|
+
selector: protocol.takeOrderSelector
|
2280
2986
|
});
|
2281
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol
|
2987
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2282
2988
|
|
2283
2989
|
case 4:
|
2284
2990
|
case "end":
|
@@ -2313,7 +3019,7 @@ function _generatePolicyManagerConfigWithMockPolicies() {
|
|
2313
3019
|
policies = _context.t0.values.call(_context.t0, _context.t1);
|
2314
3020
|
// Guarantees one policy has settings data
|
2315
3021
|
policiesSettingsData = [].concat(_toConsumableArray(new Array(policies.length - 1).fill(ethers.constants.HashZero)), [ethers.utils.randomBytes(10)]);
|
2316
|
-
return _context.abrupt("return", protocol
|
3022
|
+
return _context.abrupt("return", protocol.policyManagerConfigArgs({
|
2317
3023
|
policies: policies,
|
2318
3024
|
settings: policiesSettingsData
|
2319
3025
|
}));
|
@@ -2341,55 +3047,55 @@ function _generateMockPolicies() {
|
|
2341
3047
|
case 0:
|
2342
3048
|
deployer = _ref2.deployer;
|
2343
3049
|
_context2.next = 3;
|
2344
|
-
return protocol
|
3050
|
+
return protocol.IPolicy.mock(deployer);
|
2345
3051
|
|
2346
3052
|
case 3:
|
2347
3053
|
mockAddTrackedAssetsPolicy = _context2.sent;
|
2348
3054
|
_context2.next = 6;
|
2349
|
-
return protocol
|
3055
|
+
return protocol.IPolicy.mock(deployer);
|
2350
3056
|
|
2351
3057
|
case 6:
|
2352
3058
|
mockCreateExternalPositionPolicy = _context2.sent;
|
2353
3059
|
_context2.next = 9;
|
2354
|
-
return protocol
|
3060
|
+
return protocol.IPolicy.mock(deployer);
|
2355
3061
|
|
2356
3062
|
case 9:
|
2357
3063
|
mockPostBuySharesPolicy = _context2.sent;
|
2358
3064
|
_context2.next = 12;
|
2359
|
-
return protocol
|
3065
|
+
return protocol.IPolicy.mock(deployer);
|
2360
3066
|
|
2361
3067
|
case 12:
|
2362
3068
|
mockPostCallOnExternalPositionPolicy = _context2.sent;
|
2363
3069
|
_context2.next = 15;
|
2364
|
-
return protocol
|
3070
|
+
return protocol.IPolicy.mock(deployer);
|
2365
3071
|
|
2366
3072
|
case 15:
|
2367
3073
|
mockPostCoIPolicy = _context2.sent;
|
2368
3074
|
_context2.next = 18;
|
2369
|
-
return protocol
|
3075
|
+
return protocol.IPolicy.mock(deployer);
|
2370
3076
|
|
2371
3077
|
case 18:
|
2372
3078
|
mockRedeemSharesForSpecificAssetsPolicy = _context2.sent;
|
2373
3079
|
_context2.next = 21;
|
2374
|
-
return protocol
|
3080
|
+
return protocol.IPolicy.mock(deployer);
|
2375
3081
|
|
2376
3082
|
case 21:
|
2377
3083
|
mockPreTransferSharesPolicy = _context2.sent;
|
2378
3084
|
_context2.next = 24;
|
2379
|
-
return protocol
|
3085
|
+
return protocol.IPolicy.mock(deployer);
|
2380
3086
|
|
2381
3087
|
case 24:
|
2382
3088
|
mockRemoveExternalPositionPolicy = _context2.sent;
|
2383
3089
|
_context2.next = 27;
|
2384
3090
|
return Promise.all([// AddTrackedAssets
|
2385
|
-
mockAddTrackedAssetsPolicy.identifier.returns("MOCK_ADD_TRACKED_ASSETS"), mockAddTrackedAssetsPolicy.addFundSettings.returns(undefined), mockAddTrackedAssetsPolicy.activateForFund.returns(undefined), mockAddTrackedAssetsPolicy.canDisable.returns(false), mockAddTrackedAssetsPolicy.validateRule.returns(true), mockAddTrackedAssetsPolicy.implementedHooks.returns([protocol
|
2386
|
-
mockCreateExternalPositionPolicy.identifier.returns("MOCK_CREATE_EXTERNAL_POSITION"), mockCreateExternalPositionPolicy.addFundSettings.returns(undefined), mockCreateExternalPositionPolicy.activateForFund.returns(undefined), mockCreateExternalPositionPolicy.canDisable.returns(false), mockCreateExternalPositionPolicy.validateRule.returns(true), mockCreateExternalPositionPolicy.implementedHooks.returns([protocol
|
2387
|
-
mockPostBuySharesPolicy.identifier.returns("MOCK_POST_BUY_SHARES"), mockPostBuySharesPolicy.addFundSettings.returns(undefined), mockPostBuySharesPolicy.activateForFund.returns(undefined), mockPostBuySharesPolicy.canDisable.returns(false), mockPostBuySharesPolicy.validateRule.returns(true), mockPostBuySharesPolicy.implementedHooks.returns([protocol
|
2388
|
-
mockPostCallOnExternalPositionPolicy.identifier.returns("MOCK_POST_CALL_ON_EXTERNAL_POSITION"), mockPostCallOnExternalPositionPolicy.addFundSettings.returns(undefined), mockPostCallOnExternalPositionPolicy.activateForFund.returns(undefined), mockPostCallOnExternalPositionPolicy.canDisable.returns(false), mockPostCallOnExternalPositionPolicy.validateRule.returns(true), mockPostCallOnExternalPositionPolicy.implementedHooks.returns([protocol
|
2389
|
-
mockPostCoIPolicy.identifier.returns("MOCK_POST_CALL_ON_INTEGRATION"), mockPostCoIPolicy.addFundSettings.returns(undefined), mockPostCoIPolicy.activateForFund.returns(undefined), mockPostCoIPolicy.canDisable.returns(false), mockPostCoIPolicy.validateRule.returns(true), mockPostCoIPolicy.implementedHooks.returns([protocol
|
2390
|
-
mockPreTransferSharesPolicy.identifier.returns("MOCK_PRE_TRANSFER_SHARES"), mockPreTransferSharesPolicy.addFundSettings.returns(undefined), mockPreTransferSharesPolicy.activateForFund.returns(undefined), mockPreTransferSharesPolicy.canDisable.returns(false), mockPreTransferSharesPolicy.validateRule.returns(true), mockPreTransferSharesPolicy.implementedHooks.returns([protocol
|
2391
|
-
mockRedeemSharesForSpecificAssetsPolicy.identifier.returns("MOCK_REDEEM_SHARES_FOR_SPECIFIC_ASSETS"), mockRedeemSharesForSpecificAssetsPolicy.addFundSettings.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.activateForFund.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.canDisable.returns(false), mockRedeemSharesForSpecificAssetsPolicy.validateRule.returns(true), mockRedeemSharesForSpecificAssetsPolicy.implementedHooks.returns([protocol
|
2392
|
-
mockRemoveExternalPositionPolicy.identifier.returns("MOCK_REMOVE_EXTERNAL_POSITION"), mockRemoveExternalPositionPolicy.addFundSettings.returns(undefined), mockRemoveExternalPositionPolicy.activateForFund.returns(undefined), mockRemoveExternalPositionPolicy.canDisable.returns(false), mockRemoveExternalPositionPolicy.validateRule.returns(true), mockRemoveExternalPositionPolicy.implementedHooks.returns([protocol
|
3091
|
+
mockAddTrackedAssetsPolicy.identifier.returns("MOCK_ADD_TRACKED_ASSETS"), mockAddTrackedAssetsPolicy.addFundSettings.returns(undefined), mockAddTrackedAssetsPolicy.activateForFund.returns(undefined), mockAddTrackedAssetsPolicy.canDisable.returns(false), mockAddTrackedAssetsPolicy.validateRule.returns(true), mockAddTrackedAssetsPolicy.implementedHooks.returns([protocol.PolicyHook.AddTrackedAssets]), mockAddTrackedAssetsPolicy.updateFundSettings.returns(undefined), // CreateExternalPosition
|
3092
|
+
mockCreateExternalPositionPolicy.identifier.returns("MOCK_CREATE_EXTERNAL_POSITION"), mockCreateExternalPositionPolicy.addFundSettings.returns(undefined), mockCreateExternalPositionPolicy.activateForFund.returns(undefined), mockCreateExternalPositionPolicy.canDisable.returns(false), mockCreateExternalPositionPolicy.validateRule.returns(true), mockCreateExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.CreateExternalPosition]), mockCreateExternalPositionPolicy.updateFundSettings.returns(undefined), // PostBuyShares
|
3093
|
+
mockPostBuySharesPolicy.identifier.returns("MOCK_POST_BUY_SHARES"), mockPostBuySharesPolicy.addFundSettings.returns(undefined), mockPostBuySharesPolicy.activateForFund.returns(undefined), mockPostBuySharesPolicy.canDisable.returns(false), mockPostBuySharesPolicy.validateRule.returns(true), mockPostBuySharesPolicy.implementedHooks.returns([protocol.PolicyHook.PostBuyShares]), mockPostBuySharesPolicy.updateFundSettings.returns(undefined), // PostCallOnExternalPosition
|
3094
|
+
mockPostCallOnExternalPositionPolicy.identifier.returns("MOCK_POST_CALL_ON_EXTERNAL_POSITION"), mockPostCallOnExternalPositionPolicy.addFundSettings.returns(undefined), mockPostCallOnExternalPositionPolicy.activateForFund.returns(undefined), mockPostCallOnExternalPositionPolicy.canDisable.returns(false), mockPostCallOnExternalPositionPolicy.validateRule.returns(true), mockPostCallOnExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.PostCallOnExternalPosition]), mockPostCallOnExternalPositionPolicy.updateFundSettings.returns(undefined), // PostCallOnIntegration
|
3095
|
+
mockPostCoIPolicy.identifier.returns("MOCK_POST_CALL_ON_INTEGRATION"), mockPostCoIPolicy.addFundSettings.returns(undefined), mockPostCoIPolicy.activateForFund.returns(undefined), mockPostCoIPolicy.canDisable.returns(false), mockPostCoIPolicy.validateRule.returns(true), mockPostCoIPolicy.implementedHooks.returns([protocol.PolicyHook.PostCallOnIntegration]), mockPostCoIPolicy.updateFundSettings.returns(undefined), // PreTransferSharesPolicy
|
3096
|
+
mockPreTransferSharesPolicy.identifier.returns("MOCK_PRE_TRANSFER_SHARES"), mockPreTransferSharesPolicy.addFundSettings.returns(undefined), mockPreTransferSharesPolicy.activateForFund.returns(undefined), mockPreTransferSharesPolicy.canDisable.returns(false), mockPreTransferSharesPolicy.validateRule.returns(true), mockPreTransferSharesPolicy.implementedHooks.returns([protocol.PolicyHook.PreTransferShares]), mockPreTransferSharesPolicy.updateFundSettings.returns(undefined), // RedeemSharesForSpecificAssets
|
3097
|
+
mockRedeemSharesForSpecificAssetsPolicy.identifier.returns("MOCK_REDEEM_SHARES_FOR_SPECIFIC_ASSETS"), mockRedeemSharesForSpecificAssetsPolicy.addFundSettings.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.activateForFund.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.canDisable.returns(false), mockRedeemSharesForSpecificAssetsPolicy.validateRule.returns(true), mockRedeemSharesForSpecificAssetsPolicy.implementedHooks.returns([protocol.PolicyHook.RedeemSharesForSpecificAssets]), mockRedeemSharesForSpecificAssetsPolicy.updateFundSettings.returns(undefined), // RemoveExternalPosition
|
3098
|
+
mockRemoveExternalPositionPolicy.identifier.returns("MOCK_REMOVE_EXTERNAL_POSITION"), mockRemoveExternalPositionPolicy.addFundSettings.returns(undefined), mockRemoveExternalPositionPolicy.activateForFund.returns(undefined), mockRemoveExternalPositionPolicy.canDisable.returns(false), mockRemoveExternalPositionPolicy.validateRule.returns(true), mockRemoveExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.RedeemSharesForSpecificAssets]), mockRemoveExternalPositionPolicy.updateFundSettings.returns(undefined)]);
|
2393
3099
|
|
2394
3100
|
case 27:
|
2395
3101
|
return _context2.abrupt("return", {
|
@@ -2419,7 +3125,8 @@ function assertEvent(receipt, event, match) {
|
|
2419
3125
|
var events = ethers$1.extractEvent(receipt, event);
|
2420
3126
|
expect(events.length).toBe(1);
|
2421
3127
|
expect(receipt).toHaveEmittedWith(event, match);
|
2422
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
3128
|
+
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
|
3129
|
+
|
2423
3130
|
return args;
|
2424
3131
|
}
|
2425
3132
|
function assertNoEvent(receipt, event) {
|
@@ -2572,14 +3279,15 @@ function _createComptrollerProxy() {
|
|
2572
3279
|
switch (_context.prev = _context.next) {
|
2573
3280
|
case 0:
|
2574
3281
|
signer = _ref.signer, comptrollerLib = _ref.comptrollerLib, denominationAsset = _ref.denominationAsset, _ref$sharesActionTime = _ref.sharesActionTimelock, sharesActionTimelock = _ref$sharesActionTime === void 0 ? 0 : _ref$sharesActionTime;
|
2575
|
-
constructData = protocol
|
3282
|
+
constructData = protocol.encodeFunctionData(comptrollerLib.init.fragment, [denominationAsset, sharesActionTimelock]);
|
2576
3283
|
_context.next = 4;
|
2577
|
-
return protocol
|
3284
|
+
return protocol.ComptrollerProxy.deploy(signer, constructData, comptrollerLib);
|
2578
3285
|
|
2579
3286
|
case 4:
|
2580
3287
|
comptrollerProxyContract = _context.sent;
|
2581
3288
|
return _context.abrupt("return", {
|
2582
|
-
comptrollerProxy: new protocol
|
3289
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerProxyContract, signer),
|
3290
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
2583
3291
|
receipt: comptrollerProxyContract.deployment
|
2584
3292
|
});
|
2585
3293
|
|
@@ -2612,16 +3320,14 @@ function _createMigrationRequest() {
|
|
2612
3320
|
case 3:
|
2613
3321
|
receipt = _context2.sent;
|
2614
3322
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2615
|
-
creator: signer,
|
2616
3323
|
comptrollerProxy: expect.any(String),
|
3324
|
+
creator: signer,
|
2617
3325
|
denominationAsset: denominationAsset,
|
2618
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2619
|
-
feeManagerConfigData: ethers.utils.hexlify(feeManagerConfigData),
|
2620
|
-
policyManagerConfigData: ethers.utils.hexlify(policyManagerConfigData)
|
3326
|
+
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2621
3327
|
});
|
2622
3328
|
return _context2.abrupt("return", {
|
2623
|
-
|
2624
|
-
|
3329
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3330
|
+
receipt: receipt
|
2625
3331
|
});
|
2626
3332
|
|
2627
3333
|
case 6:
|
@@ -2640,33 +3346,31 @@ function createNewFund(_x3) {
|
|
2640
3346
|
|
2641
3347
|
function _createNewFund() {
|
2642
3348
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2643
|
-
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;
|
3349
|
+
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;
|
2644
3350
|
|
2645
3351
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2646
3352
|
while (1) {
|
2647
3353
|
switch (_context3.prev = _context3.next) {
|
2648
3354
|
case 0:
|
2649
|
-
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 ? ethers$1.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;
|
3355
|
+
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 ? ethers$1.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;
|
2650
3356
|
_context3.next = 3;
|
2651
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
3357
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
2652
3358
|
|
2653
3359
|
case 3:
|
2654
3360
|
receipt = _context3.sent;
|
2655
3361
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2656
|
-
creator: signer,
|
2657
3362
|
comptrollerProxy: expect.any(String),
|
3363
|
+
creator: signer,
|
2658
3364
|
denominationAsset: denominationAsset,
|
2659
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2660
|
-
feeManagerConfigData: ethers.utils.hexlify(feeManagerConfig),
|
2661
|
-
policyManagerConfigData: ethers.utils.hexlify(policyManagerConfig)
|
3365
|
+
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2662
3366
|
});
|
2663
|
-
comptrollerProxy = new protocol
|
3367
|
+
comptrollerProxy = new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
2664
3368
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
3369
|
+
comptrollerProxy: comptrollerProxy,
|
2665
3370
|
creator: signer,
|
2666
|
-
vaultProxy: expect.any(String)
|
2667
|
-
comptrollerProxy: comptrollerProxy
|
3371
|
+
vaultProxy: expect.any(String)
|
2668
3372
|
});
|
2669
|
-
vaultProxy = new protocol
|
3373
|
+
vaultProxy = new protocol.VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
2670
3374
|
|
2671
3375
|
if (!(investment != null)) {
|
2672
3376
|
_context3.next = 11;
|
@@ -2715,16 +3419,14 @@ function _createReconfigurationRequest() {
|
|
2715
3419
|
case 3:
|
2716
3420
|
receipt = _context4.sent;
|
2717
3421
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2718
|
-
creator: signer,
|
2719
3422
|
comptrollerProxy: expect.any(String),
|
3423
|
+
creator: signer,
|
2720
3424
|
denominationAsset: denominationAsset,
|
2721
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2722
|
-
feeManagerConfigData: ethers.utils.hexlify(feeManagerConfigData),
|
2723
|
-
policyManagerConfigData: ethers.utils.hexlify(policyManagerConfigData)
|
3425
|
+
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2724
3426
|
});
|
2725
3427
|
return _context4.abrupt("return", {
|
2726
|
-
|
2727
|
-
|
3428
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3429
|
+
receipt: receipt
|
2728
3430
|
});
|
2729
3431
|
|
2730
3432
|
case 6:
|
@@ -2750,13 +3452,13 @@ function _createVaultProxy() {
|
|
2750
3452
|
switch (_context5.prev = _context5.next) {
|
2751
3453
|
case 0:
|
2752
3454
|
signer = _ref5.signer, vaultLib = _ref5.vaultLib, fundOwner = _ref5.fundOwner, fundAccessor = _ref5.fundAccessor, _ref5$fundName = _ref5.fundName, fundName = _ref5$fundName === void 0 ? 'My Fund' : _ref5$fundName;
|
2753
|
-
constructData = protocol
|
3455
|
+
constructData = protocol.encodeFunctionData(vaultLib.init.fragment, [fundOwner, fundAccessor, fundName]);
|
2754
3456
|
_context5.next = 4;
|
2755
|
-
return protocol
|
3457
|
+
return protocol.VaultProxy.deploy(signer, constructData, vaultLib);
|
2756
3458
|
|
2757
3459
|
case 4:
|
2758
3460
|
vaultProxyContract = _context5.sent;
|
2759
|
-
return _context5.abrupt("return", new protocol
|
3461
|
+
return _context5.abrupt("return", new protocol.VaultLib(vaultProxyContract, fundAccessor));
|
2760
3462
|
|
2761
3463
|
case 6:
|
2762
3464
|
case "end":
|
@@ -2785,7 +3487,7 @@ function _setupGasRelayerPaymaster() {
|
|
2785
3487
|
return weth.transfer(vaultProxy, startingBalance);
|
2786
3488
|
|
2787
3489
|
case 3:
|
2788
|
-
comptrollerProxy = new protocol
|
3490
|
+
comptrollerProxy = new protocol.ComptrollerLib(fundAccessor, signer);
|
2789
3491
|
_context6.next = 6;
|
2790
3492
|
return comptrollerProxy.deployGasRelayPaymaster();
|
2791
3493
|
|
@@ -2794,7 +3496,7 @@ function _setupGasRelayerPaymaster() {
|
|
2794
3496
|
eventArgs = assertEvent(receipt, 'GasRelayPaymasterSet', {
|
2795
3497
|
gasRelayPaymaster: expect.any(String)
|
2796
3498
|
});
|
2797
|
-
return _context6.abrupt("return", new protocol
|
3499
|
+
return _context6.abrupt("return", new protocol.GasRelayPaymasterLib(eventArgs.gasRelayPaymaster, signer));
|
2798
3500
|
|
2799
3501
|
case 9:
|
2800
3502
|
case "end":
|
@@ -2806,29 +3508,68 @@ function _setupGasRelayerPaymaster() {
|
|
2806
3508
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
2807
3509
|
}
|
2808
3510
|
|
2809
|
-
function
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
3511
|
+
function vaultCallCreateNewList(_x) {
|
3512
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
3513
|
+
}
|
3514
|
+
|
3515
|
+
function _vaultCallCreateNewList() {
|
3516
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3517
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
3518
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3519
|
+
while (1) {
|
3520
|
+
switch (_context.prev = _context.next) {
|
3521
|
+
case 0:
|
3522
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
3523
|
+
_context.next = 3;
|
3524
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, protocol.addressListRegistryCreateListSelector, protocol.encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
3525
|
+
|
3526
|
+
case 3:
|
3527
|
+
_context.next = 5;
|
3528
|
+
return addressListRegistry.getListCount();
|
3529
|
+
|
3530
|
+
case 5:
|
3531
|
+
listCount = _context.sent;
|
3532
|
+
return _context.abrupt("return", listCount.sub(1));
|
3533
|
+
|
3534
|
+
case 7:
|
3535
|
+
case "end":
|
3536
|
+
return _context.stop();
|
3537
|
+
}
|
3538
|
+
}
|
3539
|
+
}, _callee);
|
3540
|
+
}));
|
3541
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
2814
3542
|
}
|
2815
|
-
|
3543
|
+
|
3544
|
+
function vaultCallCurveMinterMint(_ref2) {
|
2816
3545
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
2817
3546
|
minter = _ref2.minter,
|
2818
|
-
|
3547
|
+
gauge = _ref2.gauge;
|
3548
|
+
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintSelector, protocol.encodeArgs(['address'], [gauge]));
|
3549
|
+
}
|
3550
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
3551
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
3552
|
+
minter = _ref3.minter,
|
3553
|
+
gauges = _ref3.gauges;
|
2819
3554
|
var gaugesFormatted = new Array(8).fill(ethers.constants.AddressZero);
|
2820
3555
|
|
2821
3556
|
for (var i in gauges) {
|
2822
3557
|
gaugesFormatted[i] = gauges[i];
|
2823
3558
|
}
|
2824
3559
|
|
2825
|
-
return comptrollerProxy.vaultCallOnContract(minter, protocol
|
3560
|
+
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintManySelector, protocol.encodeArgs(['address[8]'], [gaugesFormatted]));
|
2826
3561
|
}
|
2827
|
-
function vaultCallCurveMinterToggleApproveMint(
|
2828
|
-
var comptrollerProxy =
|
2829
|
-
minter =
|
2830
|
-
account =
|
2831
|
-
return comptrollerProxy.vaultCallOnContract(minter, protocol
|
3562
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
3563
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
3564
|
+
minter = _ref4.minter,
|
3565
|
+
account = _ref4.account;
|
3566
|
+
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterToggleApproveMintSelector, protocol.encodeArgs(['address'], [account]));
|
3567
|
+
}
|
3568
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
3569
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
3570
|
+
contract = _ref5.contract,
|
3571
|
+
asset = _ref5.asset;
|
3572
|
+
return comptrollerProxy.vaultCallOnContract(contract, protocol.sighash(ethers.utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), protocol.encodeArgs(['address'], [asset]));
|
2832
3573
|
}
|
2833
3574
|
|
2834
3575
|
function transactionTimestamp(_x) {
|
@@ -2883,8 +3624,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2883
3624
|
// 50% discount
|
2884
3625
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
2885
3626
|
return _context2.abrupt("return", {
|
2886
|
-
|
2887
|
-
|
3627
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
3628
|
+
mlnValue: mlnValueOfBuyback
|
2888
3629
|
});
|
2889
3630
|
|
2890
3631
|
case 8:
|
@@ -2900,43 +3641,51 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
2900
3641
|
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; }
|
2901
3642
|
|
2902
3643
|
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; }
|
3644
|
+
|
3645
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
2903
3646
|
var whales = {
|
2904
|
-
|
2905
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
2906
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3647
|
+
// primitives
|
2907
3648
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
2908
3649
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
2909
|
-
bnt: '
|
2910
|
-
|
3650
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
3651
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3652
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
2911
3653
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
2912
|
-
dai: '
|
2913
|
-
knc: '
|
2914
|
-
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3654
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
3655
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
2915
3656
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
2916
3657
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
2917
3658
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
2918
3659
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
2919
3660
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
3661
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
2920
3662
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
2921
3663
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
2922
3664
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
2923
3665
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
2924
3666
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
2925
|
-
|
3667
|
+
// aTokens
|
3668
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
3669
|
+
// cTokens
|
2926
3670
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
2927
|
-
cdai: '
|
3671
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
2928
3672
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
2929
|
-
|
2930
|
-
cuni: '0x8889ff5b6323e71c28c26d2c34b8bb52654f00a6',
|
3673
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
2931
3674
|
cusdc: '0xb3bd459e0598dde1fe84b1d0a1430be175b5d5be',
|
2932
|
-
|
3675
|
+
// ptTokens
|
3676
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
3677
|
+
// synths
|
2933
3678
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
2934
|
-
seur: '
|
2935
|
-
|
3679
|
+
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
3680
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
3681
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
3682
|
+
// misc
|
2936
3683
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
2937
|
-
|
2938
|
-
|
3684
|
+
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3685
|
+
eurs: '0x98ed26de6451db36246672df78ae7c50f2c76f6d'
|
2939
3686
|
};
|
3687
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
3688
|
+
|
2940
3689
|
function unlockWhale(_x) {
|
2941
3690
|
return _unlockWhale.apply(this, arguments);
|
2942
3691
|
}
|
@@ -3087,7 +3836,7 @@ function _relayTransaction() {
|
|
3087
3836
|
case 0:
|
3088
3837
|
signer = options.sendFunction.contract.signer;
|
3089
3838
|
|
3090
|
-
if (signer && protocol
|
3839
|
+
if (signer && protocol.isTypedDataSigner(signer)) {
|
3091
3840
|
_context.next = 3;
|
3092
3841
|
break;
|
3093
3842
|
}
|
@@ -3096,7 +3845,7 @@ function _relayTransaction() {
|
|
3096
3845
|
|
3097
3846
|
case 3:
|
3098
3847
|
_context.next = 5;
|
3099
|
-
return protocol
|
3848
|
+
return protocol.createSignedRelayRequest(options);
|
3100
3849
|
|
3101
3850
|
case 5:
|
3102
3851
|
_yield$createSignedRe = _context.sent;
|
@@ -3108,10 +3857,10 @@ function _relayTransaction() {
|
|
3108
3857
|
defaultMaxAcceptance = ethers.BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
3109
3858
|
|
3110
3859
|
mergedRelayRequest = {
|
3111
|
-
|
3112
|
-
|
3860
|
+
relayData: relayData,
|
3861
|
+
request: relayRequest
|
3113
3862
|
};
|
3114
|
-
relayHub = new protocol
|
3863
|
+
relayHub = new protocol.IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
3115
3864
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
3116
3865
|
|
3117
3866
|
case 14:
|
@@ -3128,14 +3877,14 @@ var relayed = ethers.utils.EventFragment.fromString('TransactionRelayed(address
|
|
3128
3877
|
var rejected = ethers.utils.EventFragment.fromString('TransactionRejectedByPaymaster(address indexed relayManager, address indexed paymaster, address indexed from, address to, address relayWorker, bytes4 selector, uint256 innerGasUsed, bytes reason)');
|
3129
3878
|
function assertDidRelay(receipt) {
|
3130
3879
|
return assertEvent(receipt, relayed, {
|
3131
|
-
|
3132
|
-
relayWorker: expect.any(String),
|
3880
|
+
charge: expect.anything(),
|
3133
3881
|
from: expect.any(String),
|
3134
|
-
to: expect.any(String),
|
3135
3882
|
paymaster: expect.any(String),
|
3883
|
+
relayManager: expect.any(String),
|
3884
|
+
relayWorker: expect.any(String),
|
3136
3885
|
selector: expect.any(String),
|
3137
3886
|
status: expect.anything(),
|
3138
|
-
|
3887
|
+
to: expect.any(String)
|
3139
3888
|
});
|
3140
3889
|
}
|
3141
3890
|
function assertDidRelaySuccessfully(receipt) {
|
@@ -3152,14 +3901,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
3152
3901
|
}
|
3153
3902
|
function assertPaymasterDidReject(receipt) {
|
3154
3903
|
return assertEvent(receipt, rejected, {
|
3155
|
-
relayManager: expect.any(String),
|
3156
|
-
paymaster: expect.any(String),
|
3157
3904
|
from: expect.any(String),
|
3158
|
-
|
3905
|
+
innerGasUsed: expect.anything(),
|
3906
|
+
paymaster: expect.any(String),
|
3907
|
+
reason: expect.any(String),
|
3908
|
+
relayManager: expect.any(String),
|
3159
3909
|
relayWorker: expect.any(String),
|
3160
3910
|
selector: expect.any(String),
|
3161
|
-
|
3162
|
-
reason: expect.any(String)
|
3911
|
+
to: expect.any(String)
|
3163
3912
|
});
|
3164
3913
|
}
|
3165
3914
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
@@ -3171,10 +3920,10 @@ exports.CurveLiquidityGaugeV2 = CurveLiquidityGaugeV2;
|
|
3171
3920
|
exports.CurveMinter = CurveMinter;
|
3172
3921
|
exports.CurveSwaps = CurveSwaps;
|
3173
3922
|
exports.ICompoundComptroller = ICompoundComptroller;
|
3923
|
+
exports.IUniswapV3NonFungibleTokenManager = IUniswapV3NonFungibleTokenManager;
|
3174
3924
|
exports.UniswapV2Factory = UniswapV2Factory;
|
3175
3925
|
exports.aaveLend = aaveLend;
|
3176
3926
|
exports.aaveRedeem = aaveRedeem;
|
3177
|
-
exports.addCollateral = addCollateral;
|
3178
3927
|
exports.addNewAssetsToFund = addNewAssetsToFund;
|
3179
3928
|
exports.addTrackedAssetsToVault = addTrackedAssetsToVault;
|
3180
3929
|
exports.assertDidRelay = assertDidRelay;
|
@@ -3185,14 +3934,19 @@ exports.assertEvent = assertEvent;
|
|
3185
3934
|
exports.assertNoEvent = assertNoEvent;
|
3186
3935
|
exports.assertPaymasterDidReject = assertPaymasterDidReject;
|
3187
3936
|
exports.assertPaymasterDidRejectForReason = assertPaymasterDidRejectForReason;
|
3188
|
-
exports.borrow = borrow;
|
3189
3937
|
exports.buyShares = buyShares;
|
3190
3938
|
exports.buySharesFunction = buySharesFunction;
|
3191
3939
|
exports.calcMlnValueAndBurnAmountForSharesBuyback = calcMlnValueAndBurnAmountForSharesBuyback;
|
3192
3940
|
exports.callOnExtension = callOnExtension;
|
3193
|
-
exports.
|
3941
|
+
exports.callOnExternalPosition = callOnExternalPosition;
|
3942
|
+
exports.compoundDebtPositionAddCollateral = compoundDebtPositionAddCollateral;
|
3943
|
+
exports.compoundDebtPositionBorrow = compoundDebtPositionBorrow;
|
3944
|
+
exports.compoundDebtPositionClaimComp = compoundDebtPositionClaimComp;
|
3945
|
+
exports.compoundDebtPositionRemoveCollateral = compoundDebtPositionRemoveCollateral;
|
3946
|
+
exports.compoundDebtPositionRepayBorrow = compoundDebtPositionRepayBorrow;
|
3194
3947
|
exports.compoundLend = compoundLend;
|
3195
3948
|
exports.compoundRedeem = compoundRedeem;
|
3949
|
+
exports.createCompoundDebtPosition = createCompoundDebtPosition;
|
3196
3950
|
exports.createComptrollerProxy = createComptrollerProxy;
|
3197
3951
|
exports.createExternalPosition = createExternalPosition;
|
3198
3952
|
exports.createFundDeployer = createFundDeployer;
|
@@ -3200,6 +3954,7 @@ exports.createMigrationRequest = createMigrationRequest;
|
|
3200
3954
|
exports.createMockExternalPosition = createMockExternalPosition;
|
3201
3955
|
exports.createNewFund = createNewFund;
|
3202
3956
|
exports.createReconfigurationRequest = createReconfigurationRequest;
|
3957
|
+
exports.createUniswapV3LiquidityPosition = createUniswapV3LiquidityPosition;
|
3203
3958
|
exports.createVaultProxy = createVaultProxy;
|
3204
3959
|
exports.curveAaveClaimRewards = curveAaveClaimRewards;
|
3205
3960
|
exports.curveAaveLend = curveAaveLend;
|
@@ -3230,7 +3985,6 @@ exports.curveStethStake = curveStethStake;
|
|
3230
3985
|
exports.curveStethUnstake = curveStethUnstake;
|
3231
3986
|
exports.curveStethUnstakeAndRedeem = curveStethUnstakeAndRedeem;
|
3232
3987
|
exports.curveTakeOrder = curveTakeOrder;
|
3233
|
-
exports.defaultTestDeployment = defaultTestDeployment;
|
3234
3988
|
exports.deployProtocolFixture = deployProtocolFixture;
|
3235
3989
|
exports.generateFeeManagerConfigWithMockFees = generateFeeManagerConfigWithMockFees;
|
3236
3990
|
exports.generateMockFees = generateMockFees;
|
@@ -3243,6 +3997,10 @@ exports.getUnnamedSigners = getUnnamedSigners;
|
|
3243
3997
|
exports.idleClaimRewards = idleClaimRewards;
|
3244
3998
|
exports.idleLend = idleLend;
|
3245
3999
|
exports.idleRedeem = idleRedeem;
|
4000
|
+
exports.mockExternalPositionAddDebtAssets = mockExternalPositionAddDebtAssets;
|
4001
|
+
exports.mockExternalPositionAddManagedAssets = mockExternalPositionAddManagedAssets;
|
4002
|
+
exports.mockExternalPositionRemoveDebtAssets = mockExternalPositionRemoveDebtAssets;
|
4003
|
+
exports.mockExternalPositionRemoveManagedAssets = mockExternalPositionRemoveManagedAssets;
|
3246
4004
|
exports.mockGenericRemoveOnlySelector = mockGenericRemoveOnlySelector;
|
3247
4005
|
exports.mockGenericSwap = mockGenericSwap;
|
3248
4006
|
exports.mockGenericSwapASelector = mockGenericSwapASelector;
|
@@ -3252,29 +4010,44 @@ exports.mockGenericSwapDirectFromVaultSelector = mockGenericSwapDirectFromVaultS
|
|
3252
4010
|
exports.mockGenericSwapViaApprovalSelector = mockGenericSwapViaApprovalSelector;
|
3253
4011
|
exports.paraSwapV4GenerateDummyPaths = paraSwapV4GenerateDummyPaths;
|
3254
4012
|
exports.paraSwapV4TakeOrder = paraSwapV4TakeOrder;
|
4013
|
+
exports.paraSwapV5GenerateDummyPaths = paraSwapV5GenerateDummyPaths;
|
4014
|
+
exports.paraSwapV5TakeOrder = paraSwapV5TakeOrder;
|
4015
|
+
exports.poolTogetherV4ClaimRewards = poolTogetherV4ClaimRewards;
|
4016
|
+
exports.poolTogetherV4Lend = poolTogetherV4Lend;
|
4017
|
+
exports.poolTogetherV4Redeem = poolTogetherV4Redeem;
|
4018
|
+
exports.reactivateExternalPosition = reactivateExternalPosition;
|
3255
4019
|
exports.redeemSharesForSpecificAssets = redeemSharesForSpecificAssets;
|
3256
4020
|
exports.redeemSharesInKind = redeemSharesInKind;
|
3257
4021
|
exports.relayTransaction = relayTransaction;
|
3258
|
-
exports.removeCollateral = removeCollateral;
|
3259
4022
|
exports.removeExternalPosition = removeExternalPosition;
|
3260
4023
|
exports.removeTrackedAssetsFromVault = removeTrackedAssetsFromVault;
|
3261
|
-
exports.repayBorrow = repayBorrow;
|
3262
4024
|
exports.setupGasRelayerPaymaster = setupGasRelayerPaymaster;
|
3263
4025
|
exports.synthetixAssignExchangeDelegate = synthetixAssignExchangeDelegate;
|
4026
|
+
exports.synthetixRedeem = synthetixRedeem;
|
3264
4027
|
exports.synthetixResolveAddress = synthetixResolveAddress;
|
3265
4028
|
exports.synthetixTakeOrder = synthetixTakeOrder;
|
3266
4029
|
exports.transactionTimestamp = transactionTimestamp;
|
3267
4030
|
exports.uniswapV2Lend = uniswapV2Lend;
|
3268
4031
|
exports.uniswapV2Redeem = uniswapV2Redeem;
|
3269
4032
|
exports.uniswapV2TakeOrder = uniswapV2TakeOrder;
|
4033
|
+
exports.uniswapV3LiquidityPositionAddLiquidity = uniswapV3LiquidityPositionAddLiquidity;
|
4034
|
+
exports.uniswapV3LiquidityPositionCollect = uniswapV3LiquidityPositionCollect;
|
4035
|
+
exports.uniswapV3LiquidityPositionGetMaxTick = uniswapV3LiquidityPositionGetMaxTick;
|
4036
|
+
exports.uniswapV3LiquidityPositionGetMinTick = uniswapV3LiquidityPositionGetMinTick;
|
4037
|
+
exports.uniswapV3LiquidityPositionMint = uniswapV3LiquidityPositionMint;
|
4038
|
+
exports.uniswapV3LiquidityPositionPurge = uniswapV3LiquidityPositionPurge;
|
4039
|
+
exports.uniswapV3LiquidityPositionRemoveLiquidity = uniswapV3LiquidityPositionRemoveLiquidity;
|
4040
|
+
exports.uniswapV3OrderTokenPair = uniswapV3OrderTokenPair;
|
3270
4041
|
exports.uniswapV3TakeOrder = uniswapV3TakeOrder;
|
3271
4042
|
exports.unlockAllWhales = unlockAllWhales;
|
3272
4043
|
exports.unlockWhale = unlockWhale;
|
3273
4044
|
exports.unlockWhales = unlockWhales;
|
3274
4045
|
exports.updateChainlinkAggregator = updateChainlinkAggregator;
|
4046
|
+
exports.vaultCallCreateNewList = vaultCallCreateNewList;
|
3275
4047
|
exports.vaultCallCurveMinterMint = vaultCallCurveMinterMint;
|
3276
4048
|
exports.vaultCallCurveMinterMintMany = vaultCallCurveMinterMintMany;
|
3277
4049
|
exports.vaultCallCurveMinterToggleApproveMint = vaultCallCurveMinterToggleApproveMint;
|
4050
|
+
exports.vaultCallStartAssetBypassTimelock = vaultCallStartAssetBypassTimelock;
|
3278
4051
|
exports.yearnVaultV2Lend = yearnVaultV2Lend;
|
3279
4052
|
exports.yearnVaultV2Redeem = yearnVaultV2Redeem;
|
3280
4053
|
exports.zeroExV2TakeOrder = zeroExV2TakeOrder;
|