@enzymefinance/testutils 4.0.0-next.2 → 4.0.0-next.7
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/dist/declarations/src/assertions.d.ts +2 -2
- package/dist/declarations/src/deployment.d.ts +172 -68
- package/dist/declarations/src/gasRelayer.d.ts +14 -12
- package/dist/declarations/src/helpers.d.ts +5 -4
- package/dist/declarations/src/scaffolding/assets.d.ts +4 -4
- package/dist/declarations/src/scaffolding/chainlink.d.ts +2 -2
- package/dist/declarations/src/scaffolding/common.d.ts +1 -1
- package/dist/declarations/src/scaffolding/core.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +8 -6
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +16 -12
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +100 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +33 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +101 -84
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +6 -6
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +3 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +17 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +23 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +29 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +15 -12
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +9 -9
- package/dist/declarations/src/scaffolding/setup.d.ts +11 -9
- package/dist/declarations/src/scaffolding/shares.d.ts +4 -4
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +11 -2
- package/dist/declarations/src/whales.d.ts +24 -19
- package/dist/enzymefinance-testutils.browser.cjs.js +1541 -673
- package/dist/enzymefinance-testutils.browser.esm.js +1502 -655
- package/dist/enzymefinance-testutils.cjs.dev.js +1541 -673
- package/dist/enzymefinance-testutils.cjs.prod.js +1541 -673
- package/dist/enzymefinance-testutils.esm.js +1502 -655
- package/package.json +6 -6
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +221 -120
- package/src/gasRelayer.ts +17 -18
- package/src/helpers.ts +6 -4
- package/src/scaffolding/assets.ts +7 -6
- package/src/scaffolding/chainlink.ts +2 -2
- package/src/scaffolding/common.ts +1 -1
- package/src/scaffolding/core.ts +4 -8
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +14 -9
- package/src/scaffolding/extensions/external-positions/compound.ts +28 -29
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +32 -36
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +284 -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 +171 -11
- package/src/scaffolding/extensions/integrations/curve.ts +303 -255
- package/src/scaffolding/extensions/integrations/idle.ts +9 -11
- package/src/scaffolding/extensions/integrations/index.ts +3 -0
- package/src/scaffolding/extensions/integrations/mock.ts +11 -13
- package/src/scaffolding/extensions/integrations/olympusV2.ts +71 -0
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +16 -11
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +73 -0
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +117 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +45 -31
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +22 -19
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +9 -10
- package/src/scaffolding/extensions/integrations/yearn.ts +9 -11
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +9 -7
- package/src/scaffolding/extensions/policies.ts +2 -1
- package/src/scaffolding/setup.ts +27 -13
- package/src/scaffolding/shares.ts +5 -4
- package/src/scaffolding/vaultCalls.ts +32 -2
- package/src/types.d.ts +1 -0
- package/src/whales.ts +36 -18
@@ -7,8 +7,8 @@ var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
7
7
|
var protocol = require('@enzymefinance/protocol');
|
8
8
|
var ethers = require('ethers');
|
9
9
|
var ethers$1 = require('@enzymefinance/ethers');
|
10
|
-
var src = require('@enzymefinance/protocol/src');
|
11
10
|
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
11
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
12
12
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
13
13
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
14
14
|
|
@@ -112,77 +112,84 @@ function _deployProtocolFixture() {
|
|
112
112
|
config = fixture['Config'].linkedData; // prettier-ignore
|
113
113
|
|
114
114
|
deployment = {
|
115
|
-
|
116
|
-
vaultLib: new protocol.VaultLib(fixture['VaultLib'].address, deployer),
|
117
|
-
fundDeployer: new protocol.FundDeployer(fixture['FundDeployer'].address, deployer),
|
118
|
-
policyManager: new protocol.PolicyManager(fixture['PolicyManager'].address, deployer),
|
115
|
+
aaveAdapter: new protocol.AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
119
116
|
aavePriceFeed: new protocol.AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
117
|
+
addressListRegistry: new protocol.AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
118
|
+
allowedAdapterIncomingAssetsPolicy: new protocol.AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
119
|
+
allowedAdaptersPolicy: new protocol.AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
120
|
+
allowedAssetsForRedemptionPolicy: new protocol.AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
121
|
+
allowedDepositRecipientsPolicy: new protocol.AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
122
|
+
allowedExternalPositionTypesPolicy: new protocol.AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
123
|
+
allowedSharesTransferRecipientsPolicy: new protocol.AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
124
|
+
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
120
125
|
compoundDebtPositionLib: new protocol.CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
121
126
|
compoundDebtPositionParser: new protocol.CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
122
127
|
compoundPriceFeed: new protocol.CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
130
|
-
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
131
|
-
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
132
|
-
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
133
|
-
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
134
|
-
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
128
|
+
comptrollerLib: new protocol.ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
129
|
+
convexCurveLpStakingAdapter: new protocol.ConvexCurveLpStakingAdapter(fixture['ConvexCurveLpStakingAdapter'].address, deployer),
|
130
|
+
convexCurveLpStakingWrapperFactory: new protocol.ConvexCurveLpStakingWrapperFactory(fixture['ConvexCurveLpStakingWrapperFactory'].address, deployer),
|
131
|
+
convexCurveLpStakingWrapperPriceFeed: new protocol.ConvexCurveLpStakingWrapperPriceFeed(fixture['ConvexCurveLpStakingWrapperPriceFeed'].address, deployer),
|
132
|
+
cumulativeSlippageTolerancePolicy: new protocol.CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
133
|
+
curveExchangeAdapter: new protocol.CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
135
134
|
curveLiquidityAaveAdapter: new protocol.CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
136
|
-
|
135
|
+
curveLiquidityAdapter: new protocol.CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
137
136
|
curveLiquiditySethAdapter: new protocol.CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
138
137
|
curveLiquidityStethAdapter: new protocol.CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
143
|
-
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
144
|
-
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer),
|
145
|
-
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
146
|
-
uniswapV2ExchangeAdapter: new protocol.UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
147
|
-
uniswapV2LiquidityAdapter: new protocol.UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
148
|
-
uniswapV3Adapter: new protocol.UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
149
|
-
curveExchangeAdapter: new protocol.CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
150
|
-
feeManager: new protocol.FeeManager(fixture['FeeManager'].address, deployer),
|
151
|
-
comptrollerLib: new protocol.ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
138
|
+
curvePriceFeed: new protocol.CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
139
|
+
depositWrapper: new protocol.DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
140
|
+
dispatcher: new protocol.Dispatcher(fixture['Dispatcher'].address, deployer),
|
152
141
|
entranceRateBurnFee: new protocol.EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
153
142
|
entranceRateDirectFee: new protocol.EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
154
143
|
exitRateBurnFee: new protocol.ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
155
144
|
exitRateDirectFee: new protocol.ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
145
|
+
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
146
|
+
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
147
|
+
feeManager: new protocol.FeeManager(fixture['FeeManager'].address, deployer),
|
148
|
+
fundDeployer: new protocol.FundDeployer(fixture['FundDeployer'].address, deployer),
|
149
|
+
fundValueCalculator: new protocol.FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
150
|
+
fundValueCalculatorRouter: new protocol.FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
151
|
+
fundValueCalculatorUsdWrapper: new protocol.FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
152
|
+
fuseAdapter: new protocol.FuseAdapter(fixture['FuseAdapter'].address, deployer),
|
153
|
+
fusePriceFeed: new protocol.FusePriceFeed(fixture['FusePriceFeed'].address, deployer),
|
154
|
+
gasRelayPaymasterFactory: new protocol.GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
155
|
+
idleAdapter: new protocol.IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
156
|
+
idlePriceFeed: new protocol.IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
157
|
+
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
158
|
+
lidoStethPriceFeed: new protocol.LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
156
159
|
managementFee: new protocol.ManagementFee(fixture['ManagementFee'].address, deployer),
|
157
|
-
|
158
|
-
depositWrapper: new protocol.DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
159
|
-
unpermissionedActionsWrapper: new protocol.UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
160
|
-
allowedAdapterIncomingAssetsPolicy: new protocol.AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
160
|
+
minAssetBalancesPostRedemptionPolicy: new protocol.MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
161
161
|
minMaxInvestmentPolicy: new protocol.MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
olympusV2Adapter: new protocol.OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
163
|
+
onlyRemoveDustExternalPositionPolicy: new protocol.OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
164
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new protocol.OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
165
|
+
paraSwapV4Adapter: new protocol.ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
166
|
+
paraSwapV5Adapter: new protocol.ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
167
|
+
performanceFee: new protocol.PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
168
|
+
policyManager: new protocol.PolicyManager(fixture['PolicyManager'].address, deployer),
|
169
|
+
poolTogetherV4Adapter: new protocol.PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
170
|
+
poolTogetherV4PriceFeed: new protocol.PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
165
171
|
protocolFeeReserveLib: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
166
172
|
protocolFeeReserveProxy: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
167
173
|
protocolFeeTracker: new protocol.ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
revertingPriceFeed: new protocol.RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
175
|
+
stakehoundEthPriceFeed: new protocol.StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
176
|
+
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
177
|
+
uniswapV2ExchangeAdapter: new protocol.UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
178
|
+
uniswapV2LiquidityAdapter: new protocol.UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
179
|
+
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
180
|
+
uniswapV3Adapter: new protocol.UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
181
|
+
unpermissionedActionsWrapper: new protocol.UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
182
|
+
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
183
|
+
vaultLib: new protocol.VaultLib(fixture['VaultLib'].address, deployer),
|
184
|
+
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
185
|
+
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
186
|
+
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
180
187
|
};
|
181
188
|
return _context3.abrupt("return", {
|
182
|
-
deployer: deployer,
|
183
|
-
deployment: deployment,
|
184
189
|
accounts: accounts,
|
185
|
-
config: config
|
190
|
+
config: config,
|
191
|
+
deployer: deployer,
|
192
|
+
deployment: deployment
|
186
193
|
});
|
187
194
|
|
188
195
|
case 12:
|
@@ -195,30 +202,6 @@ function _deployProtocolFixture() {
|
|
195
202
|
return _deployProtocolFixture.apply(this, arguments);
|
196
203
|
}
|
197
204
|
|
198
|
-
// TODO: Remove this.
|
199
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
200
|
-
function defaultTestDeployment(_x2) {
|
201
|
-
return _defaultTestDeployment.apply(this, arguments);
|
202
|
-
}
|
203
|
-
|
204
|
-
function _defaultTestDeployment() {
|
205
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_) {
|
206
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
207
|
-
while (1) {
|
208
|
-
switch (_context4.prev = _context4.next) {
|
209
|
-
case 0:
|
210
|
-
throw new Error('Removed');
|
211
|
-
|
212
|
-
case 1:
|
213
|
-
case "end":
|
214
|
-
return _context4.stop();
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}, _callee4);
|
218
|
-
}));
|
219
|
-
return _defaultTestDeployment.apply(this, arguments);
|
220
|
-
}
|
221
|
-
|
222
205
|
function addTrackedAssetsToVault(_ref) {
|
223
206
|
var signer = _ref.signer,
|
224
207
|
comptrollerProxy = _ref.comptrollerProxy,
|
@@ -251,12 +234,12 @@ function _addNewAssetsToFund() {
|
|
251
234
|
switch (_context.prev = _context.next) {
|
252
235
|
case 0:
|
253
236
|
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;
|
254
|
-
// First, add tracked assets
|
237
|
+
// First, add tracked assets
|
255
238
|
receipt = addTrackedAssetsToVault({
|
256
|
-
|
239
|
+
assets: assets,
|
257
240
|
comptrollerProxy: comptrollerProxy,
|
258
241
|
integrationManager: integrationManager,
|
259
|
-
|
242
|
+
signer: signer
|
260
243
|
}); // Then seed the vault with balances as necessary
|
261
244
|
|
262
245
|
_context.next = 4;
|
@@ -408,13 +391,13 @@ function createFundDeployer(_x) {
|
|
408
391
|
|
409
392
|
function _createFundDeployer() {
|
410
393
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
411
|
-
var deployer,
|
394
|
+
var deployer, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
412
395
|
|
413
396
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
414
397
|
while (1) {
|
415
398
|
switch (_context.prev = _context.next) {
|
416
399
|
case 0:
|
417
|
-
deployer = _ref.deployer,
|
400
|
+
deployer = _ref.deployer, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
418
401
|
_context.next = 3;
|
419
402
|
return vaultLib.getMlnToken();
|
420
403
|
|
@@ -465,7 +448,7 @@ function _createFundDeployer() {
|
|
465
448
|
case 31:
|
466
449
|
nextIntegrationManager = _context.sent;
|
467
450
|
_context.next = 34;
|
468
|
-
return protocol.ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager,
|
451
|
+
return protocol.ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, gasRelayPaymasterFactory, mlnToken, wethToken);
|
469
452
|
|
470
453
|
case 34:
|
471
454
|
nextComptrollerLib = _context.sent;
|
@@ -502,40 +485,50 @@ function _createFundDeployer() {
|
|
502
485
|
case 54:
|
503
486
|
_context.t11 = _context.sent;
|
504
487
|
_context.next = 57;
|
505
|
-
return vaultLib.
|
488
|
+
return vaultLib.getMlnBurner();
|
506
489
|
|
507
490
|
case 57:
|
508
491
|
_context.t12 = _context.sent;
|
509
492
|
_context.next = 60;
|
510
|
-
return
|
493
|
+
return vaultLib.getWethToken();
|
511
494
|
|
512
495
|
case 60:
|
513
|
-
|
496
|
+
_context.t13 = _context.sent;
|
514
497
|
_context.next = 63;
|
515
|
-
return
|
498
|
+
return vaultLib.getPositionsLimit();
|
516
499
|
|
517
500
|
case 63:
|
501
|
+
_context.t14 = _context.sent;
|
502
|
+
_context.next = 66;
|
503
|
+
return _context.t5.deploy.call(_context.t5, _context.t6, _context.t7, _context.t8, _context.t9, _context.t10, _context.t11, _context.t12, _context.t13, _context.t14);
|
504
|
+
|
505
|
+
case 66:
|
506
|
+
nextVaultLib = _context.sent;
|
507
|
+
_context.next = 69;
|
508
|
+
return nextFundDeployer.setVaultLib(nextVaultLib);
|
509
|
+
|
510
|
+
case 69:
|
518
511
|
if (!setReleaseLive) {
|
519
|
-
_context.next =
|
512
|
+
_context.next = 72;
|
520
513
|
break;
|
521
514
|
}
|
522
515
|
|
523
|
-
_context.next =
|
516
|
+
_context.next = 72;
|
524
517
|
return nextFundDeployer.setReleaseLive();
|
525
518
|
|
526
|
-
case
|
519
|
+
case 72:
|
527
520
|
if (!setOnDispatcher) {
|
528
|
-
_context.next =
|
521
|
+
_context.next = 75;
|
529
522
|
break;
|
530
523
|
}
|
531
524
|
|
532
|
-
_context.next =
|
525
|
+
_context.next = 75;
|
533
526
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
534
527
|
|
535
|
-
case
|
528
|
+
case 75:
|
536
529
|
return _context.abrupt("return", nextFundDeployer);
|
537
530
|
|
538
|
-
case
|
531
|
+
case 76:
|
539
532
|
case "end":
|
540
533
|
return _context.stop();
|
541
534
|
}
|
@@ -594,9 +587,9 @@ function _callOnExternalPosition() {
|
|
594
587
|
case 0:
|
595
588
|
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
596
589
|
callArgs = protocol.callOnExternalPositionArgs({
|
597
|
-
|
590
|
+
actionArgs: actionArgs,
|
598
591
|
actionId: actionId,
|
599
|
-
|
592
|
+
externalPositionProxy: externalPositionProxy
|
600
593
|
});
|
601
594
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
602
595
|
|
@@ -616,23 +609,23 @@ function createExternalPosition(_x2) {
|
|
616
609
|
|
617
610
|
function _createExternalPosition() {
|
618
611
|
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
619
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
612
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, _ref2$callOnExternalP, callOnExternalPositionData, receipt, event, externalPositionProxy;
|
620
613
|
|
621
614
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
622
615
|
while (1) {
|
623
616
|
switch (_context2.prev = _context2.next) {
|
624
617
|
case 0:
|
625
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
618
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD, _ref2$callOnExternalP = _ref2.callOnExternalPositionData, callOnExternalPositionData = _ref2$callOnExternalP === void 0 ? '0x' : _ref2$callOnExternalP;
|
626
619
|
_context2.next = 3;
|
627
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
620
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes', 'bytes'], [externalPositionTypeId, initializationData, callOnExternalPositionData]));
|
628
621
|
|
629
622
|
case 3:
|
630
623
|
receipt = _context2.sent;
|
631
624
|
event = ethers$1.extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
632
625
|
externalPositionProxy = new protocol.IExternalPositionProxy(event[0].args.externalPosition, signer);
|
633
626
|
return _context2.abrupt("return", {
|
634
|
-
|
635
|
-
|
627
|
+
externalPositionProxy: externalPositionProxy,
|
628
|
+
receipt: receipt
|
636
629
|
});
|
637
630
|
|
638
631
|
case 7:
|
@@ -712,17 +705,17 @@ function _compoundDebtPositionAddCollateral() {
|
|
712
705
|
case 0:
|
713
706
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
714
707
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
715
|
-
assets: assets,
|
716
708
|
amounts: amounts,
|
709
|
+
assets: assets,
|
717
710
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
718
711
|
});
|
719
712
|
return _context.abrupt("return", callOnExternalPosition({
|
720
|
-
|
713
|
+
actionArgs: actionArgs,
|
714
|
+
actionId: protocol.CompoundDebtPositionActionId.AddCollateralAssets,
|
721
715
|
comptrollerProxy: comptrollerProxy,
|
722
716
|
externalPositionManager: externalPositionManager,
|
723
717
|
externalPositionProxy: externalPositionProxy,
|
724
|
-
|
725
|
-
actionArgs: actionArgs
|
718
|
+
signer: fundOwner
|
726
719
|
}));
|
727
720
|
|
728
721
|
case 3:
|
@@ -748,17 +741,17 @@ function _compoundDebtPositionBorrow() {
|
|
748
741
|
case 0:
|
749
742
|
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
750
743
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
751
|
-
assets: assets,
|
752
744
|
amounts: amounts,
|
745
|
+
assets: assets,
|
753
746
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
754
747
|
});
|
755
748
|
return _context2.abrupt("return", callOnExternalPosition({
|
756
|
-
|
749
|
+
actionArgs: actionArgs,
|
750
|
+
actionId: protocol.CompoundDebtPositionActionId.BorrowAsset,
|
757
751
|
comptrollerProxy: comptrollerProxy,
|
758
752
|
externalPositionManager: externalPositionManager,
|
759
753
|
externalPositionProxy: externalPositionProxy,
|
760
|
-
|
761
|
-
actionArgs: actionArgs
|
754
|
+
signer: fundOwner
|
762
755
|
}));
|
763
756
|
|
764
757
|
case 3:
|
@@ -784,17 +777,17 @@ function _compoundDebtPositionClaimComp() {
|
|
784
777
|
case 0:
|
785
778
|
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
786
779
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
787
|
-
assets: [],
|
788
780
|
amounts: [],
|
781
|
+
assets: [],
|
789
782
|
data: '0x'
|
790
783
|
});
|
791
784
|
return _context3.abrupt("return", callOnExternalPosition({
|
792
|
-
|
785
|
+
actionArgs: actionArgs,
|
786
|
+
actionId: protocol.CompoundDebtPositionActionId.ClaimComp,
|
793
787
|
comptrollerProxy: comptrollerProxy,
|
794
788
|
externalPositionManager: externalPositionManager,
|
795
789
|
externalPositionProxy: externalPositionProxy,
|
796
|
-
|
797
|
-
actionArgs: actionArgs
|
790
|
+
signer: fundOwner
|
798
791
|
}));
|
799
792
|
|
800
793
|
case 3:
|
@@ -820,17 +813,17 @@ function _compoundDebtPositionRemoveCollateral() {
|
|
820
813
|
case 0:
|
821
814
|
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
822
815
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
823
|
-
assets: assets,
|
824
816
|
amounts: amounts,
|
817
|
+
assets: assets,
|
825
818
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
826
819
|
});
|
827
820
|
return _context4.abrupt("return", callOnExternalPosition({
|
828
|
-
|
821
|
+
actionArgs: actionArgs,
|
822
|
+
actionId: protocol.CompoundDebtPositionActionId.RemoveCollateralAssets,
|
829
823
|
comptrollerProxy: comptrollerProxy,
|
830
824
|
externalPositionManager: externalPositionManager,
|
831
825
|
externalPositionProxy: externalPositionProxy,
|
832
|
-
|
833
|
-
actionArgs: actionArgs
|
826
|
+
signer: fundOwner
|
834
827
|
}));
|
835
828
|
|
836
829
|
case 3:
|
@@ -856,17 +849,17 @@ function _compoundDebtPositionRepayBorrow() {
|
|
856
849
|
case 0:
|
857
850
|
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
858
851
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
859
|
-
assets: assets,
|
860
852
|
amounts: amounts,
|
853
|
+
assets: assets,
|
861
854
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
862
855
|
});
|
863
856
|
return _context5.abrupt("return", callOnExternalPosition({
|
864
|
-
|
857
|
+
actionArgs: actionArgs,
|
858
|
+
actionId: protocol.CompoundDebtPositionActionId.RepayBorrowedAssets,
|
865
859
|
comptrollerProxy: comptrollerProxy,
|
866
860
|
externalPositionManager: externalPositionManager,
|
867
861
|
externalPositionProxy: externalPositionProxy,
|
868
|
-
|
869
|
-
actionArgs: actionArgs
|
862
|
+
signer: fundOwner
|
870
863
|
}));
|
871
864
|
|
872
865
|
case 3:
|
@@ -892,10 +885,10 @@ function _createCompoundDebtPosition() {
|
|
892
885
|
case 0:
|
893
886
|
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
894
887
|
return _context6.abrupt("return", createExternalPosition({
|
895
|
-
signer: signer,
|
896
888
|
comptrollerProxy: comptrollerProxy,
|
897
889
|
externalPositionManager: externalPositionManager,
|
898
|
-
externalPositionTypeId: protocol.ExternalPositionType.CompoundDebtPosition
|
890
|
+
externalPositionTypeId: protocol.ExternalPositionType.CompoundDebtPosition,
|
891
|
+
signer: signer
|
899
892
|
}));
|
900
893
|
|
901
894
|
case 2:
|
@@ -920,7 +913,7 @@ function _createMockExternalPosition() {
|
|
920
913
|
switch (_context.prev = _context.next) {
|
921
914
|
case 0:
|
922
915
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
923
|
-
_context.t0 =
|
916
|
+
_context.t0 = protocol.VaultLib;
|
924
917
|
_context.next = 4;
|
925
918
|
return comptrollerProxy.getVaultProxy();
|
926
919
|
|
@@ -938,12 +931,12 @@ function _createMockExternalPosition() {
|
|
938
931
|
|
939
932
|
case 12:
|
940
933
|
_context.next = 14;
|
941
|
-
return
|
934
|
+
return protocol.MockGenericExternalPositionLib.deploy(deployer);
|
942
935
|
|
943
936
|
case 14:
|
944
937
|
mockGenericExternalPositionLib = _context.sent;
|
945
938
|
_context.next = 17;
|
946
|
-
return
|
939
|
+
return protocol.MockGenericExternalPositionParser.deploy(deployer);
|
947
940
|
|
948
941
|
case 17:
|
949
942
|
mockExternalPositionParser = _context.sent;
|
@@ -953,7 +946,12 @@ function _createMockExternalPosition() {
|
|
953
946
|
|
954
947
|
case 21:
|
955
948
|
_context.next = 23;
|
956
|
-
return
|
949
|
+
return createExternalPosition({
|
950
|
+
comptrollerProxy: comptrollerProxy,
|
951
|
+
externalPositionManager: externalPositionManager,
|
952
|
+
externalPositionTypeId: typeId,
|
953
|
+
signer: fundOwner
|
954
|
+
});
|
957
955
|
|
958
956
|
case 23:
|
959
957
|
receipt = _context.sent;
|
@@ -963,11 +961,11 @@ function _createMockExternalPosition() {
|
|
963
961
|
case 26:
|
964
962
|
externalPositionProxy = _context.sent[0];
|
965
963
|
return _context.abrupt("return", {
|
966
|
-
typeId: typeId,
|
967
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
968
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
969
964
|
externalPositionProxy: externalPositionProxy,
|
970
|
-
|
965
|
+
mockExternalPositionParser: mockExternalPositionParser,
|
966
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
967
|
+
receipt: receipt,
|
968
|
+
typeId: typeId
|
971
969
|
});
|
972
970
|
|
973
971
|
case 28:
|
@@ -992,17 +990,17 @@ function _mockExternalPositionAddDebtAssets() {
|
|
992
990
|
switch (_context2.prev = _context2.next) {
|
993
991
|
case 0:
|
994
992
|
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
995
|
-
actionArgs =
|
996
|
-
|
997
|
-
|
993
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
994
|
+
amounts: amounts,
|
995
|
+
assets: assets
|
998
996
|
});
|
999
997
|
return _context2.abrupt("return", callOnExternalPosition({
|
1000
|
-
|
998
|
+
actionArgs: actionArgs,
|
999
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddDebtAssets,
|
1001
1000
|
comptrollerProxy: comptrollerProxy,
|
1002
1001
|
externalPositionManager: externalPositionManager,
|
1003
1002
|
externalPositionProxy: externalPositionProxy,
|
1004
|
-
|
1005
|
-
actionArgs: actionArgs
|
1003
|
+
signer: signer
|
1006
1004
|
}));
|
1007
1005
|
|
1008
1006
|
case 3:
|
@@ -1027,17 +1025,17 @@ function _mockExternalPositionAddManagedAssets() {
|
|
1027
1025
|
switch (_context3.prev = _context3.next) {
|
1028
1026
|
case 0:
|
1029
1027
|
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
1030
|
-
actionArgs =
|
1031
|
-
|
1032
|
-
|
1028
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1029
|
+
amounts: amounts,
|
1030
|
+
assets: assets
|
1033
1031
|
});
|
1034
1032
|
return _context3.abrupt("return", callOnExternalPosition({
|
1035
|
-
|
1033
|
+
actionArgs: actionArgs,
|
1034
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddManagedAssets,
|
1036
1035
|
comptrollerProxy: comptrollerProxy,
|
1037
1036
|
externalPositionManager: externalPositionManager,
|
1038
1037
|
externalPositionProxy: externalPositionProxy,
|
1039
|
-
|
1040
|
-
actionArgs: actionArgs
|
1038
|
+
signer: signer
|
1041
1039
|
}));
|
1042
1040
|
|
1043
1041
|
case 3:
|
@@ -1062,17 +1060,17 @@ function _mockExternalPositionRemoveDebtAssets() {
|
|
1062
1060
|
switch (_context4.prev = _context4.next) {
|
1063
1061
|
case 0:
|
1064
1062
|
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
1065
|
-
actionArgs =
|
1066
|
-
|
1067
|
-
|
1063
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1064
|
+
amounts: amounts,
|
1065
|
+
assets: assets
|
1068
1066
|
});
|
1069
1067
|
return _context4.abrupt("return", callOnExternalPosition({
|
1070
|
-
|
1068
|
+
actionArgs: actionArgs,
|
1069
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveDebtAssets,
|
1071
1070
|
comptrollerProxy: comptrollerProxy,
|
1072
1071
|
externalPositionManager: externalPositionManager,
|
1073
1072
|
externalPositionProxy: externalPositionProxy,
|
1074
|
-
|
1075
|
-
actionArgs: actionArgs
|
1073
|
+
signer: signer
|
1076
1074
|
}));
|
1077
1075
|
|
1078
1076
|
case 3:
|
@@ -1097,17 +1095,17 @@ function _mockExternalPositionRemoveManagedAssets() {
|
|
1097
1095
|
switch (_context5.prev = _context5.next) {
|
1098
1096
|
case 0:
|
1099
1097
|
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
1100
|
-
actionArgs =
|
1101
|
-
|
1102
|
-
|
1098
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1099
|
+
amounts: amounts,
|
1100
|
+
assets: assets
|
1103
1101
|
});
|
1104
1102
|
return _context5.abrupt("return", callOnExternalPosition({
|
1105
|
-
|
1103
|
+
actionArgs: actionArgs,
|
1104
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveManagedAssets,
|
1106
1105
|
comptrollerProxy: comptrollerProxy,
|
1107
1106
|
externalPositionManager: externalPositionManager,
|
1108
1107
|
externalPositionProxy: externalPositionProxy,
|
1109
|
-
|
1110
|
-
actionArgs: actionArgs
|
1108
|
+
signer: signer
|
1111
1109
|
}));
|
1112
1110
|
|
1113
1111
|
case 3:
|
@@ -1120,117 +1118,380 @@ function _mockExternalPositionRemoveManagedAssets() {
|
|
1120
1118
|
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1121
1119
|
}
|
1122
1120
|
|
1123
|
-
|
1124
|
-
|
1121
|
+
var _templateObject$3;
|
1122
|
+
exports.UniswapV3FeeAmount = void 0;
|
1123
|
+
|
1124
|
+
(function (UniswapV3FeeAmount) {
|
1125
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
1126
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
1127
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
1128
|
+
})(exports.UniswapV3FeeAmount || (exports.UniswapV3FeeAmount = {}));
|
1129
|
+
|
1130
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
1131
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
1132
|
+
};
|
1133
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
1134
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
1135
|
+
};
|
1136
|
+
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"])));
|
1137
|
+
function createUniswapV3LiquidityPosition(_x) {
|
1138
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1125
1139
|
}
|
1126
1140
|
|
1127
|
-
function
|
1128
|
-
|
1129
|
-
var
|
1141
|
+
function _createUniswapV3LiquidityPosition() {
|
1142
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1143
|
+
var signer, comptrollerProxy, externalPositionManager, _ref$callOnExternalPo, callOnExternalPositionData, _yield$createExternal, externalPositionProxyContract, receipt;
|
1144
|
+
|
1130
1145
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1131
1146
|
while (1) {
|
1132
1147
|
switch (_context.prev = _context.next) {
|
1133
1148
|
case 0:
|
1134
|
-
|
1149
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, _ref$callOnExternalPo = _ref.callOnExternalPositionData, callOnExternalPositionData = _ref$callOnExternalPo === void 0 ? '0x' : _ref$callOnExternalPo;
|
1135
1150
|
_context.next = 3;
|
1136
|
-
return
|
1137
|
-
|
1151
|
+
return createExternalPosition({
|
1152
|
+
callOnExternalPositionData: callOnExternalPositionData,
|
1153
|
+
comptrollerProxy: comptrollerProxy,
|
1154
|
+
externalPositionManager: externalPositionManager,
|
1155
|
+
externalPositionTypeId: protocol.ExternalPositionType.UniswapV3LiquidityPosition,
|
1156
|
+
signer: signer
|
1138
1157
|
});
|
1139
1158
|
|
1140
1159
|
case 3:
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1160
|
+
_yield$createExternal = _context.sent;
|
1161
|
+
externalPositionProxyContract = _yield$createExternal.externalPositionProxy;
|
1162
|
+
receipt = _yield$createExternal.receipt;
|
1163
|
+
return _context.abrupt("return", {
|
1164
|
+
externalPositionProxyAddress: externalPositionProxyContract.address,
|
1165
|
+
receipt: receipt
|
1166
|
+
});
|
1147
1167
|
|
1148
|
-
case
|
1168
|
+
case 7:
|
1149
1169
|
case "end":
|
1150
1170
|
return _context.stop();
|
1151
1171
|
}
|
1152
1172
|
}
|
1153
1173
|
}, _callee);
|
1154
1174
|
}));
|
1155
|
-
return
|
1175
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1156
1176
|
}
|
1157
1177
|
|
1158
|
-
function
|
1159
|
-
return
|
1178
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
1179
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1160
1180
|
}
|
1161
1181
|
|
1162
|
-
function
|
1163
|
-
|
1164
|
-
var
|
1182
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
1183
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1184
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
1185
|
+
|
1165
1186
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1166
1187
|
while (1) {
|
1167
1188
|
switch (_context2.prev = _context2.next) {
|
1168
1189
|
case 0:
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
return protocol.IFee.mock(deployer);
|
1177
|
-
|
1178
|
-
case 6:
|
1179
|
-
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
1180
|
-
_context2.next = 9;
|
1181
|
-
return protocol.IFee.mock(deployer);
|
1182
|
-
|
1183
|
-
case 9:
|
1184
|
-
mockPostBuySharesFee = _context2.sent;
|
1185
|
-
_context2.next = 12;
|
1186
|
-
return Promise.all([// Continuous fee the mimics ManagementFee
|
1187
|
-
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
|
1188
|
-
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
|
1189
|
-
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)]);
|
1190
|
-
|
1191
|
-
case 12:
|
1192
|
-
return _context2.abrupt("return", {
|
1193
|
-
mockContinuousFeeSettleOnly: mockContinuousFeeSettleOnly,
|
1194
|
-
mockContinuousFeeWithGavAndUpdates: mockContinuousFeeWithGavAndUpdates,
|
1195
|
-
mockPostBuySharesFee: mockPostBuySharesFee
|
1190
|
+
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;
|
1191
|
+
actionArgs = protocol.uniswapV3LiquidityPositionAddLiquidityArgs({
|
1192
|
+
amount0Desired: amount0Desired,
|
1193
|
+
amount0Min: amount0Min,
|
1194
|
+
amount1Desired: amount1Desired,
|
1195
|
+
amount1Min: amount1Min,
|
1196
|
+
nftId: nftId
|
1196
1197
|
});
|
1198
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1199
|
+
actionArgs: actionArgs,
|
1200
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.AddLiquidity,
|
1201
|
+
externalPositionProxy: externalPositionProxy
|
1202
|
+
});
|
1203
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1197
1204
|
|
1198
|
-
case
|
1205
|
+
case 4:
|
1199
1206
|
case "end":
|
1200
1207
|
return _context2.stop();
|
1201
1208
|
}
|
1202
1209
|
}
|
1203
1210
|
}, _callee2);
|
1204
1211
|
}));
|
1205
|
-
return
|
1212
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1206
1213
|
}
|
1207
1214
|
|
1208
|
-
function
|
1209
|
-
return
|
1215
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
1216
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1210
1217
|
}
|
1211
1218
|
|
1212
|
-
function
|
1213
|
-
|
1214
|
-
var
|
1215
|
-
|
1216
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1219
|
+
function _uniswapV3LiquidityPositionCollect() {
|
1220
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1221
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
1222
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1217
1223
|
while (1) {
|
1218
|
-
switch (
|
1224
|
+
switch (_context3.prev = _context3.next) {
|
1219
1225
|
case 0:
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
amount: amount
|
1226
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
1227
|
+
actionArgs = protocol.uniswapV3LiquidityPositionCollectArgs({
|
1228
|
+
nftId: nftId
|
1224
1229
|
});
|
1225
|
-
callArgs = protocol.
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1230
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1231
|
+
actionArgs: actionArgs,
|
1232
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Collect,
|
1233
|
+
externalPositionProxy: externalPositionProxy
|
1229
1234
|
});
|
1230
|
-
|
1231
|
-
return _context.abrupt("return", lendTx);
|
1235
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1232
1236
|
|
1233
|
-
case
|
1237
|
+
case 4:
|
1238
|
+
case "end":
|
1239
|
+
return _context3.stop();
|
1240
|
+
}
|
1241
|
+
}
|
1242
|
+
}, _callee3);
|
1243
|
+
}));
|
1244
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1245
|
+
}
|
1246
|
+
|
1247
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
1248
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1249
|
+
}
|
1250
|
+
|
1251
|
+
function _uniswapV3LiquidityPositionMint() {
|
1252
|
+
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1253
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1254
|
+
|
1255
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1256
|
+
while (1) {
|
1257
|
+
switch (_context4.prev = _context4.next) {
|
1258
|
+
case 0:
|
1259
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, token0 = _ref4.token0, token1 = _ref4.token1, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
1260
|
+
actionArgs = protocol.uniswapV3LiquidityPositionMintArgs({
|
1261
|
+
amount0Desired: amount0Desired,
|
1262
|
+
amount0Min: amount0Min,
|
1263
|
+
amount1Desired: amount1Desired,
|
1264
|
+
amount1Min: amount1Min,
|
1265
|
+
fee: fee,
|
1266
|
+
tickLower: tickLower,
|
1267
|
+
tickUpper: tickUpper,
|
1268
|
+
token0: token0,
|
1269
|
+
token1: token1
|
1270
|
+
});
|
1271
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1272
|
+
actionArgs: actionArgs,
|
1273
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Mint,
|
1274
|
+
externalPositionProxy: externalPositionProxy
|
1275
|
+
});
|
1276
|
+
_context4.next = 5;
|
1277
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
1278
|
+
|
1279
|
+
case 5:
|
1280
|
+
receipt = _context4.sent;
|
1281
|
+
externalPosition = new protocol.UniswapV3LiquidityPositionLib(externalPositionProxy, provider);
|
1282
|
+
nftId = ethers$1.extractEvent(receipt, externalPosition.abi.getEvent('NFTPositionAdded'))[0].args.tokenId;
|
1283
|
+
return _context4.abrupt("return", {
|
1284
|
+
nftId: nftId,
|
1285
|
+
receipt: receipt
|
1286
|
+
});
|
1287
|
+
|
1288
|
+
case 9:
|
1289
|
+
case "end":
|
1290
|
+
return _context4.stop();
|
1291
|
+
}
|
1292
|
+
}
|
1293
|
+
}, _callee4);
|
1294
|
+
}));
|
1295
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1296
|
+
}
|
1297
|
+
|
1298
|
+
function uniswapV3LiquidityPositionPurge(_x5) {
|
1299
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
function _uniswapV3LiquidityPositionPurge() {
|
1303
|
+
_uniswapV3LiquidityPositionPurge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1304
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref5$amount0Min, amount0Min, _ref5$amount1Min, amount1Min, actionArgs, callArgs;
|
1305
|
+
|
1306
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1307
|
+
while (1) {
|
1308
|
+
switch (_context5.prev = _context5.next) {
|
1309
|
+
case 0:
|
1310
|
+
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;
|
1311
|
+
actionArgs = protocol.uniswapV3LiquidityPositionPurgeArgs({
|
1312
|
+
amount0Min: amount0Min,
|
1313
|
+
amount1Min: amount1Min,
|
1314
|
+
liquidity: liquidity,
|
1315
|
+
nftId: nftId
|
1316
|
+
});
|
1317
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1318
|
+
actionArgs: actionArgs,
|
1319
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Purge,
|
1320
|
+
externalPositionProxy: externalPositionProxy
|
1321
|
+
});
|
1322
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1323
|
+
|
1324
|
+
case 4:
|
1325
|
+
case "end":
|
1326
|
+
return _context5.stop();
|
1327
|
+
}
|
1328
|
+
}
|
1329
|
+
}, _callee5);
|
1330
|
+
}));
|
1331
|
+
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
function uniswapV3LiquidityPositionRemoveLiquidity(_x6) {
|
1335
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1336
|
+
}
|
1337
|
+
|
1338
|
+
function _uniswapV3LiquidityPositionRemoveLiquidity() {
|
1339
|
+
_uniswapV3LiquidityPositionRemoveLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
1340
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref6$amount0Min, amount0Min, _ref6$amount1Min, amount1Min, actionArgs, callArgs;
|
1341
|
+
|
1342
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
1343
|
+
while (1) {
|
1344
|
+
switch (_context6.prev = _context6.next) {
|
1345
|
+
case 0:
|
1346
|
+
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;
|
1347
|
+
actionArgs = protocol.uniswapV3LiquidityPositionRemoveLiquidityArgs({
|
1348
|
+
amount0Min: amount0Min,
|
1349
|
+
amount1Min: amount1Min,
|
1350
|
+
liquidity: liquidity,
|
1351
|
+
nftId: nftId
|
1352
|
+
});
|
1353
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
1354
|
+
actionArgs: actionArgs,
|
1355
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.RemoveLiquidity,
|
1356
|
+
externalPositionProxy: externalPositionProxy
|
1357
|
+
});
|
1358
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1359
|
+
|
1360
|
+
case 4:
|
1361
|
+
case "end":
|
1362
|
+
return _context6.stop();
|
1363
|
+
}
|
1364
|
+
}
|
1365
|
+
}, _callee6);
|
1366
|
+
}));
|
1367
|
+
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
function uniswapV3OrderTokenPair(_ref7) {
|
1371
|
+
var tokenA = _ref7.tokenA,
|
1372
|
+
tokenB = _ref7.tokenB;
|
1373
|
+
var tokenAAddress = ethers$1.resolveAddress(tokenA);
|
1374
|
+
var tokenBAddress = ethers$1.resolveAddress(tokenB);
|
1375
|
+
return tokenAAddress < tokenBAddress ? {
|
1376
|
+
token0: tokenAAddress,
|
1377
|
+
token1: tokenBAddress
|
1378
|
+
} : {
|
1379
|
+
token0: tokenBAddress,
|
1380
|
+
token1: tokenAAddress
|
1381
|
+
};
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
function generateFeeManagerConfigWithMockFees(_x) {
|
1385
|
+
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
function _generateFeeManagerConfigWithMockFees() {
|
1389
|
+
_generateFeeManagerConfigWithMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1390
|
+
var deployer, fees, feeManagerSettingsData;
|
1391
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1392
|
+
while (1) {
|
1393
|
+
switch (_context.prev = _context.next) {
|
1394
|
+
case 0:
|
1395
|
+
deployer = _ref.deployer;
|
1396
|
+
_context.next = 3;
|
1397
|
+
return generateMockFees({
|
1398
|
+
deployer: deployer
|
1399
|
+
});
|
1400
|
+
|
1401
|
+
case 3:
|
1402
|
+
fees = _context.sent;
|
1403
|
+
feeManagerSettingsData = [ethers.utils.randomBytes(10), '0x', ethers.utils.randomBytes(2)];
|
1404
|
+
return _context.abrupt("return", protocol.feeManagerConfigArgs({
|
1405
|
+
fees: Object.values(fees),
|
1406
|
+
settings: feeManagerSettingsData
|
1407
|
+
}));
|
1408
|
+
|
1409
|
+
case 6:
|
1410
|
+
case "end":
|
1411
|
+
return _context.stop();
|
1412
|
+
}
|
1413
|
+
}
|
1414
|
+
}, _callee);
|
1415
|
+
}));
|
1416
|
+
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
1417
|
+
}
|
1418
|
+
|
1419
|
+
function generateMockFees(_x2) {
|
1420
|
+
return _generateMockFees.apply(this, arguments);
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
function _generateMockFees() {
|
1424
|
+
_generateMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1425
|
+
var deployer, mockContinuousFeeSettleOnly, mockContinuousFeeWithGavAndUpdates, mockPostBuySharesFee;
|
1426
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1427
|
+
while (1) {
|
1428
|
+
switch (_context2.prev = _context2.next) {
|
1429
|
+
case 0:
|
1430
|
+
deployer = _ref2.deployer;
|
1431
|
+
_context2.next = 3;
|
1432
|
+
return protocol.IFee.mock(deployer);
|
1433
|
+
|
1434
|
+
case 3:
|
1435
|
+
mockContinuousFeeSettleOnly = _context2.sent;
|
1436
|
+
_context2.next = 6;
|
1437
|
+
return protocol.IFee.mock(deployer);
|
1438
|
+
|
1439
|
+
case 6:
|
1440
|
+
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
1441
|
+
_context2.next = 9;
|
1442
|
+
return protocol.IFee.mock(deployer);
|
1443
|
+
|
1444
|
+
case 9:
|
1445
|
+
mockPostBuySharesFee = _context2.sent;
|
1446
|
+
_context2.next = 12;
|
1447
|
+
return Promise.all([// Continuous fee the mimics ManagementFee
|
1448
|
+
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
|
1449
|
+
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
|
1450
|
+
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)]);
|
1451
|
+
|
1452
|
+
case 12:
|
1453
|
+
return _context2.abrupt("return", {
|
1454
|
+
mockContinuousFeeSettleOnly: mockContinuousFeeSettleOnly,
|
1455
|
+
mockContinuousFeeWithGavAndUpdates: mockContinuousFeeWithGavAndUpdates,
|
1456
|
+
mockPostBuySharesFee: mockPostBuySharesFee
|
1457
|
+
});
|
1458
|
+
|
1459
|
+
case 13:
|
1460
|
+
case "end":
|
1461
|
+
return _context2.stop();
|
1462
|
+
}
|
1463
|
+
}
|
1464
|
+
}, _callee2);
|
1465
|
+
}));
|
1466
|
+
return _generateMockFees.apply(this, arguments);
|
1467
|
+
}
|
1468
|
+
|
1469
|
+
function aaveLend(_x) {
|
1470
|
+
return _aaveLend.apply(this, arguments);
|
1471
|
+
}
|
1472
|
+
|
1473
|
+
function _aaveLend() {
|
1474
|
+
_aaveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1475
|
+
var comptrollerProxy, integrationManager, fundOwner, aaveAdapter, aToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
1476
|
+
|
1477
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1478
|
+
while (1) {
|
1479
|
+
switch (_context.prev = _context.next) {
|
1480
|
+
case 0:
|
1481
|
+
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;
|
1482
|
+
lendArgs = protocol.aaveLendArgs({
|
1483
|
+
aToken: aToken,
|
1484
|
+
amount: amount
|
1485
|
+
});
|
1486
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1487
|
+
adapter: aaveAdapter,
|
1488
|
+
encodedCallArgs: lendArgs,
|
1489
|
+
selector: protocol.lendSelector
|
1490
|
+
});
|
1491
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1492
|
+
return _context.abrupt("return", lendTx);
|
1493
|
+
|
1494
|
+
case 5:
|
1234
1495
|
case "end":
|
1235
1496
|
return _context.stop();
|
1236
1497
|
}
|
@@ -1259,8 +1520,8 @@ function _aaveRedeem() {
|
|
1259
1520
|
});
|
1260
1521
|
callArgs = protocol.callOnIntegrationArgs({
|
1261
1522
|
adapter: aaveAdapter,
|
1262
|
-
|
1263
|
-
|
1523
|
+
encodedCallArgs: redeemArgs,
|
1524
|
+
selector: protocol.redeemSelector
|
1264
1525
|
});
|
1265
1526
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1266
1527
|
return _context2.abrupt("return", redeemTx);
|
@@ -1277,87 +1538,303 @@ function _aaveRedeem() {
|
|
1277
1538
|
|
1278
1539
|
var _templateObject$2;
|
1279
1540
|
var ICompoundComptroller = ethers$1.contract()(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n function claimComp(address)\n"])));
|
1280
|
-
function
|
1281
|
-
return
|
1541
|
+
function assertCompoundLend(_x) {
|
1542
|
+
return _assertCompoundLend.apply(this, arguments);
|
1282
1543
|
}
|
1283
1544
|
|
1284
|
-
function
|
1285
|
-
|
1286
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter,
|
1545
|
+
function _assertCompoundLend() {
|
1546
|
+
_assertCompoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1547
|
+
var tokenWhale, comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, _ref$tokenAmount, tokenAmount, cToken, compoundPriceFeed, token, rateBefore, minIncomingCTokenAmount, _yield$getAssetBalanc, _yield$getAssetBalanc2, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, lendReceipt, rate, _yield$getAssetBalanc3, _yield$getAssetBalanc4, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, expectedCTokenAmount;
|
1287
1548
|
|
1288
1549
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1289
1550
|
while (1) {
|
1290
1551
|
switch (_context.prev = _context.next) {
|
1291
1552
|
case 0:
|
1292
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
1553
|
+
tokenWhale = _ref.tokenWhale, comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$tokenAmount, cToken = _ref.cToken, compoundPriceFeed = _ref.compoundPriceFeed;
|
1554
|
+
_context.t0 = protocol.StandardToken;
|
1555
|
+
_context.next = 4;
|
1556
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1557
|
+
|
1558
|
+
case 4:
|
1559
|
+
_context.t1 = _context.sent;
|
1560
|
+
_context.t2 = tokenWhale;
|
1561
|
+
token = new _context.t0(_context.t1, _context.t2);
|
1562
|
+
_context.next = 9;
|
1563
|
+
return token.connect(tokenWhale).transfer(vaultProxy, tokenAmount);
|
1564
|
+
|
1565
|
+
case 9:
|
1566
|
+
_context.next = 11;
|
1567
|
+
return cToken.exchangeRateStored.call();
|
1568
|
+
|
1569
|
+
case 11:
|
1570
|
+
rateBefore = _context.sent;
|
1571
|
+
// Exchange rate stored can have a small deviation from exchangeRateStored
|
1572
|
+
minIncomingCTokenAmount = tokenAmount.mul(ethers.utils.parseEther('1')).div(rateBefore).mul(ethers.BigNumber.from('999')).div(ethers.BigNumber.from('1000'));
|
1573
|
+
_context.next = 15;
|
1574
|
+
return getAssetBalances({
|
1575
|
+
account: vaultProxy,
|
1576
|
+
assets: [cToken, token]
|
1577
|
+
});
|
1578
|
+
|
1579
|
+
case 15:
|
1580
|
+
_yield$getAssetBalanc = _context.sent;
|
1581
|
+
_yield$getAssetBalanc2 = _slicedToArray(_yield$getAssetBalanc, 2);
|
1582
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc2[0];
|
1583
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc2[1];
|
1584
|
+
_context.next = 21;
|
1585
|
+
return compoundLend({
|
1586
|
+
cToken: cToken,
|
1587
|
+
cTokenAmount: minIncomingCTokenAmount,
|
1588
|
+
compoundAdapter: compoundAdapter,
|
1589
|
+
comptrollerProxy: comptrollerProxy,
|
1590
|
+
fundOwner: fundOwner,
|
1591
|
+
integrationManager: integrationManager,
|
1592
|
+
tokenAmount: tokenAmount
|
1593
|
+
});
|
1594
|
+
|
1595
|
+
case 21:
|
1596
|
+
lendReceipt = _context.sent;
|
1597
|
+
_context.next = 24;
|
1598
|
+
return cToken.exchangeRateStored();
|
1599
|
+
|
1600
|
+
case 24:
|
1601
|
+
rate = _context.sent;
|
1602
|
+
_context.next = 27;
|
1603
|
+
return getAssetBalances({
|
1604
|
+
account: vaultProxy,
|
1605
|
+
assets: [cToken, token]
|
1606
|
+
});
|
1607
|
+
|
1608
|
+
case 27:
|
1609
|
+
_yield$getAssetBalanc3 = _context.sent;
|
1610
|
+
_yield$getAssetBalanc4 = _slicedToArray(_yield$getAssetBalanc3, 2);
|
1611
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc4[0];
|
1612
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc4[1];
|
1613
|
+
expectedCTokenAmount = tokenAmount.mul(ethers.utils.parseEther('1')).div(rate);
|
1614
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedCTokenAmount));
|
1615
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(tokenAmount));
|
1616
|
+
return _context.abrupt("return", lendReceipt);
|
1617
|
+
|
1618
|
+
case 35:
|
1619
|
+
case "end":
|
1620
|
+
return _context.stop();
|
1621
|
+
}
|
1622
|
+
}
|
1623
|
+
}, _callee);
|
1624
|
+
}));
|
1625
|
+
return _assertCompoundLend.apply(this, arguments);
|
1626
|
+
}
|
1627
|
+
|
1628
|
+
function assertCompoundRedeem(_x2) {
|
1629
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
1630
|
+
}
|
1631
|
+
|
1632
|
+
function _assertCompoundRedeem() {
|
1633
|
+
_assertCompoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1634
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, cToken, compoundPriceFeed, cTokenAmount, token, _yield$getAssetBalanc5, _yield$getAssetBalanc6, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, rateBefore, minIncomingTokenAmount, redeemReceipt, _yield$getAssetBalanc7, _yield$getAssetBalanc8, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, rate, expectedTokenAmount;
|
1635
|
+
|
1636
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1637
|
+
while (1) {
|
1638
|
+
switch (_context2.prev = _context2.next) {
|
1639
|
+
case 0:
|
1640
|
+
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, compoundPriceFeed = _ref2.compoundPriceFeed;
|
1641
|
+
_context2.t0 = ethers.utils;
|
1642
|
+
_context2.next = 4;
|
1643
|
+
return cToken.decimals();
|
1644
|
+
|
1645
|
+
case 4:
|
1646
|
+
_context2.t1 = _context2.sent;
|
1647
|
+
cTokenAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
1648
|
+
_context2.next = 8;
|
1649
|
+
return cToken.transfer(vaultProxy, cTokenAmount);
|
1650
|
+
|
1651
|
+
case 8:
|
1652
|
+
_context2.t2 = protocol.StandardToken;
|
1653
|
+
_context2.next = 11;
|
1654
|
+
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1655
|
+
|
1656
|
+
case 11:
|
1657
|
+
_context2.t3 = _context2.sent;
|
1658
|
+
_context2.t4 = provider;
|
1659
|
+
token = new _context2.t2(_context2.t3, _context2.t4);
|
1660
|
+
_context2.next = 16;
|
1661
|
+
return getAssetBalances({
|
1662
|
+
account: vaultProxy,
|
1663
|
+
assets: [token, cToken]
|
1664
|
+
});
|
1665
|
+
|
1666
|
+
case 16:
|
1667
|
+
_yield$getAssetBalanc5 = _context2.sent;
|
1668
|
+
_yield$getAssetBalanc6 = _slicedToArray(_yield$getAssetBalanc5, 2);
|
1669
|
+
preTxIncomingAssetBalance = _yield$getAssetBalanc6[0];
|
1670
|
+
preTxOutgoingAssetBalance = _yield$getAssetBalanc6[1];
|
1671
|
+
_context2.next = 22;
|
1672
|
+
return cToken.exchangeRateStored();
|
1673
|
+
|
1674
|
+
case 22:
|
1675
|
+
rateBefore = _context2.sent;
|
1676
|
+
minIncomingTokenAmount = cTokenAmount.mul(rateBefore).div(ethers.utils.parseEther('1'));
|
1677
|
+
_context2.next = 26;
|
1678
|
+
return compoundRedeem({
|
1679
|
+
cToken: cToken,
|
1680
|
+
cTokenAmount: cTokenAmount,
|
1681
|
+
compoundAdapter: compoundAdapter,
|
1682
|
+
comptrollerProxy: comptrollerProxy,
|
1683
|
+
fundOwner: fundOwner,
|
1684
|
+
integrationManager: integrationManager,
|
1685
|
+
tokenAmount: minIncomingTokenAmount,
|
1686
|
+
vaultProxy: vaultProxy
|
1687
|
+
});
|
1688
|
+
|
1689
|
+
case 26:
|
1690
|
+
redeemReceipt = _context2.sent;
|
1691
|
+
_context2.next = 29;
|
1692
|
+
return getAssetBalances({
|
1693
|
+
account: vaultProxy,
|
1694
|
+
assets: [token, cToken]
|
1695
|
+
});
|
1696
|
+
|
1697
|
+
case 29:
|
1698
|
+
_yield$getAssetBalanc7 = _context2.sent;
|
1699
|
+
_yield$getAssetBalanc8 = _slicedToArray(_yield$getAssetBalanc7, 2);
|
1700
|
+
postTxIncomingAssetBalance = _yield$getAssetBalanc8[0];
|
1701
|
+
postTxOutgoingAssetBalance = _yield$getAssetBalanc8[1];
|
1702
|
+
_context2.next = 35;
|
1703
|
+
return cToken.exchangeRateStored();
|
1704
|
+
|
1705
|
+
case 35:
|
1706
|
+
rate = _context2.sent;
|
1707
|
+
expectedTokenAmount = cTokenAmount.mul(rate).div(ethers.utils.parseEther('1'));
|
1708
|
+
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedTokenAmount));
|
1709
|
+
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(cTokenAmount));
|
1710
|
+
return _context2.abrupt("return", redeemReceipt);
|
1711
|
+
|
1712
|
+
case 40:
|
1713
|
+
case "end":
|
1714
|
+
return _context2.stop();
|
1715
|
+
}
|
1716
|
+
}
|
1717
|
+
}, _callee2);
|
1718
|
+
}));
|
1719
|
+
return _assertCompoundRedeem.apply(this, arguments);
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
function compoundClaim(_x3) {
|
1723
|
+
return _compoundClaim.apply(this, arguments);
|
1724
|
+
}
|
1725
|
+
|
1726
|
+
function _compoundClaim() {
|
1727
|
+
_compoundClaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1728
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, compoundComptroller, cTokens, claimArgs, callArgs, claimRewardsTx;
|
1729
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1730
|
+
while (1) {
|
1731
|
+
switch (_context3.prev = _context3.next) {
|
1732
|
+
case 0:
|
1733
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, compoundAdapter = _ref3.compoundAdapter, compoundComptroller = _ref3.compoundComptroller, cTokens = _ref3.cTokens;
|
1734
|
+
claimArgs = protocol.compoundClaimRewardsArgs({
|
1735
|
+
cTokens: cTokens,
|
1736
|
+
compoundComptroller: compoundComptroller
|
1737
|
+
});
|
1738
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1739
|
+
adapter: compoundAdapter,
|
1740
|
+
encodedCallArgs: claimArgs,
|
1741
|
+
selector: protocol.claimRewardsSelector
|
1742
|
+
});
|
1743
|
+
claimRewardsTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1744
|
+
return _context3.abrupt("return", claimRewardsTx);
|
1745
|
+
|
1746
|
+
case 5:
|
1747
|
+
case "end":
|
1748
|
+
return _context3.stop();
|
1749
|
+
}
|
1750
|
+
}
|
1751
|
+
}, _callee3);
|
1752
|
+
}));
|
1753
|
+
return _compoundClaim.apply(this, arguments);
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
function compoundLend(_x4) {
|
1757
|
+
return _compoundLend.apply(this, arguments);
|
1758
|
+
}
|
1759
|
+
|
1760
|
+
function _compoundLend() {
|
1761
|
+
_compoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1762
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref4$tokenAmount, tokenAmount, _ref4$cTokenAmount, cTokenAmount, lendArgs, callArgs, lendTx;
|
1763
|
+
|
1764
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1765
|
+
while (1) {
|
1766
|
+
switch (_context4.prev = _context4.next) {
|
1767
|
+
case 0:
|
1768
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, compoundAdapter = _ref4.compoundAdapter, cToken = _ref4.cToken, _ref4$tokenAmount = _ref4.tokenAmount, tokenAmount = _ref4$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref4$tokenAmount, _ref4$cTokenAmount = _ref4.cTokenAmount, cTokenAmount = _ref4$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref4$cTokenAmount;
|
1293
1769
|
lendArgs = protocol.compoundArgs({
|
1294
1770
|
cToken: cToken,
|
1295
|
-
|
1296
|
-
|
1771
|
+
minIncomingAssetAmount: cTokenAmount,
|
1772
|
+
outgoingAssetAmount: tokenAmount
|
1297
1773
|
});
|
1298
1774
|
callArgs = protocol.callOnIntegrationArgs({
|
1299
1775
|
adapter: compoundAdapter,
|
1300
|
-
|
1301
|
-
|
1776
|
+
encodedCallArgs: lendArgs,
|
1777
|
+
selector: protocol.lendSelector
|
1302
1778
|
});
|
1303
1779
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1304
|
-
return
|
1780
|
+
return _context4.abrupt("return", lendTx);
|
1305
1781
|
|
1306
1782
|
case 5:
|
1307
1783
|
case "end":
|
1308
|
-
return
|
1784
|
+
return _context4.stop();
|
1309
1785
|
}
|
1310
1786
|
}
|
1311
|
-
},
|
1787
|
+
}, _callee4);
|
1312
1788
|
}));
|
1313
1789
|
return _compoundLend.apply(this, arguments);
|
1314
1790
|
}
|
1315
1791
|
|
1316
|
-
function compoundRedeem(
|
1792
|
+
function compoundRedeem(_x5) {
|
1317
1793
|
return _compoundRedeem.apply(this, arguments);
|
1318
1794
|
}
|
1319
1795
|
|
1320
1796
|
function _compoundRedeem() {
|
1321
|
-
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
1322
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken,
|
1797
|
+
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1798
|
+
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref5$tokenAmount, tokenAmount, _ref5$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
1323
1799
|
|
1324
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
1800
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1325
1801
|
while (1) {
|
1326
|
-
switch (
|
1802
|
+
switch (_context5.prev = _context5.next) {
|
1327
1803
|
case 0:
|
1328
|
-
comptrollerProxy =
|
1804
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, fundOwner = _ref5.fundOwner, compoundAdapter = _ref5.compoundAdapter, cToken = _ref5.cToken, _ref5$tokenAmount = _ref5.tokenAmount, tokenAmount = _ref5$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref5$tokenAmount, _ref5$cTokenAmount = _ref5.cTokenAmount, cTokenAmount = _ref5$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref5$cTokenAmount;
|
1329
1805
|
redeemArgs = protocol.compoundArgs({
|
1330
1806
|
cToken: ethers$1.resolveAddress(cToken),
|
1331
|
-
|
1332
|
-
|
1807
|
+
minIncomingAssetAmount: tokenAmount,
|
1808
|
+
outgoingAssetAmount: cTokenAmount
|
1333
1809
|
});
|
1334
1810
|
callArgs = protocol.callOnIntegrationArgs({
|
1335
1811
|
adapter: compoundAdapter,
|
1336
|
-
|
1337
|
-
|
1812
|
+
encodedCallArgs: redeemArgs,
|
1813
|
+
selector: protocol.redeemSelector
|
1338
1814
|
});
|
1339
1815
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1340
|
-
return
|
1816
|
+
return _context5.abrupt("return", redeemTx);
|
1341
1817
|
|
1342
1818
|
case 5:
|
1343
1819
|
case "end":
|
1344
|
-
return
|
1820
|
+
return _context5.stop();
|
1345
1821
|
}
|
1346
1822
|
}
|
1347
|
-
},
|
1823
|
+
}, _callee5);
|
1348
1824
|
}));
|
1349
1825
|
return _compoundRedeem.apply(this, arguments);
|
1350
1826
|
}
|
1351
1827
|
|
1352
|
-
var _templateObject$1, _templateObject2, _templateObject3;
|
1353
|
-
var CurveLiquidityGaugeV2 = ethers$1.contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
1828
|
+
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
1829
|
+
var CurveLiquidityGaugeV2 = ethers$1.contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
1830
|
+
var CurveRegistry = ethers$1.contract()(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n function get_coins(address) view returns (address[8])\n function get_lp_token(address) view returns (address)\n"]))); // prettier-ignore
|
1354
1831
|
|
1355
|
-
var CurveSwaps = ethers$1.contract()(
|
1356
|
-
var CurveMinter = ethers$1.contract()(
|
1832
|
+
var CurveSwaps = ethers$1.contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
1833
|
+
var CurveMinter = ethers$1.contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
1357
1834
|
|
1358
1835
|
function curveTakeOrder(_x) {
|
1359
1836
|
return _curveTakeOrder.apply(this, arguments);
|
1360
|
-
} //
|
1837
|
+
} // combined liquidity
|
1361
1838
|
|
1362
1839
|
function _curveTakeOrder() {
|
1363
1840
|
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
@@ -1369,16 +1846,16 @@ function _curveTakeOrder() {
|
|
1369
1846
|
case 0:
|
1370
1847
|
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;
|
1371
1848
|
takeOrderArgs = protocol.curveTakeOrderArgs({
|
1372
|
-
|
1849
|
+
incomingAsset: incomingAsset,
|
1850
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
1373
1851
|
outgoingAsset: outgoingAsset,
|
1374
1852
|
outgoingAssetAmount: outgoingAssetAmount,
|
1375
|
-
|
1376
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
1853
|
+
pool: pool
|
1377
1854
|
});
|
1378
1855
|
callArgs = protocol.callOnIntegrationArgs({
|
1379
1856
|
adapter: curveExchangeAdapter,
|
1380
|
-
|
1381
|
-
|
1857
|
+
encodedCallArgs: takeOrderArgs,
|
1858
|
+
selector: protocol.takeOrderSelector
|
1382
1859
|
});
|
1383
1860
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1384
1861
|
|
@@ -1392,284 +1869,384 @@ function _curveTakeOrder() {
|
|
1392
1869
|
return _curveTakeOrder.apply(this, arguments);
|
1393
1870
|
}
|
1394
1871
|
|
1395
|
-
function
|
1872
|
+
function curveClaimRewards(_ref2) {
|
1396
1873
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
1397
1874
|
integrationManager = _ref2.integrationManager,
|
1398
1875
|
fundOwner = _ref2.fundOwner,
|
1399
|
-
|
1876
|
+
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
1877
|
+
stakingToken = _ref2.stakingToken;
|
1400
1878
|
var callArgs = protocol.callOnIntegrationArgs({
|
1401
|
-
adapter:
|
1402
|
-
|
1403
|
-
|
1879
|
+
adapter: curveLiquidityAdapter,
|
1880
|
+
encodedCallArgs: protocol.curveClaimRewardsArgs({
|
1881
|
+
stakingToken: stakingToken
|
1882
|
+
}),
|
1883
|
+
selector: protocol.claimRewardsSelector
|
1404
1884
|
});
|
1405
1885
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1406
1886
|
}
|
1407
|
-
function
|
1408
|
-
|
1409
|
-
integrationManager = _ref3.integrationManager,
|
1410
|
-
fundOwner = _ref3.fundOwner,
|
1411
|
-
curveLiquidityAaveAdapter = _ref3.curveLiquidityAaveAdapter,
|
1412
|
-
_ref3$outgoingAaveDai = _ref3.outgoingAaveDaiAmount,
|
1413
|
-
outgoingAaveDaiAmount = _ref3$outgoingAaveDai === void 0 ? ethers.BigNumber.from(0) : _ref3$outgoingAaveDai,
|
1414
|
-
_ref3$outgoingAaveUsd = _ref3.outgoingAaveUsdcAmount,
|
1415
|
-
outgoingAaveUsdcAmount = _ref3$outgoingAaveUsd === void 0 ? ethers.BigNumber.from(0) : _ref3$outgoingAaveUsd,
|
1416
|
-
_ref3$outgoingAaveUsd2 = _ref3.outgoingAaveUsdtAmount,
|
1417
|
-
outgoingAaveUsdtAmount = _ref3$outgoingAaveUsd2 === void 0 ? ethers.BigNumber.from(0) : _ref3$outgoingAaveUsd2,
|
1418
|
-
_ref3$minIncomingLPTo = _ref3.minIncomingLPTokenAmount,
|
1419
|
-
minIncomingLPTokenAmount = _ref3$minIncomingLPTo === void 0 ? ethers.BigNumber.from(1) : _ref3$minIncomingLPTo,
|
1420
|
-
_ref3$useUnderlyings = _ref3.useUnderlyings,
|
1421
|
-
useUnderlyings = _ref3$useUnderlyings === void 0 ? false : _ref3$useUnderlyings;
|
1422
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
1423
|
-
adapter: curveLiquidityAaveAdapter,
|
1424
|
-
selector: protocol.lendSelector,
|
1425
|
-
encodedCallArgs: protocol.curveAaveLendArgs({
|
1426
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
1427
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
1428
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
1429
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1430
|
-
useUnderlyings: useUnderlyings
|
1431
|
-
})
|
1432
|
-
});
|
1433
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1887
|
+
function curveLend(_x2) {
|
1888
|
+
return _curveLend.apply(this, arguments);
|
1434
1889
|
}
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1890
|
+
|
1891
|
+
function _curveLend() {
|
1892
|
+
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref3) {
|
1893
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
1894
|
+
|
1895
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1896
|
+
while (1) {
|
1897
|
+
switch (_context2.prev = _context2.next) {
|
1898
|
+
case 0:
|
1899
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, signer = _ref3.signer, curveLiquidityAdapter = _ref3.curveLiquidityAdapter, pool = _ref3.pool, orderedOutgoingAssetAmounts = _ref3.orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo = _ref3.minIncomingLpTokenAmount, minIncomingLpTokenAmount = _ref3$minIncomingLpTo === void 0 ? ethers.BigNumber.from(1) : _ref3$minIncomingLpTo, useUnderlyings = _ref3.useUnderlyings;
|
1900
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1901
|
+
adapter: curveLiquidityAdapter,
|
1902
|
+
encodedCallArgs: protocol.curveLendArgs({
|
1903
|
+
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
1904
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1905
|
+
pool: pool,
|
1906
|
+
useUnderlyings: useUnderlyings
|
1907
|
+
}),
|
1908
|
+
selector: protocol.lendSelector
|
1909
|
+
});
|
1910
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1911
|
+
|
1912
|
+
case 3:
|
1913
|
+
case "end":
|
1914
|
+
return _context2.stop();
|
1915
|
+
}
|
1916
|
+
}
|
1917
|
+
}, _callee2);
|
1918
|
+
}));
|
1919
|
+
return _curveLend.apply(this, arguments);
|
1462
1920
|
}
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
fundOwner = _ref5.fundOwner,
|
1467
|
-
curveLiquidityAaveAdapter = _ref5.curveLiquidityAaveAdapter,
|
1468
|
-
outgoingLPTokenAmount = _ref5.outgoingLPTokenAmount,
|
1469
|
-
_ref5$minIncomingAave = _ref5.minIncomingAaveDaiAmount,
|
1470
|
-
minIncomingAaveDaiAmount = _ref5$minIncomingAave === void 0 ? ethers.BigNumber.from(1) : _ref5$minIncomingAave,
|
1471
|
-
_ref5$minIncomingAave2 = _ref5.minIncomingAaveUsdcAmount,
|
1472
|
-
minIncomingAaveUsdcAmount = _ref5$minIncomingAave2 === void 0 ? ethers.BigNumber.from(1) : _ref5$minIncomingAave2,
|
1473
|
-
_ref5$minIncomingAave3 = _ref5.minIncomingAaveUsdtAmount,
|
1474
|
-
minIncomingAaveUsdtAmount = _ref5$minIncomingAave3 === void 0 ? ethers.BigNumber.from(1) : _ref5$minIncomingAave3,
|
1475
|
-
_ref5$receiveSingleAs = _ref5.receiveSingleAsset,
|
1476
|
-
receiveSingleAsset = _ref5$receiveSingleAs === void 0 ? false : _ref5$receiveSingleAs,
|
1477
|
-
_ref5$useUnderlyings = _ref5.useUnderlyings,
|
1478
|
-
useUnderlyings = _ref5$useUnderlyings === void 0 ? false : _ref5$useUnderlyings;
|
1479
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
1480
|
-
adapter: curveLiquidityAaveAdapter,
|
1481
|
-
selector: protocol.redeemSelector,
|
1482
|
-
encodedCallArgs: protocol.curveAaveRedeemArgs({
|
1483
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1484
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1485
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1486
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1487
|
-
receiveSingleAsset: receiveSingleAsset,
|
1488
|
-
useUnderlyings: useUnderlyings
|
1489
|
-
})
|
1490
|
-
});
|
1491
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1921
|
+
|
1922
|
+
function curveLendAndStake(_x3) {
|
1923
|
+
return _curveLendAndStake.apply(this, arguments);
|
1492
1924
|
}
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1925
|
+
|
1926
|
+
function _curveLendAndStake() {
|
1927
|
+
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref4) {
|
1928
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingStakingToken, _ref4$minIncomingStak, minIncomingStakingTokenAmount, useUnderlyings, callArgs;
|
1929
|
+
|
1930
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1931
|
+
while (1) {
|
1932
|
+
switch (_context3.prev = _context3.next) {
|
1933
|
+
case 0:
|
1934
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingStakingToken = _ref4.incomingStakingToken, _ref4$minIncomingStak = _ref4.minIncomingStakingTokenAmount, minIncomingStakingTokenAmount = _ref4$minIncomingStak === void 0 ? ethers.BigNumber.from(1) : _ref4$minIncomingStak, useUnderlyings = _ref4.useUnderlyings;
|
1935
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1936
|
+
adapter: curveLiquidityAdapter,
|
1937
|
+
encodedCallArgs: protocol.curveLendAndStakeArgs({
|
1938
|
+
incomingStakingToken: incomingStakingToken,
|
1939
|
+
minIncomingStakingTokenAmount: minIncomingStakingTokenAmount,
|
1940
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1941
|
+
pool: pool,
|
1942
|
+
useUnderlyings: useUnderlyings
|
1943
|
+
}),
|
1944
|
+
selector: protocol.lendAndStakeSelector
|
1945
|
+
});
|
1946
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1947
|
+
|
1948
|
+
case 3:
|
1949
|
+
case "end":
|
1950
|
+
return _context3.stop();
|
1951
|
+
}
|
1952
|
+
}
|
1953
|
+
}, _callee3);
|
1954
|
+
}));
|
1955
|
+
return _curveLendAndStake.apply(this, arguments);
|
1507
1956
|
}
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
fundOwner = _ref7.fundOwner,
|
1512
|
-
curveLiquidityAaveAdapter = _ref7.curveLiquidityAaveAdapter,
|
1513
|
-
outgoingLiquidityGaugeTokenAmount = _ref7.outgoingLiquidityGaugeTokenAmount,
|
1514
|
-
_ref7$minIncomingAave = _ref7.minIncomingAaveDaiAmount,
|
1515
|
-
minIncomingAaveDaiAmount = _ref7$minIncomingAave === void 0 ? ethers.BigNumber.from(1) : _ref7$minIncomingAave,
|
1516
|
-
_ref7$minIncomingAave2 = _ref7.minIncomingAaveUsdcAmount,
|
1517
|
-
minIncomingAaveUsdcAmount = _ref7$minIncomingAave2 === void 0 ? ethers.BigNumber.from(1) : _ref7$minIncomingAave2,
|
1518
|
-
_ref7$minIncomingAave3 = _ref7.minIncomingAaveUsdtAmount,
|
1519
|
-
minIncomingAaveUsdtAmount = _ref7$minIncomingAave3 === void 0 ? ethers.BigNumber.from(1) : _ref7$minIncomingAave3,
|
1520
|
-
_ref7$receiveSingleAs = _ref7.receiveSingleAsset,
|
1521
|
-
receiveSingleAsset = _ref7$receiveSingleAs === void 0 ? false : _ref7$receiveSingleAs,
|
1522
|
-
_ref7$useUnderlyings = _ref7.useUnderlyings,
|
1523
|
-
useUnderlyings = _ref7$useUnderlyings === void 0 ? false : _ref7$useUnderlyings;
|
1524
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
1525
|
-
adapter: curveLiquidityAaveAdapter,
|
1526
|
-
selector: protocol.unstakeAndRedeemSelector,
|
1527
|
-
encodedCallArgs: protocol.curveAaveUnstakeAndRedeemArgs({
|
1528
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1529
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
1530
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
1531
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1532
|
-
receiveSingleAsset: receiveSingleAsset,
|
1533
|
-
useUnderlyings: useUnderlyings
|
1534
|
-
})
|
1535
|
-
});
|
1536
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1957
|
+
|
1958
|
+
function curveRedeem(_x4) {
|
1959
|
+
return _curveRedeem.apply(this, arguments);
|
1537
1960
|
}
|
1538
|
-
function curveAaveUnstake(_ref8) {
|
1539
|
-
var comptrollerProxy = _ref8.comptrollerProxy,
|
1540
|
-
integrationManager = _ref8.integrationManager,
|
1541
|
-
fundOwner = _ref8.fundOwner,
|
1542
|
-
curveLiquidityAaveAdapter = _ref8.curveLiquidityAaveAdapter,
|
1543
|
-
outgoingLiquidityGaugeTokenAmount = _ref8.outgoingLiquidityGaugeTokenAmount;
|
1544
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
1545
|
-
adapter: curveLiquidityAaveAdapter,
|
1546
|
-
selector: protocol.unstakeSelector,
|
1547
|
-
encodedCallArgs: protocol.curveAaveUnstakeArgs({
|
1548
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1549
|
-
})
|
1550
|
-
});
|
1551
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1552
|
-
} // eurs pool
|
1553
1961
|
|
1554
|
-
function
|
1962
|
+
function _curveRedeem() {
|
1963
|
+
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref5) {
|
1964
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
1965
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1966
|
+
while (1) {
|
1967
|
+
switch (_context4.prev = _context4.next) {
|
1968
|
+
case 0:
|
1969
|
+
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, signer = _ref5.signer, curveLiquidityAdapter = _ref5.curveLiquidityAdapter, pool = _ref5.pool, outgoingLpTokenAmount = _ref5.outgoingLpTokenAmount, useUnderlyings = _ref5.useUnderlyings, redeemType = _ref5.redeemType, incomingAssetData = _ref5.incomingAssetData;
|
1970
|
+
callArgs = protocol.callOnIntegrationArgs({
|
1971
|
+
adapter: curveLiquidityAdapter,
|
1972
|
+
encodedCallArgs: protocol.curveRedeemArgs({
|
1973
|
+
incomingAssetData: incomingAssetData,
|
1974
|
+
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
1975
|
+
pool: pool,
|
1976
|
+
redeemType: redeemType,
|
1977
|
+
useUnderlyings: useUnderlyings
|
1978
|
+
}),
|
1979
|
+
selector: protocol.redeemSelector
|
1980
|
+
});
|
1981
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1982
|
+
|
1983
|
+
case 3:
|
1984
|
+
case "end":
|
1985
|
+
return _context4.stop();
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
}, _callee4);
|
1989
|
+
}));
|
1990
|
+
return _curveRedeem.apply(this, arguments);
|
1991
|
+
}
|
1992
|
+
|
1993
|
+
function curveStake(_x5) {
|
1994
|
+
return _curveStake.apply(this, arguments);
|
1995
|
+
}
|
1996
|
+
|
1997
|
+
function _curveStake() {
|
1998
|
+
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref6) {
|
1999
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingStakingToken, amount, callArgs;
|
2000
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
2001
|
+
while (1) {
|
2002
|
+
switch (_context5.prev = _context5.next) {
|
2003
|
+
case 0:
|
2004
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingStakingToken = _ref6.incomingStakingToken, amount = _ref6.amount;
|
2005
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2006
|
+
adapter: curveLiquidityAdapter,
|
2007
|
+
encodedCallArgs: protocol.curveStakeArgs({
|
2008
|
+
amount: amount,
|
2009
|
+
incomingStakingToken: incomingStakingToken,
|
2010
|
+
pool: pool
|
2011
|
+
}),
|
2012
|
+
selector: protocol.stakeSelector
|
2013
|
+
});
|
2014
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2015
|
+
|
2016
|
+
case 3:
|
2017
|
+
case "end":
|
2018
|
+
return _context5.stop();
|
2019
|
+
}
|
2020
|
+
}
|
2021
|
+
}, _callee5);
|
2022
|
+
}));
|
2023
|
+
return _curveStake.apply(this, arguments);
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
function curveUnstake(_x6) {
|
2027
|
+
return _curveUnstake.apply(this, arguments);
|
2028
|
+
}
|
2029
|
+
|
2030
|
+
function _curveUnstake() {
|
2031
|
+
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref7) {
|
2032
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, amount, callArgs;
|
2033
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
2034
|
+
while (1) {
|
2035
|
+
switch (_context6.prev = _context6.next) {
|
2036
|
+
case 0:
|
2037
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingStakingToken = _ref7.outgoingStakingToken, amount = _ref7.amount;
|
2038
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2039
|
+
adapter: curveLiquidityAdapter,
|
2040
|
+
encodedCallArgs: protocol.curveUnstakeArgs({
|
2041
|
+
amount: amount,
|
2042
|
+
outgoingStakingToken: outgoingStakingToken,
|
2043
|
+
pool: pool
|
2044
|
+
}),
|
2045
|
+
selector: protocol.unstakeSelector
|
2046
|
+
});
|
2047
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2048
|
+
|
2049
|
+
case 3:
|
2050
|
+
case "end":
|
2051
|
+
return _context6.stop();
|
2052
|
+
}
|
2053
|
+
}
|
2054
|
+
}, _callee6);
|
2055
|
+
}));
|
2056
|
+
return _curveUnstake.apply(this, arguments);
|
2057
|
+
}
|
2058
|
+
|
2059
|
+
function curveUnstakeAndRedeem(_x7) {
|
2060
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2061
|
+
} // aave pool
|
2062
|
+
|
2063
|
+
function _curveUnstakeAndRedeem() {
|
2064
|
+
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(_ref8) {
|
2065
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, outgoingStakingTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
2066
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
2067
|
+
while (1) {
|
2068
|
+
switch (_context7.prev = _context7.next) {
|
2069
|
+
case 0:
|
2070
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingStakingToken = _ref8.outgoingStakingToken, outgoingStakingTokenAmount = _ref8.outgoingStakingTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
2071
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2072
|
+
adapter: curveLiquidityAdapter,
|
2073
|
+
encodedCallArgs: protocol.curveUnstakeAndRedeemArgs({
|
2074
|
+
incomingAssetData: incomingAssetData,
|
2075
|
+
outgoingStakingToken: outgoingStakingToken,
|
2076
|
+
outgoingStakingTokenAmount: outgoingStakingTokenAmount,
|
2077
|
+
pool: pool,
|
2078
|
+
redeemType: redeemType,
|
2079
|
+
useUnderlyings: useUnderlyings
|
2080
|
+
}),
|
2081
|
+
selector: protocol.unstakeAndRedeemSelector
|
2082
|
+
});
|
2083
|
+
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2084
|
+
|
2085
|
+
case 3:
|
2086
|
+
case "end":
|
2087
|
+
return _context7.stop();
|
2088
|
+
}
|
2089
|
+
}
|
2090
|
+
}, _callee7);
|
2091
|
+
}));
|
2092
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2093
|
+
}
|
2094
|
+
|
2095
|
+
function curveAaveClaimRewards(_ref9) {
|
1555
2096
|
var comptrollerProxy = _ref9.comptrollerProxy,
|
1556
2097
|
integrationManager = _ref9.integrationManager,
|
1557
2098
|
fundOwner = _ref9.fundOwner,
|
1558
|
-
|
2099
|
+
curveLiquidityAaveAdapter = _ref9.curveLiquidityAaveAdapter;
|
1559
2100
|
var callArgs = protocol.callOnIntegrationArgs({
|
1560
|
-
adapter:
|
1561
|
-
|
1562
|
-
|
2101
|
+
adapter: curveLiquidityAaveAdapter,
|
2102
|
+
encodedCallArgs: ethers.constants.HashZero,
|
2103
|
+
selector: protocol.claimRewardsSelector
|
1563
2104
|
});
|
1564
2105
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1565
2106
|
}
|
1566
|
-
function
|
2107
|
+
function curveAaveLend(_ref10) {
|
1567
2108
|
var comptrollerProxy = _ref10.comptrollerProxy,
|
1568
2109
|
integrationManager = _ref10.integrationManager,
|
1569
2110
|
fundOwner = _ref10.fundOwner,
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
2111
|
+
curveLiquidityAaveAdapter = _ref10.curveLiquidityAaveAdapter,
|
2112
|
+
_ref10$outgoingAaveDa = _ref10.outgoingAaveDaiAmount,
|
2113
|
+
outgoingAaveDaiAmount = _ref10$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveDa,
|
2114
|
+
_ref10$outgoingAaveUs = _ref10.outgoingAaveUsdcAmount,
|
2115
|
+
outgoingAaveUsdcAmount = _ref10$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs,
|
2116
|
+
_ref10$outgoingAaveUs2 = _ref10.outgoingAaveUsdtAmount,
|
2117
|
+
outgoingAaveUsdtAmount = _ref10$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs2,
|
2118
|
+
_ref10$minIncomingLPT = _ref10.minIncomingLPTokenAmount,
|
2119
|
+
minIncomingLPTokenAmount = _ref10$minIncomingLPT === void 0 ? ethers.BigNumber.from(1) : _ref10$minIncomingLPT,
|
2120
|
+
_ref10$useUnderlyings = _ref10.useUnderlyings,
|
2121
|
+
useUnderlyings = _ref10$useUnderlyings === void 0 ? false : _ref10$useUnderlyings;
|
1574
2122
|
var callArgs = protocol.callOnIntegrationArgs({
|
1575
|
-
adapter:
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
2123
|
+
adapter: curveLiquidityAaveAdapter,
|
2124
|
+
encodedCallArgs: protocol.curveAaveLendArgs({
|
2125
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
2126
|
+
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
2127
|
+
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
2128
|
+
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
2129
|
+
useUnderlyings: useUnderlyings
|
2130
|
+
}),
|
2131
|
+
selector: protocol.lendSelector
|
1582
2132
|
});
|
1583
2133
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1584
2134
|
}
|
1585
|
-
function
|
2135
|
+
function curveAaveLendAndStake(_ref11) {
|
1586
2136
|
var comptrollerProxy = _ref11.comptrollerProxy,
|
1587
2137
|
integrationManager = _ref11.integrationManager,
|
1588
2138
|
fundOwner = _ref11.fundOwner,
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
2139
|
+
curveLiquidityAaveAdapter = _ref11.curveLiquidityAaveAdapter,
|
2140
|
+
_ref11$outgoingAaveDa = _ref11.outgoingAaveDaiAmount,
|
2141
|
+
outgoingAaveDaiAmount = _ref11$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveDa,
|
2142
|
+
_ref11$outgoingAaveUs = _ref11.outgoingAaveUsdcAmount,
|
2143
|
+
outgoingAaveUsdcAmount = _ref11$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs,
|
2144
|
+
_ref11$outgoingAaveUs2 = _ref11.outgoingAaveUsdtAmount,
|
2145
|
+
outgoingAaveUsdtAmount = _ref11$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs2,
|
2146
|
+
_ref11$minIncomingLiq = _ref11.minIncomingLiquidityGaugeTokenAmount,
|
2147
|
+
minIncomingLiquidityGaugeTokenAmount = _ref11$minIncomingLiq === void 0 ? ethers.BigNumber.from(1) : _ref11$minIncomingLiq,
|
2148
|
+
_ref11$useUnderlyings = _ref11.useUnderlyings,
|
2149
|
+
useUnderlyings = _ref11$useUnderlyings === void 0 ? false : _ref11$useUnderlyings;
|
1593
2150
|
var callArgs = protocol.callOnIntegrationArgs({
|
1594
|
-
adapter:
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
2151
|
+
adapter: curveLiquidityAaveAdapter,
|
2152
|
+
encodedCallArgs: protocol.curveAaveLendAndStakeArgs({
|
2153
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
2154
|
+
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
2155
|
+
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
2156
|
+
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
2157
|
+
useUnderlyings: useUnderlyings
|
2158
|
+
}),
|
2159
|
+
selector: protocol.lendAndStakeSelector
|
1601
2160
|
});
|
1602
2161
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1603
2162
|
}
|
1604
|
-
function
|
2163
|
+
function curveAaveRedeem(_ref12) {
|
1605
2164
|
var comptrollerProxy = _ref12.comptrollerProxy,
|
1606
2165
|
integrationManager = _ref12.integrationManager,
|
1607
2166
|
fundOwner = _ref12.fundOwner,
|
1608
|
-
|
2167
|
+
curveLiquidityAaveAdapter = _ref12.curveLiquidityAaveAdapter,
|
1609
2168
|
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
2169
|
+
_ref12$minIncomingAav = _ref12.minIncomingAaveDaiAmount,
|
2170
|
+
minIncomingAaveDaiAmount = _ref12$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav,
|
2171
|
+
_ref12$minIncomingAav2 = _ref12.minIncomingAaveUsdcAmount,
|
2172
|
+
minIncomingAaveUsdcAmount = _ref12$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav2,
|
2173
|
+
_ref12$minIncomingAav3 = _ref12.minIncomingAaveUsdtAmount,
|
2174
|
+
minIncomingAaveUsdtAmount = _ref12$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav3,
|
2175
|
+
_ref12$receiveSingleA = _ref12.receiveSingleAsset,
|
2176
|
+
receiveSingleAsset = _ref12$receiveSingleA === void 0 ? false : _ref12$receiveSingleA,
|
2177
|
+
_ref12$useUnderlyings = _ref12.useUnderlyings,
|
2178
|
+
useUnderlyings = _ref12$useUnderlyings === void 0 ? false : _ref12$useUnderlyings;
|
1613
2179
|
var callArgs = protocol.callOnIntegrationArgs({
|
1614
|
-
adapter:
|
1615
|
-
|
1616
|
-
|
2180
|
+
adapter: curveLiquidityAaveAdapter,
|
2181
|
+
encodedCallArgs: protocol.curveAaveRedeemArgs({
|
2182
|
+
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
2183
|
+
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
2184
|
+
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1617
2185
|
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
2186
|
+
receiveSingleAsset: receiveSingleAsset,
|
2187
|
+
useUnderlyings: useUnderlyings
|
2188
|
+
}),
|
2189
|
+
selector: protocol.redeemSelector
|
1622
2190
|
});
|
1623
2191
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1624
2192
|
}
|
1625
|
-
function
|
2193
|
+
function curveAaveStake(_ref13) {
|
1626
2194
|
var comptrollerProxy = _ref13.comptrollerProxy,
|
1627
2195
|
integrationManager = _ref13.integrationManager,
|
1628
2196
|
fundOwner = _ref13.fundOwner,
|
1629
|
-
|
2197
|
+
curveLiquidityAaveAdapter = _ref13.curveLiquidityAaveAdapter,
|
1630
2198
|
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
1631
2199
|
var callArgs = protocol.callOnIntegrationArgs({
|
1632
|
-
adapter:
|
1633
|
-
|
1634
|
-
encodedCallArgs: protocol.curveEursStakeArgs({
|
2200
|
+
adapter: curveLiquidityAaveAdapter,
|
2201
|
+
encodedCallArgs: protocol.curveAaveStakeArgs({
|
1635
2202
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1636
|
-
})
|
2203
|
+
}),
|
2204
|
+
selector: protocol.stakeSelector
|
1637
2205
|
});
|
1638
2206
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1639
2207
|
}
|
1640
|
-
function
|
2208
|
+
function curveAaveUnstakeAndRedeem(_ref14) {
|
1641
2209
|
var comptrollerProxy = _ref14.comptrollerProxy,
|
1642
2210
|
integrationManager = _ref14.integrationManager,
|
1643
2211
|
fundOwner = _ref14.fundOwner,
|
1644
|
-
|
2212
|
+
curveLiquidityAaveAdapter = _ref14.curveLiquidityAaveAdapter,
|
1645
2213
|
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
2214
|
+
_ref14$minIncomingAav = _ref14.minIncomingAaveDaiAmount,
|
2215
|
+
minIncomingAaveDaiAmount = _ref14$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav,
|
2216
|
+
_ref14$minIncomingAav2 = _ref14.minIncomingAaveUsdcAmount,
|
2217
|
+
minIncomingAaveUsdcAmount = _ref14$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav2,
|
2218
|
+
_ref14$minIncomingAav3 = _ref14.minIncomingAaveUsdtAmount,
|
2219
|
+
minIncomingAaveUsdtAmount = _ref14$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav3,
|
2220
|
+
_ref14$receiveSingleA = _ref14.receiveSingleAsset,
|
2221
|
+
receiveSingleAsset = _ref14$receiveSingleA === void 0 ? false : _ref14$receiveSingleA,
|
2222
|
+
_ref14$useUnderlyings = _ref14.useUnderlyings,
|
2223
|
+
useUnderlyings = _ref14$useUnderlyings === void 0 ? false : _ref14$useUnderlyings;
|
1649
2224
|
var callArgs = protocol.callOnIntegrationArgs({
|
1650
|
-
adapter:
|
1651
|
-
|
1652
|
-
|
2225
|
+
adapter: curveLiquidityAaveAdapter,
|
2226
|
+
encodedCallArgs: protocol.curveAaveUnstakeAndRedeemArgs({
|
2227
|
+
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
2228
|
+
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
2229
|
+
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
1653
2230
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
2231
|
+
receiveSingleAsset: receiveSingleAsset,
|
2232
|
+
useUnderlyings: useUnderlyings
|
2233
|
+
}),
|
2234
|
+
selector: protocol.unstakeAndRedeemSelector
|
1658
2235
|
});
|
1659
2236
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1660
2237
|
}
|
1661
|
-
function
|
2238
|
+
function curveAaveUnstake(_ref15) {
|
1662
2239
|
var comptrollerProxy = _ref15.comptrollerProxy,
|
1663
2240
|
integrationManager = _ref15.integrationManager,
|
1664
2241
|
fundOwner = _ref15.fundOwner,
|
1665
|
-
|
2242
|
+
curveLiquidityAaveAdapter = _ref15.curveLiquidityAaveAdapter,
|
1666
2243
|
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
1667
2244
|
var callArgs = protocol.callOnIntegrationArgs({
|
1668
|
-
adapter:
|
1669
|
-
|
1670
|
-
encodedCallArgs: protocol.curveEursUnstakeArgs({
|
2245
|
+
adapter: curveLiquidityAaveAdapter,
|
2246
|
+
encodedCallArgs: protocol.curveAaveUnstakeArgs({
|
1671
2247
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1672
|
-
})
|
2248
|
+
}),
|
2249
|
+
selector: protocol.unstakeSelector
|
1673
2250
|
});
|
1674
2251
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1675
2252
|
} // sETH pool
|
@@ -1681,8 +2258,8 @@ function curveSethClaimRewards(_ref16) {
|
|
1681
2258
|
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
1682
2259
|
var callArgs = protocol.callOnIntegrationArgs({
|
1683
2260
|
adapter: curveLiquiditySethAdapter,
|
1684
|
-
|
1685
|
-
|
2261
|
+
encodedCallArgs: ethers.constants.HashZero,
|
2262
|
+
selector: protocol.claimRewardsSelector
|
1686
2263
|
});
|
1687
2264
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1688
2265
|
}
|
@@ -1696,12 +2273,12 @@ function curveSethLend(_ref17) {
|
|
1696
2273
|
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
1697
2274
|
var callArgs = protocol.callOnIntegrationArgs({
|
1698
2275
|
adapter: curveLiquiditySethAdapter,
|
1699
|
-
selector: protocol.lendSelector,
|
1700
2276
|
encodedCallArgs: protocol.curveSethLendArgs({
|
1701
|
-
|
2277
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1702
2278
|
outgoingSethAmount: outgoingSethAmount,
|
1703
|
-
|
1704
|
-
})
|
2279
|
+
outgoingWethAmount: outgoingWethAmount
|
2280
|
+
}),
|
2281
|
+
selector: protocol.lendSelector
|
1705
2282
|
});
|
1706
2283
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1707
2284
|
}
|
@@ -1715,12 +2292,12 @@ function curveSethLendAndStake(_ref18) {
|
|
1715
2292
|
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
1716
2293
|
var callArgs = protocol.callOnIntegrationArgs({
|
1717
2294
|
adapter: curveLiquiditySethAdapter,
|
1718
|
-
selector: protocol.lendAndStakeSelector,
|
1719
2295
|
encodedCallArgs: protocol.curveSethLendAndStakeArgs({
|
1720
|
-
|
2296
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1721
2297
|
outgoingSethAmount: outgoingSethAmount,
|
1722
|
-
|
1723
|
-
})
|
2298
|
+
outgoingWethAmount: outgoingWethAmount
|
2299
|
+
}),
|
2300
|
+
selector: protocol.lendAndStakeSelector
|
1724
2301
|
});
|
1725
2302
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1726
2303
|
}
|
@@ -1735,13 +2312,13 @@ function curveSethRedeem(_ref19) {
|
|
1735
2312
|
receiveSingleAsset = _ref19.receiveSingleAsset;
|
1736
2313
|
var callArgs = protocol.callOnIntegrationArgs({
|
1737
2314
|
adapter: curveLiquiditySethAdapter,
|
1738
|
-
|
1739
|
-
encodedCallArgs: protocol.curveSethRedeemArgs({
|
1740
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1741
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2315
|
+
encodedCallArgs: protocol.curveSethRedeemArgs({
|
1742
2316
|
minIncomingSethAmount: minIncomingSethAmount,
|
2317
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2318
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1743
2319
|
receiveSingleAsset: receiveSingleAsset
|
1744
|
-
})
|
2320
|
+
}),
|
2321
|
+
selector: protocol.redeemSelector
|
1745
2322
|
});
|
1746
2323
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1747
2324
|
}
|
@@ -1753,10 +2330,10 @@ function curveSethStake(_ref20) {
|
|
1753
2330
|
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
1754
2331
|
var callArgs = protocol.callOnIntegrationArgs({
|
1755
2332
|
adapter: curveLiquiditySethAdapter,
|
1756
|
-
selector: protocol.stakeSelector,
|
1757
2333
|
encodedCallArgs: protocol.curveSethStakeArgs({
|
1758
2334
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1759
|
-
})
|
2335
|
+
}),
|
2336
|
+
selector: protocol.stakeSelector
|
1760
2337
|
});
|
1761
2338
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1762
2339
|
}
|
@@ -1771,13 +2348,13 @@ function curveSethUnstakeAndRedeem(_ref21) {
|
|
1771
2348
|
receiveSingleAsset = _ref21.receiveSingleAsset;
|
1772
2349
|
var callArgs = protocol.callOnIntegrationArgs({
|
1773
2350
|
adapter: curveLiquiditySethAdapter,
|
1774
|
-
selector: protocol.unstakeAndRedeemSelector,
|
1775
2351
|
encodedCallArgs: protocol.curveSethUnstakeAndRedeemArgs({
|
1776
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1777
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1778
2352
|
minIncomingSethAmount: minIncomingSethAmount,
|
2353
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2354
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1779
2355
|
receiveSingleAsset: receiveSingleAsset
|
1780
|
-
})
|
2356
|
+
}),
|
2357
|
+
selector: protocol.unstakeAndRedeemSelector
|
1781
2358
|
});
|
1782
2359
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1783
2360
|
}
|
@@ -1789,10 +2366,10 @@ function curveSethUnstake(_ref22) {
|
|
1789
2366
|
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
1790
2367
|
var callArgs = protocol.callOnIntegrationArgs({
|
1791
2368
|
adapter: curveLiquiditySethAdapter,
|
1792
|
-
selector: protocol.unstakeSelector,
|
1793
2369
|
encodedCallArgs: protocol.curveSethUnstakeArgs({
|
1794
2370
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1795
|
-
})
|
2371
|
+
}),
|
2372
|
+
selector: protocol.unstakeSelector
|
1796
2373
|
});
|
1797
2374
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1798
2375
|
} // stETH pool
|
@@ -1804,8 +2381,8 @@ function curveStethClaimRewards(_ref23) {
|
|
1804
2381
|
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
1805
2382
|
var callArgs = protocol.callOnIntegrationArgs({
|
1806
2383
|
adapter: curveLiquidityStethAdapter,
|
1807
|
-
|
1808
|
-
|
2384
|
+
encodedCallArgs: ethers.constants.HashZero,
|
2385
|
+
selector: protocol.claimRewardsSelector
|
1809
2386
|
});
|
1810
2387
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1811
2388
|
}
|
@@ -1819,12 +2396,12 @@ function curveStethLend(_ref24) {
|
|
1819
2396
|
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
1820
2397
|
var callArgs = protocol.callOnIntegrationArgs({
|
1821
2398
|
adapter: curveLiquidityStethAdapter,
|
1822
|
-
selector: protocol.lendSelector,
|
1823
2399
|
encodedCallArgs: protocol.curveStethLendArgs({
|
1824
|
-
|
2400
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
1825
2401
|
outgoingStethAmount: outgoingStethAmount,
|
1826
|
-
|
1827
|
-
})
|
2402
|
+
outgoingWethAmount: outgoingWethAmount
|
2403
|
+
}),
|
2404
|
+
selector: protocol.lendSelector
|
1828
2405
|
});
|
1829
2406
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1830
2407
|
}
|
@@ -1838,12 +2415,12 @@ function curveStethLendAndStake(_ref25) {
|
|
1838
2415
|
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
1839
2416
|
var callArgs = protocol.callOnIntegrationArgs({
|
1840
2417
|
adapter: curveLiquidityStethAdapter,
|
1841
|
-
selector: protocol.lendAndStakeSelector,
|
1842
2418
|
encodedCallArgs: protocol.curveStethLendAndStakeArgs({
|
1843
|
-
|
2419
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
1844
2420
|
outgoingStethAmount: outgoingStethAmount,
|
1845
|
-
|
1846
|
-
})
|
2421
|
+
outgoingWethAmount: outgoingWethAmount
|
2422
|
+
}),
|
2423
|
+
selector: protocol.lendAndStakeSelector
|
1847
2424
|
});
|
1848
2425
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1849
2426
|
}
|
@@ -1858,13 +2435,13 @@ function curveStethRedeem(_ref26) {
|
|
1858
2435
|
receiveSingleAsset = _ref26.receiveSingleAsset;
|
1859
2436
|
var callArgs = protocol.callOnIntegrationArgs({
|
1860
2437
|
adapter: curveLiquidityStethAdapter,
|
1861
|
-
selector: protocol.redeemSelector,
|
1862
2438
|
encodedCallArgs: protocol.curveStethRedeemArgs({
|
1863
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1864
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1865
2439
|
minIncomingStethAmount: minIncomingStethAmount,
|
2440
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2441
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
1866
2442
|
receiveSingleAsset: receiveSingleAsset
|
1867
|
-
})
|
2443
|
+
}),
|
2444
|
+
selector: protocol.redeemSelector
|
1868
2445
|
});
|
1869
2446
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1870
2447
|
}
|
@@ -1876,10 +2453,10 @@ function curveStethStake(_ref27) {
|
|
1876
2453
|
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
1877
2454
|
var callArgs = protocol.callOnIntegrationArgs({
|
1878
2455
|
adapter: curveLiquidityStethAdapter,
|
1879
|
-
selector: protocol.stakeSelector,
|
1880
2456
|
encodedCallArgs: protocol.curveStethStakeArgs({
|
1881
2457
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
1882
|
-
})
|
2458
|
+
}),
|
2459
|
+
selector: protocol.stakeSelector
|
1883
2460
|
});
|
1884
2461
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1885
2462
|
}
|
@@ -1894,13 +2471,13 @@ function curveStethUnstakeAndRedeem(_ref28) {
|
|
1894
2471
|
receiveSingleAsset = _ref28.receiveSingleAsset;
|
1895
2472
|
var callArgs = protocol.callOnIntegrationArgs({
|
1896
2473
|
adapter: curveLiquidityStethAdapter,
|
1897
|
-
selector: protocol.unstakeAndRedeemSelector,
|
1898
2474
|
encodedCallArgs: protocol.curveStethUnstakeAndRedeemArgs({
|
1899
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1900
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
1901
2475
|
minIncomingStethAmount: minIncomingStethAmount,
|
2476
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
2477
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
1902
2478
|
receiveSingleAsset: receiveSingleAsset
|
1903
|
-
})
|
2479
|
+
}),
|
2480
|
+
selector: protocol.unstakeAndRedeemSelector
|
1904
2481
|
});
|
1905
2482
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1906
2483
|
}
|
@@ -1912,10 +2489,10 @@ function curveStethUnstake(_ref29) {
|
|
1912
2489
|
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
1913
2490
|
var callArgs = protocol.callOnIntegrationArgs({
|
1914
2491
|
adapter: curveLiquidityStethAdapter,
|
1915
|
-
selector: protocol.unstakeSelector,
|
1916
2492
|
encodedCallArgs: protocol.curveStethUnstakeArgs({
|
1917
2493
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
1918
|
-
})
|
2494
|
+
}),
|
2495
|
+
selector: protocol.unstakeSelector
|
1919
2496
|
});
|
1920
2497
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1921
2498
|
}
|
@@ -1934,10 +2511,10 @@ function _idleClaimRewards() {
|
|
1934
2511
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
1935
2512
|
callArgs = protocol.callOnIntegrationArgs({
|
1936
2513
|
adapter: idleAdapter,
|
1937
|
-
selector: protocol.claimRewardsSelector,
|
1938
2514
|
encodedCallArgs: protocol.idleClaimRewardsArgs({
|
1939
2515
|
idleToken: idleToken
|
1940
|
-
})
|
2516
|
+
}),
|
2517
|
+
selector: protocol.claimRewardsSelector
|
1941
2518
|
});
|
1942
2519
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1943
2520
|
|
@@ -1966,12 +2543,12 @@ function _idleLend() {
|
|
1966
2543
|
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;
|
1967
2544
|
callArgs = protocol.callOnIntegrationArgs({
|
1968
2545
|
adapter: idleAdapter,
|
1969
|
-
selector: protocol.lendSelector,
|
1970
2546
|
encodedCallArgs: protocol.idleLendArgs({
|
1971
2547
|
idleToken: idleToken,
|
1972
|
-
|
1973
|
-
|
1974
|
-
})
|
2548
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
2549
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
2550
|
+
}),
|
2551
|
+
selector: protocol.lendSelector
|
1975
2552
|
});
|
1976
2553
|
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1977
2554
|
|
@@ -2000,12 +2577,12 @@ function _idleRedeem() {
|
|
2000
2577
|
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;
|
2001
2578
|
callArgs = protocol.callOnIntegrationArgs({
|
2002
2579
|
adapter: idleAdapter,
|
2003
|
-
selector: protocol.redeemSelector,
|
2004
2580
|
encodedCallArgs: protocol.idleRedeemArgs({
|
2005
2581
|
idleToken: idleToken,
|
2006
|
-
|
2007
|
-
|
2008
|
-
})
|
2582
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2583
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
2584
|
+
}),
|
2585
|
+
selector: protocol.redeemSelector
|
2009
2586
|
});
|
2010
2587
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2011
2588
|
|
@@ -2076,17 +2653,17 @@ function _mockGenericSwap() {
|
|
2076
2653
|
|
2077
2654
|
case 9:
|
2078
2655
|
swapArgs = mockGenericSwapArgs({
|
2079
|
-
|
2080
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2656
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
2081
2657
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
2082
2658
|
incomingAssets: incomingAssets,
|
2659
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2083
2660
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
2084
|
-
|
2661
|
+
spendAssets: spendAssets
|
2085
2662
|
});
|
2086
2663
|
callArgs = protocol.callOnIntegrationArgs({
|
2087
2664
|
adapter: mockGenericAdapter,
|
2088
|
-
|
2089
|
-
|
2665
|
+
encodedCallArgs: swapArgs,
|
2666
|
+
selector: selector
|
2090
2667
|
});
|
2091
2668
|
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2092
2669
|
_context.next = 14;
|
@@ -2105,14 +2682,80 @@ function _mockGenericSwap() {
|
|
2105
2682
|
return _mockGenericSwap.apply(this, arguments);
|
2106
2683
|
}
|
2107
2684
|
|
2685
|
+
function olympusV2Stake(_x) {
|
2686
|
+
return _olympusV2Stake.apply(this, arguments);
|
2687
|
+
}
|
2688
|
+
|
2689
|
+
function _olympusV2Stake() {
|
2690
|
+
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2691
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
2692
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2693
|
+
while (1) {
|
2694
|
+
switch (_context.prev = _context.next) {
|
2695
|
+
case 0:
|
2696
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
2697
|
+
stakeArgs = protocol.olympusV2StakeArgs({
|
2698
|
+
amount: amount
|
2699
|
+
});
|
2700
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2701
|
+
adapter: olympusV2Adapter,
|
2702
|
+
encodedCallArgs: stakeArgs,
|
2703
|
+
selector: protocol.stakeSelector
|
2704
|
+
});
|
2705
|
+
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2706
|
+
return _context.abrupt("return", stakeTx);
|
2707
|
+
|
2708
|
+
case 5:
|
2709
|
+
case "end":
|
2710
|
+
return _context.stop();
|
2711
|
+
}
|
2712
|
+
}
|
2713
|
+
}, _callee);
|
2714
|
+
}));
|
2715
|
+
return _olympusV2Stake.apply(this, arguments);
|
2716
|
+
}
|
2717
|
+
|
2718
|
+
function olympusV2Unstake(_x2) {
|
2719
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2720
|
+
}
|
2721
|
+
|
2722
|
+
function _olympusV2Unstake() {
|
2723
|
+
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2724
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
2725
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2726
|
+
while (1) {
|
2727
|
+
switch (_context2.prev = _context2.next) {
|
2728
|
+
case 0:
|
2729
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
2730
|
+
unstakeArgs = protocol.olympusV2UnstakeArgs({
|
2731
|
+
amount: amount
|
2732
|
+
});
|
2733
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2734
|
+
adapter: olympusV2Adapter,
|
2735
|
+
encodedCallArgs: unstakeArgs,
|
2736
|
+
selector: protocol.unstakeSelector
|
2737
|
+
});
|
2738
|
+
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2739
|
+
return _context2.abrupt("return", unstakeTx);
|
2740
|
+
|
2741
|
+
case 5:
|
2742
|
+
case "end":
|
2743
|
+
return _context2.stop();
|
2744
|
+
}
|
2745
|
+
}
|
2746
|
+
}, _callee2);
|
2747
|
+
}));
|
2748
|
+
return _olympusV2Unstake.apply(this, arguments);
|
2749
|
+
}
|
2750
|
+
|
2108
2751
|
function paraSwapV4GenerateDummyPaths(_ref) {
|
2109
2752
|
var toTokens = _ref.toTokens;
|
2110
2753
|
return toTokens.map(function (toToken) {
|
2111
2754
|
return {
|
2112
|
-
to: toToken,
|
2113
|
-
totalNetworkFee: 0,
|
2114
2755
|
// Not supported in our protocol
|
2115
|
-
routes: []
|
2756
|
+
routes: [],
|
2757
|
+
to: toToken,
|
2758
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2116
2759
|
|
2117
2760
|
};
|
2118
2761
|
});
|
@@ -2131,16 +2774,16 @@ function _paraSwapV4TakeOrder() {
|
|
2131
2774
|
case 0:
|
2132
2775
|
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;
|
2133
2776
|
takeOrderArgs = protocol.paraSwapV4TakeOrderArgs({
|
2134
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2135
2777
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2778
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2136
2779
|
outgoingAsset: outgoingAsset,
|
2137
2780
|
outgoingAssetAmount: outgoingAssetAmount,
|
2138
2781
|
paths: paths
|
2139
2782
|
});
|
2140
2783
|
callArgs = protocol.callOnIntegrationArgs({
|
2141
2784
|
adapter: paraSwapV4Adapter,
|
2142
|
-
|
2143
|
-
|
2785
|
+
encodedCallArgs: takeOrderArgs,
|
2786
|
+
selector: protocol.takeOrderSelector
|
2144
2787
|
});
|
2145
2788
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2146
2789
|
|
@@ -2154,30 +2797,177 @@ function _paraSwapV4TakeOrder() {
|
|
2154
2797
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
2155
2798
|
}
|
2156
2799
|
|
2800
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
2801
|
+
var toTokens = _ref.toTokens;
|
2802
|
+
return toTokens.map(function (toToken) {
|
2803
|
+
return {
|
2804
|
+
// Not supported in our protocol
|
2805
|
+
adapters: [],
|
2806
|
+
to: toToken,
|
2807
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2808
|
+
|
2809
|
+
};
|
2810
|
+
});
|
2811
|
+
}
|
2812
|
+
function paraSwapV5TakeOrder(_x) {
|
2813
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2814
|
+
}
|
2815
|
+
|
2816
|
+
function _paraSwapV5TakeOrder() {
|
2817
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
2818
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
2819
|
+
|
2820
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2821
|
+
while (1) {
|
2822
|
+
switch (_context.prev = _context.next) {
|
2823
|
+
case 0:
|
2824
|
+
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;
|
2825
|
+
takeOrderArgs = protocol.paraSwapV5TakeOrderArgs({
|
2826
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2827
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2828
|
+
outgoingAsset: outgoingAsset,
|
2829
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
2830
|
+
paths: paths,
|
2831
|
+
uuid: uuid
|
2832
|
+
});
|
2833
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2834
|
+
adapter: paraSwapV5Adapter,
|
2835
|
+
encodedCallArgs: takeOrderArgs,
|
2836
|
+
selector: protocol.takeOrderSelector
|
2837
|
+
});
|
2838
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2839
|
+
|
2840
|
+
case 4:
|
2841
|
+
case "end":
|
2842
|
+
return _context.stop();
|
2843
|
+
}
|
2844
|
+
}
|
2845
|
+
}, _callee);
|
2846
|
+
}));
|
2847
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2848
|
+
}
|
2849
|
+
|
2850
|
+
function poolTogetherV4Lend(_x) {
|
2851
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2852
|
+
}
|
2853
|
+
|
2854
|
+
function _poolTogetherV4Lend() {
|
2855
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2856
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
2857
|
+
|
2858
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2859
|
+
while (1) {
|
2860
|
+
switch (_context.prev = _context.next) {
|
2861
|
+
case 0:
|
2862
|
+
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;
|
2863
|
+
lendArgs = protocol.poolTogetherV4LendArgs({
|
2864
|
+
amount: amount,
|
2865
|
+
ptToken: ptToken
|
2866
|
+
});
|
2867
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2868
|
+
adapter: poolTogetherV4Adapter,
|
2869
|
+
encodedCallArgs: lendArgs,
|
2870
|
+
selector: protocol.lendSelector
|
2871
|
+
});
|
2872
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2873
|
+
return _context.abrupt("return", lendTx);
|
2874
|
+
|
2875
|
+
case 5:
|
2876
|
+
case "end":
|
2877
|
+
return _context.stop();
|
2878
|
+
}
|
2879
|
+
}
|
2880
|
+
}, _callee);
|
2881
|
+
}));
|
2882
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
2883
|
+
}
|
2884
|
+
|
2885
|
+
function poolTogetherV4Redeem(_x2) {
|
2886
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2887
|
+
}
|
2888
|
+
|
2889
|
+
function _poolTogetherV4Redeem() {
|
2890
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2891
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
2892
|
+
|
2893
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2894
|
+
while (1) {
|
2895
|
+
switch (_context2.prev = _context2.next) {
|
2896
|
+
case 0:
|
2897
|
+
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;
|
2898
|
+
redeemArgs = protocol.poolTogetherV4RedeemArgs({
|
2899
|
+
amount: amount,
|
2900
|
+
ptToken: ptToken
|
2901
|
+
});
|
2902
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2903
|
+
adapter: poolTogetherV4Adapter,
|
2904
|
+
encodedCallArgs: redeemArgs,
|
2905
|
+
selector: protocol.redeemSelector
|
2906
|
+
});
|
2907
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2908
|
+
return _context2.abrupt("return", redeemTx);
|
2909
|
+
|
2910
|
+
case 5:
|
2911
|
+
case "end":
|
2912
|
+
return _context2.stop();
|
2913
|
+
}
|
2914
|
+
}
|
2915
|
+
}, _callee2);
|
2916
|
+
}));
|
2917
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
2918
|
+
}
|
2919
|
+
|
2920
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
2921
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2922
|
+
}
|
2923
|
+
|
2924
|
+
function _poolTogetherV4ClaimRewards() {
|
2925
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2926
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
2927
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2928
|
+
while (1) {
|
2929
|
+
switch (_context3.prev = _context3.next) {
|
2930
|
+
case 0:
|
2931
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
2932
|
+
claimRewardsArgs = protocol.poolTogetherV4ClaimRewardsArgs({
|
2933
|
+
drawIds: drawIds,
|
2934
|
+
prizeDistributor: prizeDistributor,
|
2935
|
+
winningPicks: winningPicks
|
2936
|
+
});
|
2937
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2938
|
+
adapter: poolTogetherV4Adapter,
|
2939
|
+
encodedCallArgs: claimRewardsArgs,
|
2940
|
+
selector: protocol.claimRewardsSelector
|
2941
|
+
});
|
2942
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2943
|
+
return _context3.abrupt("return", claimTx);
|
2944
|
+
|
2945
|
+
case 5:
|
2946
|
+
case "end":
|
2947
|
+
return _context3.stop();
|
2948
|
+
}
|
2949
|
+
}
|
2950
|
+
}, _callee3);
|
2951
|
+
}));
|
2952
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2953
|
+
}
|
2954
|
+
|
2157
2955
|
function synthetixAssignExchangeDelegate(_x) {
|
2158
2956
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
2159
2957
|
}
|
2160
2958
|
|
2161
2959
|
function _synthetixAssignExchangeDelegate() {
|
2162
2960
|
_synthetixAssignExchangeDelegate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2163
|
-
var comptrollerProxy,
|
2961
|
+
var comptrollerProxy, synthetixDelegateApprovals, fundOwner, delegate;
|
2164
2962
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2165
2963
|
while (1) {
|
2166
2964
|
switch (_context.prev = _context.next) {
|
2167
2965
|
case 0:
|
2168
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
2966
|
+
comptrollerProxy = _ref.comptrollerProxy, synthetixDelegateApprovals = _ref.synthetixDelegateApprovals, fundOwner = _ref.fundOwner, delegate = _ref.delegate;
|
2169
2967
|
_context.next = 3;
|
2170
|
-
return
|
2171
|
-
addressResolver: addressResolver,
|
2172
|
-
name: 'DelegateApprovals'
|
2173
|
-
});
|
2968
|
+
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(synthetixDelegateApprovals, protocol.synthetixAssignExchangeDelegateSelector, protocol.encodeArgs(['address'], [delegate]));
|
2174
2969
|
|
2175
2970
|
case 3:
|
2176
|
-
delegateApprovals = _context.sent;
|
2177
|
-
_context.next = 6;
|
2178
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(delegateApprovals, protocol.synthetixAssignExchangeDelegateSelector, protocol.encodeArgs(['address'], [delegate]));
|
2179
|
-
|
2180
|
-
case 6:
|
2181
2971
|
case "end":
|
2182
2972
|
return _context.stop();
|
2183
2973
|
}
|
@@ -2187,28 +2977,36 @@ function _synthetixAssignExchangeDelegate() {
|
|
2187
2977
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
2188
2978
|
}
|
2189
2979
|
|
2190
|
-
function
|
2191
|
-
return
|
2980
|
+
function synthetixRedeem(_x2) {
|
2981
|
+
return _synthetixRedeem.apply(this, arguments);
|
2192
2982
|
}
|
2193
2983
|
|
2194
|
-
function
|
2195
|
-
|
2196
|
-
var
|
2984
|
+
function _synthetixRedeem() {
|
2985
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2986
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
2197
2987
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2198
2988
|
while (1) {
|
2199
2989
|
switch (_context2.prev = _context2.next) {
|
2200
2990
|
case 0:
|
2201
|
-
|
2202
|
-
|
2991
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, synthetixAdapter = _ref2.synthetixAdapter, synths = _ref2.synths;
|
2992
|
+
redeemArgs = protocol.synthetixRedeemArgs({
|
2993
|
+
synths: synths
|
2994
|
+
});
|
2995
|
+
callArgs = protocol.callOnIntegrationArgs({
|
2996
|
+
adapter: synthetixAdapter,
|
2997
|
+
encodedCallArgs: redeemArgs,
|
2998
|
+
selector: protocol.redeemSelector
|
2999
|
+
});
|
3000
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2203
3001
|
|
2204
|
-
case
|
3002
|
+
case 4:
|
2205
3003
|
case "end":
|
2206
3004
|
return _context2.stop();
|
2207
3005
|
}
|
2208
3006
|
}
|
2209
3007
|
}, _callee2);
|
2210
3008
|
}));
|
2211
|
-
return
|
3009
|
+
return _synthetixRedeem.apply(this, arguments);
|
2212
3010
|
}
|
2213
3011
|
|
2214
3012
|
function synthetixTakeOrder(_x3) {
|
@@ -2217,13 +3015,13 @@ function synthetixTakeOrder(_x3) {
|
|
2217
3015
|
|
2218
3016
|
function _synthetixTakeOrder() {
|
2219
3017
|
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2220
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount,
|
3018
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount, _ref3$minIncomingSusd, minIncomingSusdAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
2221
3019
|
|
2222
3020
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2223
3021
|
while (1) {
|
2224
3022
|
switch (_context3.prev = _context3.next) {
|
2225
3023
|
case 0:
|
2226
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? ethers.utils.parseEther('1') : _ref3$outgoingAssetAm,
|
3024
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? ethers.utils.parseEther('1') : _ref3$outgoingAssetAm, _ref3$minIncomingSusd = _ref3.minIncomingSusdAmount, minIncomingSusdAmount = _ref3$minIncomingSusd === void 0 ? ethers.utils.parseEther('1') : _ref3$minIncomingSusd, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
2227
3025
|
|
2228
3026
|
if (!seedFund) {
|
2229
3027
|
_context3.next = 4;
|
@@ -2235,16 +3033,15 @@ function _synthetixTakeOrder() {
|
|
2235
3033
|
|
2236
3034
|
case 4:
|
2237
3035
|
takeOrderArgs = protocol.synthetixTakeOrderArgs({
|
2238
|
-
|
2239
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
3036
|
+
minIncomingSusdAmount: minIncomingSusdAmount,
|
2240
3037
|
outgoingAsset: outgoingAsset,
|
2241
3038
|
outgoingAssetAmount: outgoingAssetAmount
|
2242
3039
|
});
|
2243
3040
|
_context3.next = 7;
|
2244
3041
|
return protocol.callOnIntegrationArgs({
|
2245
3042
|
adapter: synthetixAdapter,
|
2246
|
-
|
2247
|
-
|
3043
|
+
encodedCallArgs: takeOrderArgs,
|
3044
|
+
selector: protocol.takeOrderSelector
|
2248
3045
|
});
|
2249
3046
|
|
2250
3047
|
case 7:
|
@@ -2291,18 +3088,18 @@ function _uniswapV2Lend() {
|
|
2291
3088
|
|
2292
3089
|
case 6:
|
2293
3090
|
lendArgs = protocol.uniswapV2LendArgs({
|
2294
|
-
tokenA: tokenA,
|
2295
|
-
tokenB: tokenB,
|
2296
3091
|
amountADesired: amountADesired,
|
2297
|
-
amountBDesired: amountBDesired,
|
2298
3092
|
amountAMin: amountAMin,
|
3093
|
+
amountBDesired: amountBDesired,
|
2299
3094
|
amountBMin: amountBMin,
|
2300
|
-
minPoolTokenAmount: minPoolTokenAmount
|
3095
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
3096
|
+
tokenA: tokenA,
|
3097
|
+
tokenB: tokenB
|
2301
3098
|
});
|
2302
3099
|
callArgs = protocol.callOnIntegrationArgs({
|
2303
3100
|
adapter: uniswapV2LiquidityAdapter,
|
2304
|
-
|
2305
|
-
|
3101
|
+
encodedCallArgs: lendArgs,
|
3102
|
+
selector: protocol.lendSelector
|
2306
3103
|
});
|
2307
3104
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2308
3105
|
_context.next = 11;
|
@@ -2334,16 +3131,16 @@ function _uniswapV2Redeem() {
|
|
2334
3131
|
case 0:
|
2335
3132
|
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;
|
2336
3133
|
redeemArgs = protocol.uniswapV2RedeemArgs({
|
3134
|
+
amountAMin: amountAMin,
|
3135
|
+
amountBMin: amountBMin,
|
2337
3136
|
poolTokenAmount: poolTokenAmount,
|
2338
3137
|
tokenA: tokenA,
|
2339
|
-
tokenB: tokenB
|
2340
|
-
amountAMin: amountAMin,
|
2341
|
-
amountBMin: amountBMin
|
3138
|
+
tokenB: tokenB
|
2342
3139
|
});
|
2343
3140
|
callArgs = protocol.callOnIntegrationArgs({
|
2344
3141
|
adapter: uniswapV2LiquidityAdapter,
|
2345
|
-
|
2346
|
-
|
3142
|
+
encodedCallArgs: redeemArgs,
|
3143
|
+
selector: protocol.redeemSelector
|
2347
3144
|
});
|
2348
3145
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2349
3146
|
_context2.next = 6;
|
@@ -2386,14 +3183,14 @@ function _uniswapV2TakeOrder() {
|
|
2386
3183
|
|
2387
3184
|
case 4:
|
2388
3185
|
takeOrderArgs = protocol.uniswapV2TakeOrderArgs({
|
2389
|
-
|
3186
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2390
3187
|
outgoingAssetAmount: outgoingAssetAmount,
|
2391
|
-
|
3188
|
+
path: path
|
2392
3189
|
});
|
2393
3190
|
callArgs = protocol.callOnIntegrationArgs({
|
2394
3191
|
adapter: uniswapV2ExchangeAdapter,
|
2395
|
-
|
2396
|
-
|
3192
|
+
encodedCallArgs: takeOrderArgs,
|
3193
|
+
selector: protocol.takeOrderSelector
|
2397
3194
|
});
|
2398
3195
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2399
3196
|
|
@@ -2413,7 +3210,7 @@ function uniswapV3TakeOrder(_x) {
|
|
2413
3210
|
|
2414
3211
|
function _uniswapV3TakeOrder() {
|
2415
3212
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2416
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
3213
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
2417
3214
|
|
2418
3215
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2419
3216
|
while (1) {
|
@@ -2422,35 +3219,33 @@ function _uniswapV3TakeOrder() {
|
|
2422
3219
|
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;
|
2423
3220
|
|
2424
3221
|
if (!seedFund) {
|
2425
|
-
_context.next =
|
3222
|
+
_context.next = 7;
|
2426
3223
|
break;
|
2427
3224
|
}
|
2428
3225
|
|
2429
|
-
_context.
|
2430
|
-
_context.next = 5;
|
3226
|
+
_context.next = 4;
|
2431
3227
|
return comptrollerProxy.getVaultProxy();
|
2432
3228
|
|
2433
|
-
case
|
2434
|
-
|
2435
|
-
_context.
|
2436
|
-
|
2437
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
3229
|
+
case 4:
|
3230
|
+
vaultProxy = _context.sent;
|
3231
|
+
_context.next = 7;
|
3232
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
2438
3233
|
|
2439
|
-
case
|
3234
|
+
case 7:
|
2440
3235
|
takeOrderArgs = protocol.uniswapV3TakeOrderArgs({
|
2441
|
-
|
2442
|
-
pathFees: pathFees,
|
3236
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
2443
3237
|
outgoingAssetAmount: outgoingAssetAmount,
|
2444
|
-
|
3238
|
+
pathAddresses: pathAddresses,
|
3239
|
+
pathFees: pathFees
|
2445
3240
|
});
|
2446
3241
|
callArgs = protocol.callOnIntegrationArgs({
|
2447
3242
|
adapter: uniswapV3Adapter,
|
2448
|
-
|
2449
|
-
|
3243
|
+
encodedCallArgs: takeOrderArgs,
|
3244
|
+
selector: protocol.takeOrderSelector
|
2450
3245
|
});
|
2451
3246
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2452
3247
|
|
2453
|
-
case
|
3248
|
+
case 10:
|
2454
3249
|
case "end":
|
2455
3250
|
return _context.stop();
|
2456
3251
|
}
|
@@ -2475,12 +3270,12 @@ function _yearnVaultV2Lend() {
|
|
2475
3270
|
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;
|
2476
3271
|
callArgs = protocol.callOnIntegrationArgs({
|
2477
3272
|
adapter: yearnVaultV2Adapter,
|
2478
|
-
selector: protocol.lendSelector,
|
2479
3273
|
encodedCallArgs: protocol.yearnVaultV2LendArgs({
|
2480
|
-
|
3274
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
2481
3275
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
2482
|
-
|
2483
|
-
})
|
3276
|
+
yVault: yVault
|
3277
|
+
}),
|
3278
|
+
selector: protocol.lendSelector
|
2484
3279
|
});
|
2485
3280
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2486
3281
|
|
@@ -2509,13 +3304,13 @@ function _yearnVaultV2Redeem() {
|
|
2509
3304
|
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;
|
2510
3305
|
callArgs = protocol.callOnIntegrationArgs({
|
2511
3306
|
adapter: yearnVaultV2Adapter,
|
2512
|
-
selector: protocol.redeemSelector,
|
2513
3307
|
encodedCallArgs: protocol.yearnVaultV2RedeemArgs({
|
2514
|
-
yVault: yVault,
|
2515
3308
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
2516
3309
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2517
|
-
slippageToleranceBps: slippageToleranceBps
|
2518
|
-
|
3310
|
+
slippageToleranceBps: slippageToleranceBps,
|
3311
|
+
yVault: yVault
|
3312
|
+
}),
|
3313
|
+
selector: protocol.redeemSelector
|
2519
3314
|
});
|
2520
3315
|
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2521
3316
|
|
@@ -2547,8 +3342,8 @@ function _zeroExV2TakeOrder() {
|
|
2547
3342
|
});
|
2548
3343
|
callArgs = protocol.callOnIntegrationArgs({
|
2549
3344
|
adapter: zeroExV2Adapter,
|
2550
|
-
|
2551
|
-
|
3345
|
+
encodedCallArgs: takeOrderArgs,
|
3346
|
+
selector: protocol.takeOrderSelector
|
2552
3347
|
});
|
2553
3348
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2554
3349
|
|
@@ -2691,7 +3486,8 @@ function assertEvent(receipt, event, match) {
|
|
2691
3486
|
var events = ethers$1.extractEvent(receipt, event);
|
2692
3487
|
expect(events.length).toBe(1);
|
2693
3488
|
expect(receipt).toHaveEmittedWith(event, match);
|
2694
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
3489
|
+
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
|
3490
|
+
|
2695
3491
|
return args;
|
2696
3492
|
}
|
2697
3493
|
function assertNoEvent(receipt, event) {
|
@@ -2852,6 +3648,7 @@ function _createComptrollerProxy() {
|
|
2852
3648
|
comptrollerProxyContract = _context.sent;
|
2853
3649
|
return _context.abrupt("return", {
|
2854
3650
|
comptrollerProxy: new protocol.ComptrollerLib(comptrollerProxyContract, signer),
|
3651
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
2855
3652
|
receipt: comptrollerProxyContract.deployment
|
2856
3653
|
});
|
2857
3654
|
|
@@ -2884,14 +3681,14 @@ function _createMigrationRequest() {
|
|
2884
3681
|
case 3:
|
2885
3682
|
receipt = _context2.sent;
|
2886
3683
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2887
|
-
creator: signer,
|
2888
3684
|
comptrollerProxy: expect.any(String),
|
3685
|
+
creator: signer,
|
2889
3686
|
denominationAsset: denominationAsset,
|
2890
3687
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2891
3688
|
});
|
2892
3689
|
return _context2.abrupt("return", {
|
2893
|
-
|
2894
|
-
|
3690
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3691
|
+
receipt: receipt
|
2895
3692
|
});
|
2896
3693
|
|
2897
3694
|
case 6:
|
@@ -2910,29 +3707,29 @@ function createNewFund(_x3) {
|
|
2910
3707
|
|
2911
3708
|
function _createNewFund() {
|
2912
3709
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2913
|
-
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;
|
3710
|
+
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;
|
2914
3711
|
|
2915
3712
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2916
3713
|
while (1) {
|
2917
3714
|
switch (_context3.prev = _context3.next) {
|
2918
3715
|
case 0:
|
2919
|
-
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;
|
3716
|
+
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;
|
2920
3717
|
_context3.next = 3;
|
2921
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
3718
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
2922
3719
|
|
2923
3720
|
case 3:
|
2924
3721
|
receipt = _context3.sent;
|
2925
3722
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2926
|
-
creator: signer,
|
2927
3723
|
comptrollerProxy: expect.any(String),
|
3724
|
+
creator: signer,
|
2928
3725
|
denominationAsset: denominationAsset,
|
2929
3726
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2930
3727
|
});
|
2931
3728
|
comptrollerProxy = new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
2932
3729
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
3730
|
+
comptrollerProxy: comptrollerProxy,
|
2933
3731
|
creator: signer,
|
2934
|
-
vaultProxy: expect.any(String)
|
2935
|
-
comptrollerProxy: comptrollerProxy
|
3732
|
+
vaultProxy: expect.any(String)
|
2936
3733
|
});
|
2937
3734
|
vaultProxy = new protocol.VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
2938
3735
|
|
@@ -2983,14 +3780,14 @@ function _createReconfigurationRequest() {
|
|
2983
3780
|
case 3:
|
2984
3781
|
receipt = _context4.sent;
|
2985
3782
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
2986
|
-
creator: signer,
|
2987
3783
|
comptrollerProxy: expect.any(String),
|
3784
|
+
creator: signer,
|
2988
3785
|
denominationAsset: denominationAsset,
|
2989
3786
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
2990
3787
|
});
|
2991
3788
|
return _context4.abrupt("return", {
|
2992
|
-
|
2993
|
-
|
3789
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3790
|
+
receipt: receipt
|
2994
3791
|
});
|
2995
3792
|
|
2996
3793
|
case 6:
|
@@ -3072,16 +3869,49 @@ function _setupGasRelayerPaymaster() {
|
|
3072
3869
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
3073
3870
|
}
|
3074
3871
|
|
3075
|
-
function
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
3079
|
-
|
3872
|
+
function vaultCallCreateNewList(_x) {
|
3873
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
3874
|
+
}
|
3875
|
+
|
3876
|
+
function _vaultCallCreateNewList() {
|
3877
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3878
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
3879
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3880
|
+
while (1) {
|
3881
|
+
switch (_context.prev = _context.next) {
|
3882
|
+
case 0:
|
3883
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
3884
|
+
_context.next = 3;
|
3885
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, protocol.addressListRegistryCreateListSelector, protocol.encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
3886
|
+
|
3887
|
+
case 3:
|
3888
|
+
_context.next = 5;
|
3889
|
+
return addressListRegistry.getListCount();
|
3890
|
+
|
3891
|
+
case 5:
|
3892
|
+
listCount = _context.sent;
|
3893
|
+
return _context.abrupt("return", listCount.sub(1));
|
3894
|
+
|
3895
|
+
case 7:
|
3896
|
+
case "end":
|
3897
|
+
return _context.stop();
|
3898
|
+
}
|
3899
|
+
}
|
3900
|
+
}, _callee);
|
3901
|
+
}));
|
3902
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
3080
3903
|
}
|
3081
|
-
|
3904
|
+
|
3905
|
+
function vaultCallCurveMinterMint(_ref2) {
|
3082
3906
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
3083
3907
|
minter = _ref2.minter,
|
3084
|
-
|
3908
|
+
gauge = _ref2.gauge;
|
3909
|
+
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintSelector, protocol.encodeArgs(['address'], [gauge]));
|
3910
|
+
}
|
3911
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
3912
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
3913
|
+
minter = _ref3.minter,
|
3914
|
+
gauges = _ref3.gauges;
|
3085
3915
|
var gaugesFormatted = new Array(8).fill(ethers.constants.AddressZero);
|
3086
3916
|
|
3087
3917
|
for (var i in gauges) {
|
@@ -3090,16 +3920,16 @@ function vaultCallCurveMinterMintMany(_ref2) {
|
|
3090
3920
|
|
3091
3921
|
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintManySelector, protocol.encodeArgs(['address[8]'], [gaugesFormatted]));
|
3092
3922
|
}
|
3093
|
-
function vaultCallCurveMinterToggleApproveMint(
|
3094
|
-
var comptrollerProxy =
|
3095
|
-
minter =
|
3096
|
-
account =
|
3923
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
3924
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
3925
|
+
minter = _ref4.minter,
|
3926
|
+
account = _ref4.account;
|
3097
3927
|
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterToggleApproveMintSelector, protocol.encodeArgs(['address'], [account]));
|
3098
3928
|
}
|
3099
|
-
function vaultCallStartAssetBypassTimelock(
|
3100
|
-
var comptrollerProxy =
|
3101
|
-
contract =
|
3102
|
-
asset =
|
3929
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
3930
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
3931
|
+
contract = _ref5.contract,
|
3932
|
+
asset = _ref5.asset;
|
3103
3933
|
return comptrollerProxy.vaultCallOnContract(contract, protocol.sighash(ethers.utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), protocol.encodeArgs(['address'], [asset]));
|
3104
3934
|
}
|
3105
3935
|
|
@@ -3155,8 +3985,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
3155
3985
|
// 50% discount
|
3156
3986
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
3157
3987
|
return _context2.abrupt("return", {
|
3158
|
-
|
3159
|
-
|
3988
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
3989
|
+
mlnValue: mlnValueOfBuyback
|
3160
3990
|
});
|
3161
3991
|
|
3162
3992
|
case 8:
|
@@ -3172,43 +4002,60 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
3172
4002
|
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; }
|
3173
4003
|
|
3174
4004
|
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; }
|
4005
|
+
|
4006
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
3175
4007
|
var whales = {
|
3176
|
-
|
3177
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
3178
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
4008
|
+
// primitives
|
3179
4009
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
3180
4010
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
3181
|
-
bnt: '
|
3182
|
-
|
4011
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
4012
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
4013
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
3183
4014
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
3184
|
-
dai: '
|
3185
|
-
knc: '
|
4015
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
4016
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
3186
4017
|
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
3187
4018
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
3188
4019
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
3189
4020
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
4021
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
3190
4022
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
3191
4023
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
4024
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
4025
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
3192
4026
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
3193
4027
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
3194
4028
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
3195
4029
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
3196
4030
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
3197
|
-
|
4031
|
+
// aTokens
|
4032
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
4033
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
4034
|
+
// cTokens
|
3198
4035
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
3199
|
-
cdai: '
|
4036
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
3200
4037
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
4038
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
4039
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
4040
|
+
// fTokens
|
4041
|
+
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
4042
|
+
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
4043
|
+
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
4044
|
+
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
4045
|
+
// ptTokens
|
4046
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
4047
|
+
// synths (unsupported)
|
3205
4048
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
3206
|
-
|
3207
|
-
|
4049
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
4050
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
4051
|
+
// misc
|
3208
4052
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
3209
|
-
|
3210
|
-
|
4053
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
4054
|
+
// Curve steth pool related
|
4055
|
+
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663'
|
3211
4056
|
};
|
4057
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
4058
|
+
|
3212
4059
|
function unlockWhale(_x) {
|
3213
4060
|
return _unlockWhale.apply(this, arguments);
|
3214
4061
|
}
|
@@ -3380,8 +4227,8 @@ function _relayTransaction() {
|
|
3380
4227
|
defaultMaxAcceptance = ethers.BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
3381
4228
|
|
3382
4229
|
mergedRelayRequest = {
|
3383
|
-
|
3384
|
-
|
4230
|
+
relayData: relayData,
|
4231
|
+
request: relayRequest
|
3385
4232
|
};
|
3386
4233
|
relayHub = new protocol.IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
3387
4234
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
@@ -3400,14 +4247,14 @@ var relayed = ethers.utils.EventFragment.fromString('TransactionRelayed(address
|
|
3400
4247
|
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)');
|
3401
4248
|
function assertDidRelay(receipt) {
|
3402
4249
|
return assertEvent(receipt, relayed, {
|
3403
|
-
|
3404
|
-
relayWorker: expect.any(String),
|
4250
|
+
charge: expect.anything(),
|
3405
4251
|
from: expect.any(String),
|
3406
|
-
to: expect.any(String),
|
3407
4252
|
paymaster: expect.any(String),
|
4253
|
+
relayManager: expect.any(String),
|
4254
|
+
relayWorker: expect.any(String),
|
3408
4255
|
selector: expect.any(String),
|
3409
4256
|
status: expect.anything(),
|
3410
|
-
|
4257
|
+
to: expect.any(String)
|
3411
4258
|
});
|
3412
4259
|
}
|
3413
4260
|
function assertDidRelaySuccessfully(receipt) {
|
@@ -3424,14 +4271,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
3424
4271
|
}
|
3425
4272
|
function assertPaymasterDidReject(receipt) {
|
3426
4273
|
return assertEvent(receipt, rejected, {
|
3427
|
-
relayManager: expect.any(String),
|
3428
|
-
paymaster: expect.any(String),
|
3429
4274
|
from: expect.any(String),
|
3430
|
-
|
4275
|
+
innerGasUsed: expect.anything(),
|
4276
|
+
paymaster: expect.any(String),
|
4277
|
+
reason: expect.any(String),
|
4278
|
+
relayManager: expect.any(String),
|
3431
4279
|
relayWorker: expect.any(String),
|
3432
4280
|
selector: expect.any(String),
|
3433
|
-
|
3434
|
-
reason: expect.any(String)
|
4281
|
+
to: expect.any(String)
|
3435
4282
|
});
|
3436
4283
|
}
|
3437
4284
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
@@ -3441,13 +4288,17 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
3441
4288
|
|
3442
4289
|
exports.CurveLiquidityGaugeV2 = CurveLiquidityGaugeV2;
|
3443
4290
|
exports.CurveMinter = CurveMinter;
|
4291
|
+
exports.CurveRegistry = CurveRegistry;
|
3444
4292
|
exports.CurveSwaps = CurveSwaps;
|
3445
4293
|
exports.ICompoundComptroller = ICompoundComptroller;
|
4294
|
+
exports.IUniswapV3NonFungibleTokenManager = IUniswapV3NonFungibleTokenManager;
|
3446
4295
|
exports.UniswapV2Factory = UniswapV2Factory;
|
3447
4296
|
exports.aaveLend = aaveLend;
|
3448
4297
|
exports.aaveRedeem = aaveRedeem;
|
3449
4298
|
exports.addNewAssetsToFund = addNewAssetsToFund;
|
3450
4299
|
exports.addTrackedAssetsToVault = addTrackedAssetsToVault;
|
4300
|
+
exports.assertCompoundLend = assertCompoundLend;
|
4301
|
+
exports.assertCompoundRedeem = assertCompoundRedeem;
|
3451
4302
|
exports.assertDidRelay = assertDidRelay;
|
3452
4303
|
exports.assertDidRelaySuccessfully = assertDidRelaySuccessfully;
|
3453
4304
|
exports.assertDidRelayWithCharge = assertDidRelayWithCharge;
|
@@ -3461,6 +4312,7 @@ exports.buySharesFunction = buySharesFunction;
|
|
3461
4312
|
exports.calcMlnValueAndBurnAmountForSharesBuyback = calcMlnValueAndBurnAmountForSharesBuyback;
|
3462
4313
|
exports.callOnExtension = callOnExtension;
|
3463
4314
|
exports.callOnExternalPosition = callOnExternalPosition;
|
4315
|
+
exports.compoundClaim = compoundClaim;
|
3464
4316
|
exports.compoundDebtPositionAddCollateral = compoundDebtPositionAddCollateral;
|
3465
4317
|
exports.compoundDebtPositionBorrow = compoundDebtPositionBorrow;
|
3466
4318
|
exports.compoundDebtPositionClaimComp = compoundDebtPositionClaimComp;
|
@@ -3476,6 +4328,7 @@ exports.createMigrationRequest = createMigrationRequest;
|
|
3476
4328
|
exports.createMockExternalPosition = createMockExternalPosition;
|
3477
4329
|
exports.createNewFund = createNewFund;
|
3478
4330
|
exports.createReconfigurationRequest = createReconfigurationRequest;
|
4331
|
+
exports.createUniswapV3LiquidityPosition = createUniswapV3LiquidityPosition;
|
3479
4332
|
exports.createVaultProxy = createVaultProxy;
|
3480
4333
|
exports.curveAaveClaimRewards = curveAaveClaimRewards;
|
3481
4334
|
exports.curveAaveLend = curveAaveLend;
|
@@ -3484,13 +4337,10 @@ exports.curveAaveRedeem = curveAaveRedeem;
|
|
3484
4337
|
exports.curveAaveStake = curveAaveStake;
|
3485
4338
|
exports.curveAaveUnstake = curveAaveUnstake;
|
3486
4339
|
exports.curveAaveUnstakeAndRedeem = curveAaveUnstakeAndRedeem;
|
3487
|
-
exports.
|
3488
|
-
exports.
|
3489
|
-
exports.
|
3490
|
-
exports.
|
3491
|
-
exports.curveEursStake = curveEursStake;
|
3492
|
-
exports.curveEursUnstake = curveEursUnstake;
|
3493
|
-
exports.curveEursUnstakeAndRedeem = curveEursUnstakeAndRedeem;
|
4340
|
+
exports.curveClaimRewards = curveClaimRewards;
|
4341
|
+
exports.curveLend = curveLend;
|
4342
|
+
exports.curveLendAndStake = curveLendAndStake;
|
4343
|
+
exports.curveRedeem = curveRedeem;
|
3494
4344
|
exports.curveSethClaimRewards = curveSethClaimRewards;
|
3495
4345
|
exports.curveSethLend = curveSethLend;
|
3496
4346
|
exports.curveSethLendAndStake = curveSethLendAndStake;
|
@@ -3498,6 +4348,7 @@ exports.curveSethRedeem = curveSethRedeem;
|
|
3498
4348
|
exports.curveSethStake = curveSethStake;
|
3499
4349
|
exports.curveSethUnstake = curveSethUnstake;
|
3500
4350
|
exports.curveSethUnstakeAndRedeem = curveSethUnstakeAndRedeem;
|
4351
|
+
exports.curveStake = curveStake;
|
3501
4352
|
exports.curveStethClaimRewards = curveStethClaimRewards;
|
3502
4353
|
exports.curveStethLend = curveStethLend;
|
3503
4354
|
exports.curveStethLendAndStake = curveStethLendAndStake;
|
@@ -3506,7 +4357,8 @@ exports.curveStethStake = curveStethStake;
|
|
3506
4357
|
exports.curveStethUnstake = curveStethUnstake;
|
3507
4358
|
exports.curveStethUnstakeAndRedeem = curveStethUnstakeAndRedeem;
|
3508
4359
|
exports.curveTakeOrder = curveTakeOrder;
|
3509
|
-
exports.
|
4360
|
+
exports.curveUnstake = curveUnstake;
|
4361
|
+
exports.curveUnstakeAndRedeem = curveUnstakeAndRedeem;
|
3510
4362
|
exports.deployProtocolFixture = deployProtocolFixture;
|
3511
4363
|
exports.generateFeeManagerConfigWithMockFees = generateFeeManagerConfigWithMockFees;
|
3512
4364
|
exports.generateMockFees = generateMockFees;
|
@@ -3530,8 +4382,15 @@ exports.mockGenericSwapArgs = mockGenericSwapArgs;
|
|
3530
4382
|
exports.mockGenericSwapBSelector = mockGenericSwapBSelector;
|
3531
4383
|
exports.mockGenericSwapDirectFromVaultSelector = mockGenericSwapDirectFromVaultSelector;
|
3532
4384
|
exports.mockGenericSwapViaApprovalSelector = mockGenericSwapViaApprovalSelector;
|
4385
|
+
exports.olympusV2Stake = olympusV2Stake;
|
4386
|
+
exports.olympusV2Unstake = olympusV2Unstake;
|
3533
4387
|
exports.paraSwapV4GenerateDummyPaths = paraSwapV4GenerateDummyPaths;
|
3534
4388
|
exports.paraSwapV4TakeOrder = paraSwapV4TakeOrder;
|
4389
|
+
exports.paraSwapV5GenerateDummyPaths = paraSwapV5GenerateDummyPaths;
|
4390
|
+
exports.paraSwapV5TakeOrder = paraSwapV5TakeOrder;
|
4391
|
+
exports.poolTogetherV4ClaimRewards = poolTogetherV4ClaimRewards;
|
4392
|
+
exports.poolTogetherV4Lend = poolTogetherV4Lend;
|
4393
|
+
exports.poolTogetherV4Redeem = poolTogetherV4Redeem;
|
3535
4394
|
exports.reactivateExternalPosition = reactivateExternalPosition;
|
3536
4395
|
exports.redeemSharesForSpecificAssets = redeemSharesForSpecificAssets;
|
3537
4396
|
exports.redeemSharesInKind = redeemSharesInKind;
|
@@ -3540,17 +4399,26 @@ exports.removeExternalPosition = removeExternalPosition;
|
|
3540
4399
|
exports.removeTrackedAssetsFromVault = removeTrackedAssetsFromVault;
|
3541
4400
|
exports.setupGasRelayerPaymaster = setupGasRelayerPaymaster;
|
3542
4401
|
exports.synthetixAssignExchangeDelegate = synthetixAssignExchangeDelegate;
|
3543
|
-
exports.
|
4402
|
+
exports.synthetixRedeem = synthetixRedeem;
|
3544
4403
|
exports.synthetixTakeOrder = synthetixTakeOrder;
|
3545
4404
|
exports.transactionTimestamp = transactionTimestamp;
|
3546
4405
|
exports.uniswapV2Lend = uniswapV2Lend;
|
3547
4406
|
exports.uniswapV2Redeem = uniswapV2Redeem;
|
3548
4407
|
exports.uniswapV2TakeOrder = uniswapV2TakeOrder;
|
4408
|
+
exports.uniswapV3LiquidityPositionAddLiquidity = uniswapV3LiquidityPositionAddLiquidity;
|
4409
|
+
exports.uniswapV3LiquidityPositionCollect = uniswapV3LiquidityPositionCollect;
|
4410
|
+
exports.uniswapV3LiquidityPositionGetMaxTick = uniswapV3LiquidityPositionGetMaxTick;
|
4411
|
+
exports.uniswapV3LiquidityPositionGetMinTick = uniswapV3LiquidityPositionGetMinTick;
|
4412
|
+
exports.uniswapV3LiquidityPositionMint = uniswapV3LiquidityPositionMint;
|
4413
|
+
exports.uniswapV3LiquidityPositionPurge = uniswapV3LiquidityPositionPurge;
|
4414
|
+
exports.uniswapV3LiquidityPositionRemoveLiquidity = uniswapV3LiquidityPositionRemoveLiquidity;
|
4415
|
+
exports.uniswapV3OrderTokenPair = uniswapV3OrderTokenPair;
|
3549
4416
|
exports.uniswapV3TakeOrder = uniswapV3TakeOrder;
|
3550
4417
|
exports.unlockAllWhales = unlockAllWhales;
|
3551
4418
|
exports.unlockWhale = unlockWhale;
|
3552
4419
|
exports.unlockWhales = unlockWhales;
|
3553
4420
|
exports.updateChainlinkAggregator = updateChainlinkAggregator;
|
4421
|
+
exports.vaultCallCreateNewList = vaultCallCreateNewList;
|
3554
4422
|
exports.vaultCallCurveMinterMint = vaultCallCurveMinterMint;
|
3555
4423
|
exports.vaultCallCurveMinterMintMany = vaultCallCurveMinterMintMany;
|
3556
4424
|
exports.vaultCallCurveMinterToggleApproveMint = vaultCallCurveMinterToggleApproveMint;
|