@enzymefinance/testutils 4.0.0-next.1 → 4.0.0-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/declarations/src/assertions.d.ts +2 -2
- package/dist/declarations/src/deployment.d.ts +168 -64
- 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 +3 -3
- 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 -3
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +14 -5
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +22 -22
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +40 -7
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +99 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +1 -1
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +4 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +108 -33
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +3 -3
- 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 +11 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +10 -10
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +1 -1
- 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 +15 -6
- package/dist/declarations/src/whales.d.ts +20 -18
- package/dist/enzymefinance-testutils.browser.cjs.js +1783 -763
- package/dist/enzymefinance-testutils.browser.esm.js +1746 -757
- package/dist/enzymefinance-testutils.cjs.dev.js +1783 -763
- package/dist/enzymefinance-testutils.cjs.prod.js +1783 -763
- package/dist/enzymefinance-testutils.esm.js +1746 -757
- package/package.json +5 -5
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +215 -111
- 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 +30 -12
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +33 -6
- package/src/scaffolding/extensions/external-positions/compound.ts +76 -96
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +132 -10
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +290 -0
- package/src/scaffolding/extensions/fees.ts +1 -1
- package/src/scaffolding/extensions/integrations/aave.ts +6 -8
- package/src/scaffolding/extensions/integrations/compound.ts +10 -11
- package/src/scaffolding/extensions/integrations/curve.ts +333 -68
- 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 -12
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +31 -27
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +9 -10
- package/src/scaffolding/extensions/integrations/yearn.ts +9 -11
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +9 -7
- package/src/scaffolding/extensions/policies.ts +2 -1
- package/src/scaffolding/setup.ts +27 -13
- package/src/scaffolding/shares.ts +5 -4
- package/src/scaffolding/vaultCalls.ts +32 -2
- package/src/whales.ts +30 -17
- package/tsconfig.json +2 -1
|
@@ -7,7 +7,6 @@ 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');
|
|
12
11
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
13
12
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
@@ -112,74 +111,83 @@ function _deployProtocolFixture() {
|
|
|
112
111
|
config = fixture['Config'].linkedData; // prettier-ignore
|
|
113
112
|
|
|
114
113
|
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),
|
|
114
|
+
aaveAdapter: new protocol.AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
|
119
115
|
aavePriceFeed: new protocol.AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
|
116
|
+
addressListRegistry: new protocol.AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
|
117
|
+
allowedAdapterIncomingAssetsPolicy: new protocol.AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
|
118
|
+
allowedAdaptersPolicy: new protocol.AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
|
119
|
+
allowedAssetsForRedemptionPolicy: new protocol.AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
|
120
|
+
allowedDepositRecipientsPolicy: new protocol.AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
|
121
|
+
allowedExternalPositionTypesPolicy: new protocol.AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
|
122
|
+
allowedSharesTransferRecipientsPolicy: new protocol.AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
|
123
|
+
assetFinalityResolver: new protocol.AssetFinalityResolver(fixture['AssetFinalityResolver'].address, deployer),
|
|
124
|
+
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
|
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
|
-
revertingPriceFeed: new protocol.RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
|
127
|
-
synthetixPriceFeed: new protocol.SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
|
128
|
-
stakehoundEthPriceFeed: new protocol.StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
|
129
|
-
wdgldPriceFeed: new protocol.WdgldPriceFeed(fixture['WdgldPriceFeed'].address, deployer),
|
|
130
|
-
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
|
131
|
-
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
|
132
|
-
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
|
133
|
-
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
|
134
|
-
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
|
135
|
-
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
|
128
|
+
comptrollerLib: new protocol.ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
|
129
|
+
cumulativeSlippageTolerancePolicy: new protocol.CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
|
130
|
+
curveExchangeAdapter: new protocol.CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
|
136
131
|
curveLiquidityAaveAdapter: new protocol.CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
|
132
|
+
curveLiquidityAdapter: new protocol.CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
|
137
133
|
curveLiquidityEursAdapter: new protocol.CurveLiquidityEursAdapter(fixture['CurveLiquidityEursAdapter'].address, deployer),
|
|
138
134
|
curveLiquiditySethAdapter: new protocol.CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
|
139
135
|
curveLiquidityStethAdapter: new protocol.CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
|
144
|
-
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
|
145
|
-
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer),
|
|
146
|
-
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
|
147
|
-
uniswapV2Adapter: new protocol.UniswapV2Adapter(fixture['UniswapV2Adapter'].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),
|
|
136
|
+
curvePriceFeed: new protocol.CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
|
137
|
+
depositWrapper: new protocol.DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
|
138
|
+
dispatcher: new protocol.Dispatcher(fixture['Dispatcher'].address, deployer),
|
|
152
139
|
entranceRateBurnFee: new protocol.EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
|
153
140
|
entranceRateDirectFee: new protocol.EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
|
154
141
|
exitRateBurnFee: new protocol.ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
|
155
142
|
exitRateDirectFee: new protocol.ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
|
143
|
+
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
|
144
|
+
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
|
145
|
+
feeManager: new protocol.FeeManager(fixture['FeeManager'].address, deployer),
|
|
146
|
+
fundDeployer: new protocol.FundDeployer(fixture['FundDeployer'].address, deployer),
|
|
147
|
+
fundValueCalculator: new protocol.FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
|
148
|
+
fundValueCalculatorRouter: new protocol.FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
|
149
|
+
fundValueCalculatorUsdWrapper: new protocol.FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
|
150
|
+
gasRelayPaymasterFactory: new protocol.GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
|
151
|
+
guaranteedRedemptionPolicy: new protocol.GuaranteedRedemptionPolicy(fixture['GuaranteedRedemptionPolicy'].address, deployer),
|
|
152
|
+
idleAdapter: new protocol.IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
|
153
|
+
idlePriceFeed: new protocol.IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
|
154
|
+
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
|
155
|
+
lidoStethPriceFeed: new protocol.LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
|
156
156
|
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),
|
|
157
|
+
minAssetBalancesPostRedemptionPolicy: new protocol.MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
|
161
158
|
minMaxInvestmentPolicy: new protocol.MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
olympusV2Adapter: new protocol.OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
|
160
|
+
onlyRemoveDustExternalPositionPolicy: new protocol.OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
|
161
|
+
onlyUntrackDustOrPricelessAssetsPolicy: new protocol.OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
|
162
|
+
paraSwapV4Adapter: new protocol.ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
|
163
|
+
paraSwapV5Adapter: new protocol.ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
|
164
|
+
performanceFee: new protocol.PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
|
165
|
+
policyManager: new protocol.PolicyManager(fixture['PolicyManager'].address, deployer),
|
|
166
|
+
poolTogetherV4Adapter: new protocol.PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
|
167
|
+
poolTogetherV4PriceFeed: new protocol.PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
|
167
168
|
protocolFeeReserveLib: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
|
168
169
|
protocolFeeReserveProxy: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
|
169
170
|
protocolFeeTracker: new protocol.ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
revertingPriceFeed: new protocol.RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
|
172
|
+
stakehoundEthPriceFeed: new protocol.StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
|
173
|
+
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
|
174
|
+
synthetixPriceFeed: new protocol.SynthetixPriceFeed(fixture['SynthetixPriceFeed'].address, deployer),
|
|
175
|
+
uniswapV2ExchangeAdapter: new protocol.UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
|
176
|
+
uniswapV2LiquidityAdapter: new protocol.UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
|
177
|
+
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
|
178
|
+
uniswapV3Adapter: new protocol.UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
|
179
|
+
unpermissionedActionsWrapper: new protocol.UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
|
180
|
+
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
|
181
|
+
vaultLib: new protocol.VaultLib(fixture['VaultLib'].address, deployer),
|
|
182
|
+
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
|
183
|
+
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
|
184
|
+
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
|
177
185
|
};
|
|
178
186
|
return _context3.abrupt("return", {
|
|
179
|
-
deployer: deployer,
|
|
180
|
-
deployment: deployment,
|
|
181
187
|
accounts: accounts,
|
|
182
|
-
config: config
|
|
188
|
+
config: config,
|
|
189
|
+
deployer: deployer,
|
|
190
|
+
deployment: deployment
|
|
183
191
|
});
|
|
184
192
|
|
|
185
193
|
case 12:
|
|
@@ -192,30 +200,6 @@ function _deployProtocolFixture() {
|
|
|
192
200
|
return _deployProtocolFixture.apply(this, arguments);
|
|
193
201
|
}
|
|
194
202
|
|
|
195
|
-
// TODO: Remove this.
|
|
196
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
197
|
-
function defaultTestDeployment(_x2) {
|
|
198
|
-
return _defaultTestDeployment.apply(this, arguments);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function _defaultTestDeployment() {
|
|
202
|
-
_defaultTestDeployment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_) {
|
|
203
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
204
|
-
while (1) {
|
|
205
|
-
switch (_context4.prev = _context4.next) {
|
|
206
|
-
case 0:
|
|
207
|
-
throw new Error('Removed');
|
|
208
|
-
|
|
209
|
-
case 1:
|
|
210
|
-
case "end":
|
|
211
|
-
return _context4.stop();
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}, _callee4);
|
|
215
|
-
}));
|
|
216
|
-
return _defaultTestDeployment.apply(this, arguments);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
203
|
function addTrackedAssetsToVault(_ref) {
|
|
220
204
|
var signer = _ref.signer,
|
|
221
205
|
comptrollerProxy = _ref.comptrollerProxy,
|
|
@@ -248,12 +232,12 @@ function _addNewAssetsToFund() {
|
|
|
248
232
|
switch (_context.prev = _context.next) {
|
|
249
233
|
case 0:
|
|
250
234
|
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;
|
|
251
|
-
// First, add tracked assets
|
|
235
|
+
// First, add tracked assets
|
|
252
236
|
receipt = addTrackedAssetsToVault({
|
|
253
|
-
|
|
237
|
+
assets: assets,
|
|
254
238
|
comptrollerProxy: comptrollerProxy,
|
|
255
239
|
integrationManager: integrationManager,
|
|
256
|
-
|
|
240
|
+
signer: signer
|
|
257
241
|
}); // Then seed the vault with balances as necessary
|
|
258
242
|
|
|
259
243
|
_context.next = 4;
|
|
@@ -405,13 +389,13 @@ function createFundDeployer(_x) {
|
|
|
405
389
|
|
|
406
390
|
function _createFundDeployer() {
|
|
407
391
|
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
408
|
-
var deployer, assetFinalityResolver, externalPositionManager, dispatcher,
|
|
392
|
+
var deployer, assetFinalityResolver, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
|
409
393
|
|
|
410
394
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
411
395
|
while (1) {
|
|
412
396
|
switch (_context.prev = _context.next) {
|
|
413
397
|
case 0:
|
|
414
|
-
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher,
|
|
398
|
+
deployer = _ref.deployer, assetFinalityResolver = _ref.assetFinalityResolver, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
|
415
399
|
_context.next = 3;
|
|
416
400
|
return vaultLib.getMlnToken();
|
|
417
401
|
|
|
@@ -433,77 +417,116 @@ function _createFundDeployer() {
|
|
|
433
417
|
case 12:
|
|
434
418
|
nextFundDeployer = _context.sent;
|
|
435
419
|
_context.next = 15;
|
|
436
|
-
return protocol.
|
|
420
|
+
return protocol.PolicyManager.deploy(deployer, nextFundDeployer, gasRelayPaymasterFactory);
|
|
437
421
|
|
|
438
422
|
case 15:
|
|
423
|
+
nextPolicyManager = _context.sent;
|
|
424
|
+
_context.t0 = protocol.ExternalPositionManager;
|
|
425
|
+
_context.t1 = deployer;
|
|
426
|
+
_context.t2 = nextFundDeployer;
|
|
427
|
+
_context.next = 21;
|
|
428
|
+
return externalPositionManager.getExternalPositionFactory();
|
|
429
|
+
|
|
430
|
+
case 21:
|
|
431
|
+
_context.t3 = _context.sent;
|
|
432
|
+
_context.t4 = nextPolicyManager;
|
|
433
|
+
_context.next = 25;
|
|
434
|
+
return _context.t0.deploy.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4);
|
|
435
|
+
|
|
436
|
+
case 25:
|
|
437
|
+
nextExternalPositionManager = _context.sent;
|
|
438
|
+
_context.next = 28;
|
|
439
|
+
return protocol.FeeManager.deploy(deployer, nextFundDeployer);
|
|
440
|
+
|
|
441
|
+
case 28:
|
|
442
|
+
nextFeeManager = _context.sent;
|
|
443
|
+
_context.next = 31;
|
|
444
|
+
return protocol.IntegrationManager.deploy(deployer, nextFundDeployer, nextPolicyManager, valueInterpreter);
|
|
445
|
+
|
|
446
|
+
case 31:
|
|
447
|
+
nextIntegrationManager = _context.sent;
|
|
448
|
+
_context.next = 34;
|
|
449
|
+
return protocol.ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, assetFinalityResolver, gasRelayPaymasterFactory, mlnToken, wethToken);
|
|
450
|
+
|
|
451
|
+
case 34:
|
|
439
452
|
nextComptrollerLib = _context.sent;
|
|
440
|
-
_context.next =
|
|
453
|
+
_context.next = 37;
|
|
441
454
|
return nextFundDeployer.setComptrollerLib(nextComptrollerLib);
|
|
442
455
|
|
|
443
|
-
case
|
|
444
|
-
_context.next =
|
|
456
|
+
case 37:
|
|
457
|
+
_context.next = 39;
|
|
445
458
|
return protocol.ProtocolFeeTracker.deploy(deployer, nextFundDeployer);
|
|
446
459
|
|
|
447
|
-
case
|
|
460
|
+
case 39:
|
|
448
461
|
nextProtocolFeeTracker = _context.sent;
|
|
449
|
-
_context.next =
|
|
462
|
+
_context.next = 42;
|
|
450
463
|
return nextFundDeployer.setProtocolFeeTracker(nextProtocolFeeTracker);
|
|
451
464
|
|
|
452
|
-
case
|
|
453
|
-
_context.
|
|
454
|
-
_context.
|
|
455
|
-
_context.
|
|
456
|
-
_context.next =
|
|
465
|
+
case 42:
|
|
466
|
+
_context.t5 = protocol.VaultLib;
|
|
467
|
+
_context.t6 = deployer;
|
|
468
|
+
_context.t7 = externalPositionManager;
|
|
469
|
+
_context.next = 47;
|
|
457
470
|
return vaultLib.getGasRelayPaymasterFactory();
|
|
458
471
|
|
|
459
|
-
case
|
|
460
|
-
_context.
|
|
461
|
-
_context.next =
|
|
472
|
+
case 47:
|
|
473
|
+
_context.t8 = _context.sent;
|
|
474
|
+
_context.next = 50;
|
|
462
475
|
return vaultLib.getProtocolFeeReserve();
|
|
463
476
|
|
|
464
|
-
case
|
|
465
|
-
_context.
|
|
466
|
-
_context.
|
|
467
|
-
_context.next =
|
|
477
|
+
case 50:
|
|
478
|
+
_context.t9 = _context.sent;
|
|
479
|
+
_context.t10 = nextProtocolFeeTracker;
|
|
480
|
+
_context.next = 54;
|
|
468
481
|
return vaultLib.getMlnToken();
|
|
469
482
|
|
|
470
|
-
case
|
|
471
|
-
_context.
|
|
472
|
-
_context.next =
|
|
483
|
+
case 54:
|
|
484
|
+
_context.t11 = _context.sent;
|
|
485
|
+
_context.next = 57;
|
|
486
|
+
return vaultLib.getMlnBurner();
|
|
487
|
+
|
|
488
|
+
case 57:
|
|
489
|
+
_context.t12 = _context.sent;
|
|
490
|
+
_context.next = 60;
|
|
473
491
|
return vaultLib.getWethToken();
|
|
474
492
|
|
|
475
|
-
case
|
|
476
|
-
_context.
|
|
477
|
-
_context.next =
|
|
478
|
-
return
|
|
493
|
+
case 60:
|
|
494
|
+
_context.t13 = _context.sent;
|
|
495
|
+
_context.next = 63;
|
|
496
|
+
return vaultLib.getPositionsLimit();
|
|
497
|
+
|
|
498
|
+
case 63:
|
|
499
|
+
_context.t14 = _context.sent;
|
|
500
|
+
_context.next = 66;
|
|
501
|
+
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);
|
|
479
502
|
|
|
480
|
-
case
|
|
503
|
+
case 66:
|
|
481
504
|
nextVaultLib = _context.sent;
|
|
482
|
-
_context.next =
|
|
505
|
+
_context.next = 69;
|
|
483
506
|
return nextFundDeployer.setVaultLib(nextVaultLib);
|
|
484
507
|
|
|
485
|
-
case
|
|
508
|
+
case 69:
|
|
486
509
|
if (!setReleaseLive) {
|
|
487
|
-
_context.next =
|
|
510
|
+
_context.next = 72;
|
|
488
511
|
break;
|
|
489
512
|
}
|
|
490
513
|
|
|
491
|
-
_context.next =
|
|
514
|
+
_context.next = 72;
|
|
492
515
|
return nextFundDeployer.setReleaseLive();
|
|
493
516
|
|
|
494
|
-
case
|
|
517
|
+
case 72:
|
|
495
518
|
if (!setOnDispatcher) {
|
|
496
|
-
_context.next =
|
|
519
|
+
_context.next = 75;
|
|
497
520
|
break;
|
|
498
521
|
}
|
|
499
522
|
|
|
500
|
-
_context.next =
|
|
523
|
+
_context.next = 75;
|
|
501
524
|
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
|
502
525
|
|
|
503
|
-
case
|
|
526
|
+
case 75:
|
|
504
527
|
return _context.abrupt("return", nextFundDeployer);
|
|
505
528
|
|
|
506
|
-
case
|
|
529
|
+
case 76:
|
|
507
530
|
case "end":
|
|
508
531
|
return _context.stop();
|
|
509
532
|
}
|
|
@@ -549,297 +572,331 @@ function _callOnExtension() {
|
|
|
549
572
|
return _callOnExtension.apply(this, arguments);
|
|
550
573
|
}
|
|
551
574
|
|
|
552
|
-
function
|
|
575
|
+
function callOnExternalPosition(_x) {
|
|
576
|
+
return _callOnExternalPosition.apply(this, arguments);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function _callOnExternalPosition() {
|
|
580
|
+
_callOnExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
581
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, actionId, actionArgs, callArgs;
|
|
582
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
583
|
+
while (1) {
|
|
584
|
+
switch (_context.prev = _context.next) {
|
|
585
|
+
case 0:
|
|
586
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
|
587
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
|
588
|
+
actionArgs: actionArgs,
|
|
589
|
+
actionId: actionId,
|
|
590
|
+
externalPositionProxy: externalPositionProxy
|
|
591
|
+
});
|
|
592
|
+
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
593
|
+
|
|
594
|
+
case 3:
|
|
595
|
+
case "end":
|
|
596
|
+
return _context.stop();
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}, _callee);
|
|
600
|
+
}));
|
|
601
|
+
return _callOnExternalPosition.apply(this, arguments);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function createExternalPosition(_x2) {
|
|
553
605
|
return _createExternalPosition.apply(this, arguments);
|
|
554
606
|
}
|
|
555
607
|
|
|
556
608
|
function _createExternalPosition() {
|
|
557
|
-
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
558
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId,
|
|
609
|
+
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
610
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, receipt, event, externalPositionProxy;
|
|
559
611
|
|
|
560
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
612
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
561
613
|
while (1) {
|
|
562
|
-
switch (
|
|
614
|
+
switch (_context2.prev = _context2.next) {
|
|
563
615
|
case 0:
|
|
564
|
-
signer =
|
|
565
|
-
|
|
616
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD;
|
|
617
|
+
_context2.next = 3;
|
|
566
618
|
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [externalPositionTypeId, initializationData]));
|
|
567
619
|
|
|
568
620
|
case 3:
|
|
569
|
-
receipt =
|
|
621
|
+
receipt = _context2.sent;
|
|
570
622
|
event = ethers$1.extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
|
571
623
|
externalPositionProxy = new protocol.IExternalPositionProxy(event[0].args.externalPosition, signer);
|
|
572
|
-
return
|
|
573
|
-
|
|
574
|
-
|
|
624
|
+
return _context2.abrupt("return", {
|
|
625
|
+
externalPositionProxy: externalPositionProxy,
|
|
626
|
+
receipt: receipt
|
|
575
627
|
});
|
|
576
628
|
|
|
577
629
|
case 7:
|
|
578
630
|
case "end":
|
|
579
|
-
return
|
|
631
|
+
return _context2.stop();
|
|
580
632
|
}
|
|
581
633
|
}
|
|
582
|
-
},
|
|
634
|
+
}, _callee2);
|
|
583
635
|
}));
|
|
584
636
|
return _createExternalPosition.apply(this, arguments);
|
|
585
637
|
}
|
|
586
638
|
|
|
587
|
-
function reactivateExternalPosition(
|
|
639
|
+
function reactivateExternalPosition(_x3) {
|
|
588
640
|
return _reactivateExternalPosition.apply(this, arguments);
|
|
589
641
|
}
|
|
590
642
|
|
|
591
643
|
function _reactivateExternalPosition() {
|
|
592
|
-
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
644
|
+
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
593
645
|
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
|
594
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
646
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
595
647
|
while (1) {
|
|
596
|
-
switch (
|
|
648
|
+
switch (_context3.prev = _context3.next) {
|
|
597
649
|
case 0:
|
|
598
|
-
signer =
|
|
650
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy;
|
|
599
651
|
callArgs = protocol.externalPositionReactivateArgs({
|
|
600
652
|
externalPositionProxy: externalPositionProxy
|
|
601
653
|
});
|
|
602
|
-
return
|
|
654
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.ReactivateExternalPosition, callArgs));
|
|
603
655
|
|
|
604
656
|
case 3:
|
|
605
657
|
case "end":
|
|
606
|
-
return
|
|
658
|
+
return _context3.stop();
|
|
607
659
|
}
|
|
608
660
|
}
|
|
609
|
-
},
|
|
661
|
+
}, _callee3);
|
|
610
662
|
}));
|
|
611
663
|
return _reactivateExternalPosition.apply(this, arguments);
|
|
612
664
|
}
|
|
613
665
|
|
|
614
|
-
function removeExternalPosition(
|
|
666
|
+
function removeExternalPosition(_x4) {
|
|
615
667
|
return _removeExternalPosition.apply(this, arguments);
|
|
616
668
|
}
|
|
617
669
|
|
|
618
670
|
function _removeExternalPosition() {
|
|
619
|
-
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
671
|
+
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
|
620
672
|
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
|
621
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
673
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
622
674
|
while (1) {
|
|
623
|
-
switch (
|
|
675
|
+
switch (_context4.prev = _context4.next) {
|
|
624
676
|
case 0:
|
|
625
|
-
signer =
|
|
677
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy;
|
|
626
678
|
callArgs = protocol.externalPositionRemoveArgs({
|
|
627
679
|
externalPositionProxy: externalPositionProxy
|
|
628
680
|
});
|
|
629
|
-
return
|
|
681
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.RemoveExternalPosition, callArgs));
|
|
630
682
|
|
|
631
683
|
case 3:
|
|
632
684
|
case "end":
|
|
633
|
-
return
|
|
685
|
+
return _context4.stop();
|
|
634
686
|
}
|
|
635
687
|
}
|
|
636
|
-
},
|
|
688
|
+
}, _callee4);
|
|
637
689
|
}));
|
|
638
690
|
return _removeExternalPosition.apply(this, arguments);
|
|
639
691
|
}
|
|
640
692
|
|
|
641
|
-
function
|
|
642
|
-
return
|
|
693
|
+
function compoundDebtPositionAddCollateral(_x) {
|
|
694
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
|
643
695
|
}
|
|
644
696
|
|
|
645
|
-
function
|
|
646
|
-
|
|
647
|
-
var
|
|
697
|
+
function _compoundDebtPositionAddCollateral() {
|
|
698
|
+
_compoundDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
699
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
|
648
700
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
649
701
|
while (1) {
|
|
650
702
|
switch (_context.prev = _context.next) {
|
|
651
703
|
case 0:
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
704
|
+
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
|
705
|
+
actionArgs = protocol.compoundExternalPositionActionArgs({
|
|
706
|
+
amounts: amounts,
|
|
707
|
+
assets: assets,
|
|
708
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
|
709
|
+
});
|
|
710
|
+
return _context.abrupt("return", callOnExternalPosition({
|
|
711
|
+
actionArgs: actionArgs,
|
|
712
|
+
actionId: protocol.CompoundDebtPositionActionId.AddCollateralAssets,
|
|
655
713
|
comptrollerProxy: comptrollerProxy,
|
|
656
714
|
externalPositionManager: externalPositionManager,
|
|
657
|
-
|
|
715
|
+
externalPositionProxy: externalPositionProxy,
|
|
716
|
+
signer: fundOwner
|
|
658
717
|
}));
|
|
659
718
|
|
|
660
|
-
case
|
|
719
|
+
case 3:
|
|
661
720
|
case "end":
|
|
662
721
|
return _context.stop();
|
|
663
722
|
}
|
|
664
723
|
}
|
|
665
724
|
}, _callee);
|
|
666
725
|
}));
|
|
667
|
-
return
|
|
726
|
+
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
|
668
727
|
}
|
|
669
728
|
|
|
670
|
-
function
|
|
671
|
-
return
|
|
729
|
+
function compoundDebtPositionBorrow(_x2) {
|
|
730
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
|
672
731
|
}
|
|
673
732
|
|
|
674
|
-
function
|
|
675
|
-
|
|
676
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts,
|
|
733
|
+
function _compoundDebtPositionBorrow() {
|
|
734
|
+
_compoundDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
735
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, assets, amounts, cTokens, actionArgs;
|
|
677
736
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
678
737
|
while (1) {
|
|
679
738
|
switch (_context2.prev = _context2.next) {
|
|
680
739
|
case 0:
|
|
681
|
-
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner,
|
|
740
|
+
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
|
682
741
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
|
683
|
-
assets: assets,
|
|
684
742
|
amounts: amounts,
|
|
743
|
+
assets: assets,
|
|
685
744
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
|
686
745
|
});
|
|
687
|
-
|
|
746
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
|
747
|
+
actionArgs: actionArgs,
|
|
748
|
+
actionId: protocol.CompoundDebtPositionActionId.BorrowAsset,
|
|
749
|
+
comptrollerProxy: comptrollerProxy,
|
|
750
|
+
externalPositionManager: externalPositionManager,
|
|
688
751
|
externalPositionProxy: externalPositionProxy,
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
});
|
|
692
|
-
addCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
693
|
-
return _context2.abrupt("return", addCollateralTx);
|
|
752
|
+
signer: fundOwner
|
|
753
|
+
}));
|
|
694
754
|
|
|
695
|
-
case
|
|
755
|
+
case 3:
|
|
696
756
|
case "end":
|
|
697
757
|
return _context2.stop();
|
|
698
758
|
}
|
|
699
759
|
}
|
|
700
760
|
}, _callee2);
|
|
701
761
|
}));
|
|
702
|
-
return
|
|
762
|
+
return _compoundDebtPositionBorrow.apply(this, arguments);
|
|
703
763
|
}
|
|
704
764
|
|
|
705
|
-
function
|
|
706
|
-
return
|
|
765
|
+
function compoundDebtPositionClaimComp(_x3) {
|
|
766
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
|
707
767
|
}
|
|
708
768
|
|
|
709
|
-
function
|
|
710
|
-
|
|
711
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
|
769
|
+
function _compoundDebtPositionClaimComp() {
|
|
770
|
+
_compoundDebtPositionClaimComp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
771
|
+
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs;
|
|
712
772
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
713
773
|
while (1) {
|
|
714
774
|
switch (_context3.prev = _context3.next) {
|
|
715
775
|
case 0:
|
|
716
|
-
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner,
|
|
776
|
+
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
|
717
777
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
data:
|
|
778
|
+
amounts: [],
|
|
779
|
+
assets: [],
|
|
780
|
+
data: '0x'
|
|
721
781
|
});
|
|
722
|
-
|
|
782
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
|
783
|
+
actionArgs: actionArgs,
|
|
784
|
+
actionId: protocol.CompoundDebtPositionActionId.ClaimComp,
|
|
785
|
+
comptrollerProxy: comptrollerProxy,
|
|
786
|
+
externalPositionManager: externalPositionManager,
|
|
723
787
|
externalPositionProxy: externalPositionProxy,
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
});
|
|
727
|
-
removeCollateralTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
728
|
-
return _context3.abrupt("return", removeCollateralTx);
|
|
788
|
+
signer: fundOwner
|
|
789
|
+
}));
|
|
729
790
|
|
|
730
|
-
case
|
|
791
|
+
case 3:
|
|
731
792
|
case "end":
|
|
732
793
|
return _context3.stop();
|
|
733
794
|
}
|
|
734
795
|
}
|
|
735
796
|
}, _callee3);
|
|
736
797
|
}));
|
|
737
|
-
return
|
|
798
|
+
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
|
738
799
|
}
|
|
739
800
|
|
|
740
|
-
function
|
|
741
|
-
return
|
|
801
|
+
function compoundDebtPositionRemoveCollateral(_x4) {
|
|
802
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
|
742
803
|
}
|
|
743
804
|
|
|
744
|
-
function
|
|
745
|
-
|
|
746
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
|
805
|
+
function _compoundDebtPositionRemoveCollateral() {
|
|
806
|
+
_compoundDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
|
807
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
|
747
808
|
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
748
809
|
while (1) {
|
|
749
810
|
switch (_context4.prev = _context4.next) {
|
|
750
811
|
case 0:
|
|
751
|
-
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner,
|
|
812
|
+
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
|
752
813
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
|
753
|
-
assets: assets,
|
|
754
814
|
amounts: amounts,
|
|
815
|
+
assets: assets,
|
|
755
816
|
data: protocol.encodeArgs(['address[]'], [cTokens])
|
|
756
817
|
});
|
|
757
|
-
|
|
818
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
|
819
|
+
actionArgs: actionArgs,
|
|
820
|
+
actionId: protocol.CompoundDebtPositionActionId.RemoveCollateralAssets,
|
|
821
|
+
comptrollerProxy: comptrollerProxy,
|
|
822
|
+
externalPositionManager: externalPositionManager,
|
|
758
823
|
externalPositionProxy: externalPositionProxy,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
});
|
|
762
|
-
borrowTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
763
|
-
return _context4.abrupt("return", borrowTx);
|
|
824
|
+
signer: fundOwner
|
|
825
|
+
}));
|
|
764
826
|
|
|
765
|
-
case
|
|
827
|
+
case 3:
|
|
766
828
|
case "end":
|
|
767
829
|
return _context4.stop();
|
|
768
830
|
}
|
|
769
831
|
}
|
|
770
832
|
}, _callee4);
|
|
771
833
|
}));
|
|
772
|
-
return
|
|
834
|
+
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
|
773
835
|
}
|
|
774
836
|
|
|
775
|
-
function
|
|
776
|
-
return
|
|
837
|
+
function compoundDebtPositionRepayBorrow(_x5) {
|
|
838
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
|
777
839
|
}
|
|
778
840
|
|
|
779
|
-
function
|
|
780
|
-
|
|
781
|
-
var comptrollerProxy, externalPositionManager, fundOwner,
|
|
841
|
+
function _compoundDebtPositionRepayBorrow() {
|
|
842
|
+
_compoundDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
|
843
|
+
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
|
782
844
|
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
783
845
|
while (1) {
|
|
784
846
|
switch (_context5.prev = _context5.next) {
|
|
785
847
|
case 0:
|
|
786
|
-
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, externalPositionProxy = _ref5.externalPositionProxy;
|
|
848
|
+
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
|
787
849
|
actionArgs = protocol.compoundExternalPositionActionArgs({
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
data: '
|
|
850
|
+
amounts: amounts,
|
|
851
|
+
assets: assets,
|
|
852
|
+
data: protocol.encodeArgs(['address[]'], [cTokens])
|
|
791
853
|
});
|
|
792
|
-
|
|
854
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
|
855
|
+
actionArgs: actionArgs,
|
|
856
|
+
actionId: protocol.CompoundDebtPositionActionId.RepayBorrowedAssets,
|
|
857
|
+
comptrollerProxy: comptrollerProxy,
|
|
858
|
+
externalPositionManager: externalPositionManager,
|
|
793
859
|
externalPositionProxy: externalPositionProxy,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
});
|
|
797
|
-
claimCompTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
798
|
-
return _context5.abrupt("return", claimCompTx);
|
|
860
|
+
signer: fundOwner
|
|
861
|
+
}));
|
|
799
862
|
|
|
800
|
-
case
|
|
863
|
+
case 3:
|
|
801
864
|
case "end":
|
|
802
865
|
return _context5.stop();
|
|
803
866
|
}
|
|
804
867
|
}
|
|
805
868
|
}, _callee5);
|
|
806
869
|
}));
|
|
807
|
-
return
|
|
870
|
+
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
|
808
871
|
}
|
|
809
872
|
|
|
810
|
-
function
|
|
811
|
-
return
|
|
873
|
+
function createCompoundDebtPosition(_x6) {
|
|
874
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
|
812
875
|
}
|
|
813
876
|
|
|
814
|
-
function
|
|
815
|
-
|
|
816
|
-
var comptrollerProxy, externalPositionManager
|
|
877
|
+
function _createCompoundDebtPosition() {
|
|
878
|
+
_createCompoundDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
|
879
|
+
var signer, comptrollerProxy, externalPositionManager;
|
|
817
880
|
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
818
881
|
while (1) {
|
|
819
882
|
switch (_context6.prev = _context6.next) {
|
|
820
883
|
case 0:
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
externalPositionProxy: externalPositionProxy,
|
|
829
|
-
actionId: protocol.CompoundDebtPositionActionId.RepayBorrowedAssets,
|
|
830
|
-
encodedCallArgs: actionArgs
|
|
831
|
-
});
|
|
832
|
-
repayTx = comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
|
833
|
-
return _context6.abrupt("return", repayTx);
|
|
884
|
+
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
|
885
|
+
return _context6.abrupt("return", createExternalPosition({
|
|
886
|
+
comptrollerProxy: comptrollerProxy,
|
|
887
|
+
externalPositionManager: externalPositionManager,
|
|
888
|
+
externalPositionTypeId: protocol.ExternalPositionType.CompoundDebtPosition,
|
|
889
|
+
signer: signer
|
|
890
|
+
}));
|
|
834
891
|
|
|
835
|
-
case
|
|
892
|
+
case 2:
|
|
836
893
|
case "end":
|
|
837
894
|
return _context6.stop();
|
|
838
895
|
}
|
|
839
896
|
}
|
|
840
897
|
}, _callee6);
|
|
841
898
|
}));
|
|
842
|
-
return
|
|
899
|
+
return _createCompoundDebtPosition.apply(this, arguments);
|
|
843
900
|
}
|
|
844
901
|
|
|
845
902
|
function createMockExternalPosition(_x) {
|
|
@@ -854,7 +911,7 @@ function _createMockExternalPosition() {
|
|
|
854
911
|
switch (_context.prev = _context.next) {
|
|
855
912
|
case 0:
|
|
856
913
|
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
|
857
|
-
_context.t0 =
|
|
914
|
+
_context.t0 = protocol.VaultLib;
|
|
858
915
|
_context.next = 4;
|
|
859
916
|
return comptrollerProxy.getVaultProxy();
|
|
860
917
|
|
|
@@ -872,12 +929,12 @@ function _createMockExternalPosition() {
|
|
|
872
929
|
|
|
873
930
|
case 12:
|
|
874
931
|
_context.next = 14;
|
|
875
|
-
return
|
|
932
|
+
return protocol.MockGenericExternalPositionLib.deploy(deployer);
|
|
876
933
|
|
|
877
934
|
case 14:
|
|
878
935
|
mockGenericExternalPositionLib = _context.sent;
|
|
879
936
|
_context.next = 17;
|
|
880
|
-
return
|
|
937
|
+
return protocol.MockGenericExternalPositionParser.deploy(deployer);
|
|
881
938
|
|
|
882
939
|
case 17:
|
|
883
940
|
mockExternalPositionParser = _context.sent;
|
|
@@ -887,7 +944,7 @@ function _createMockExternalPosition() {
|
|
|
887
944
|
|
|
888
945
|
case 21:
|
|
889
946
|
_context.next = 23;
|
|
890
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager,
|
|
947
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [typeId, '0x']));
|
|
891
948
|
|
|
892
949
|
case 23:
|
|
893
950
|
receipt = _context.sent;
|
|
@@ -897,11 +954,11 @@ function _createMockExternalPosition() {
|
|
|
897
954
|
case 26:
|
|
898
955
|
externalPositionProxy = _context.sent[0];
|
|
899
956
|
return _context.abrupt("return", {
|
|
900
|
-
typeId: typeId,
|
|
901
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
|
902
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
|
903
957
|
externalPositionProxy: externalPositionProxy,
|
|
904
|
-
|
|
958
|
+
mockExternalPositionParser: mockExternalPositionParser,
|
|
959
|
+
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
|
960
|
+
receipt: receipt,
|
|
961
|
+
typeId: typeId
|
|
905
962
|
});
|
|
906
963
|
|
|
907
964
|
case 28:
|
|
@@ -914,6 +971,416 @@ function _createMockExternalPosition() {
|
|
|
914
971
|
return _createMockExternalPosition.apply(this, arguments);
|
|
915
972
|
}
|
|
916
973
|
|
|
974
|
+
function mockExternalPositionAddDebtAssets(_x2) {
|
|
975
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
function _mockExternalPositionAddDebtAssets() {
|
|
979
|
+
_mockExternalPositionAddDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
980
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
|
981
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
982
|
+
while (1) {
|
|
983
|
+
switch (_context2.prev = _context2.next) {
|
|
984
|
+
case 0:
|
|
985
|
+
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
|
986
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
|
987
|
+
amounts: amounts,
|
|
988
|
+
assets: assets
|
|
989
|
+
});
|
|
990
|
+
return _context2.abrupt("return", callOnExternalPosition({
|
|
991
|
+
actionArgs: actionArgs,
|
|
992
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddDebtAssets,
|
|
993
|
+
comptrollerProxy: comptrollerProxy,
|
|
994
|
+
externalPositionManager: externalPositionManager,
|
|
995
|
+
externalPositionProxy: externalPositionProxy,
|
|
996
|
+
signer: signer
|
|
997
|
+
}));
|
|
998
|
+
|
|
999
|
+
case 3:
|
|
1000
|
+
case "end":
|
|
1001
|
+
return _context2.stop();
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}, _callee2);
|
|
1005
|
+
}));
|
|
1006
|
+
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
function mockExternalPositionAddManagedAssets(_x3) {
|
|
1010
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function _mockExternalPositionAddManagedAssets() {
|
|
1014
|
+
_mockExternalPositionAddManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
1015
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
|
1016
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
1017
|
+
while (1) {
|
|
1018
|
+
switch (_context3.prev = _context3.next) {
|
|
1019
|
+
case 0:
|
|
1020
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
|
1021
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
|
1022
|
+
amounts: amounts,
|
|
1023
|
+
assets: assets
|
|
1024
|
+
});
|
|
1025
|
+
return _context3.abrupt("return", callOnExternalPosition({
|
|
1026
|
+
actionArgs: actionArgs,
|
|
1027
|
+
actionId: protocol.MockGenericExternalPositionActionId.AddManagedAssets,
|
|
1028
|
+
comptrollerProxy: comptrollerProxy,
|
|
1029
|
+
externalPositionManager: externalPositionManager,
|
|
1030
|
+
externalPositionProxy: externalPositionProxy,
|
|
1031
|
+
signer: signer
|
|
1032
|
+
}));
|
|
1033
|
+
|
|
1034
|
+
case 3:
|
|
1035
|
+
case "end":
|
|
1036
|
+
return _context3.stop();
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
}, _callee3);
|
|
1040
|
+
}));
|
|
1041
|
+
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
function mockExternalPositionRemoveDebtAssets(_x4) {
|
|
1045
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
function _mockExternalPositionRemoveDebtAssets() {
|
|
1049
|
+
_mockExternalPositionRemoveDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
|
1050
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
|
1051
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
1052
|
+
while (1) {
|
|
1053
|
+
switch (_context4.prev = _context4.next) {
|
|
1054
|
+
case 0:
|
|
1055
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
|
1056
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
|
1057
|
+
amounts: amounts,
|
|
1058
|
+
assets: assets
|
|
1059
|
+
});
|
|
1060
|
+
return _context4.abrupt("return", callOnExternalPosition({
|
|
1061
|
+
actionArgs: actionArgs,
|
|
1062
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveDebtAssets,
|
|
1063
|
+
comptrollerProxy: comptrollerProxy,
|
|
1064
|
+
externalPositionManager: externalPositionManager,
|
|
1065
|
+
externalPositionProxy: externalPositionProxy,
|
|
1066
|
+
signer: signer
|
|
1067
|
+
}));
|
|
1068
|
+
|
|
1069
|
+
case 3:
|
|
1070
|
+
case "end":
|
|
1071
|
+
return _context4.stop();
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}, _callee4);
|
|
1075
|
+
}));
|
|
1076
|
+
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
function mockExternalPositionRemoveManagedAssets(_x5) {
|
|
1080
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
function _mockExternalPositionRemoveManagedAssets() {
|
|
1084
|
+
_mockExternalPositionRemoveManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
|
1085
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
|
1086
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
1087
|
+
while (1) {
|
|
1088
|
+
switch (_context5.prev = _context5.next) {
|
|
1089
|
+
case 0:
|
|
1090
|
+
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
|
1091
|
+
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
|
1092
|
+
amounts: amounts,
|
|
1093
|
+
assets: assets
|
|
1094
|
+
});
|
|
1095
|
+
return _context5.abrupt("return", callOnExternalPosition({
|
|
1096
|
+
actionArgs: actionArgs,
|
|
1097
|
+
actionId: protocol.MockGenericExternalPositionActionId.RemoveManagedAssets,
|
|
1098
|
+
comptrollerProxy: comptrollerProxy,
|
|
1099
|
+
externalPositionManager: externalPositionManager,
|
|
1100
|
+
externalPositionProxy: externalPositionProxy,
|
|
1101
|
+
signer: signer
|
|
1102
|
+
}));
|
|
1103
|
+
|
|
1104
|
+
case 3:
|
|
1105
|
+
case "end":
|
|
1106
|
+
return _context5.stop();
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}, _callee5);
|
|
1110
|
+
}));
|
|
1111
|
+
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
var _templateObject$3;
|
|
1115
|
+
exports.UniswapV3FeeAmount = void 0;
|
|
1116
|
+
|
|
1117
|
+
(function (UniswapV3FeeAmount) {
|
|
1118
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
|
1119
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
|
1120
|
+
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
|
1121
|
+
})(exports.UniswapV3FeeAmount || (exports.UniswapV3FeeAmount = {}));
|
|
1122
|
+
|
|
1123
|
+
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
|
1124
|
+
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
|
1125
|
+
};
|
|
1126
|
+
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
|
1127
|
+
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
|
1128
|
+
};
|
|
1129
|
+
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"])));
|
|
1130
|
+
function createUniswapV3LiquidityPosition(_x) {
|
|
1131
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
function _createUniswapV3LiquidityPosition() {
|
|
1135
|
+
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
1136
|
+
var signer, comptrollerProxy, externalPositionManager, token0, token1, initArgs, receipt, vaultProxy, externalPositions, externalPositionProxyAddress;
|
|
1137
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1138
|
+
while (1) {
|
|
1139
|
+
switch (_context.prev = _context.next) {
|
|
1140
|
+
case 0:
|
|
1141
|
+
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, token0 = _ref.token0, token1 = _ref.token1;
|
|
1142
|
+
initArgs = protocol.uniswapV3LiquidityPositionInitArgs({
|
|
1143
|
+
token0: token0,
|
|
1144
|
+
token1: token1
|
|
1145
|
+
});
|
|
1146
|
+
_context.next = 4;
|
|
1147
|
+
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes'], [protocol.ExternalPositionType.UniswapV3LiquidityPosition, initArgs]));
|
|
1148
|
+
|
|
1149
|
+
case 4:
|
|
1150
|
+
receipt = _context.sent;
|
|
1151
|
+
_context.t0 = protocol.VaultLib;
|
|
1152
|
+
_context.next = 8;
|
|
1153
|
+
return comptrollerProxy.getVaultProxy();
|
|
1154
|
+
|
|
1155
|
+
case 8:
|
|
1156
|
+
_context.t1 = _context.sent;
|
|
1157
|
+
_context.t2 = signer;
|
|
1158
|
+
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
|
1159
|
+
_context.next = 13;
|
|
1160
|
+
return vaultProxy.getActiveExternalPositions.call();
|
|
1161
|
+
|
|
1162
|
+
case 13:
|
|
1163
|
+
externalPositions = _context.sent;
|
|
1164
|
+
externalPositionProxyAddress = externalPositions[externalPositions.length - 1];
|
|
1165
|
+
return _context.abrupt("return", {
|
|
1166
|
+
externalPositionProxyAddress: externalPositionProxyAddress,
|
|
1167
|
+
receipt: receipt
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1170
|
+
case 16:
|
|
1171
|
+
case "end":
|
|
1172
|
+
return _context.stop();
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
}, _callee);
|
|
1176
|
+
}));
|
|
1177
|
+
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
|
1181
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
function _uniswapV3LiquidityPositionAddLiquidity() {
|
|
1185
|
+
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
1186
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
|
1187
|
+
|
|
1188
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1189
|
+
while (1) {
|
|
1190
|
+
switch (_context2.prev = _context2.next) {
|
|
1191
|
+
case 0:
|
|
1192
|
+
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;
|
|
1193
|
+
actionArgs = protocol.uniswapV3LiquidityPositionAddLiquidityArgs({
|
|
1194
|
+
amount0Desired: amount0Desired,
|
|
1195
|
+
amount0Min: amount0Min,
|
|
1196
|
+
amount1Desired: amount1Desired,
|
|
1197
|
+
amount1Min: amount1Min,
|
|
1198
|
+
nftId: nftId
|
|
1199
|
+
});
|
|
1200
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
|
1201
|
+
actionArgs: actionArgs,
|
|
1202
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.AddLiquidity,
|
|
1203
|
+
externalPositionProxy: externalPositionProxy
|
|
1204
|
+
});
|
|
1205
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1206
|
+
|
|
1207
|
+
case 4:
|
|
1208
|
+
case "end":
|
|
1209
|
+
return _context2.stop();
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}, _callee2);
|
|
1213
|
+
}));
|
|
1214
|
+
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
function uniswapV3LiquidityPositionCollect(_x3) {
|
|
1218
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
function _uniswapV3LiquidityPositionCollect() {
|
|
1222
|
+
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
1223
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
|
1224
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
1225
|
+
while (1) {
|
|
1226
|
+
switch (_context3.prev = _context3.next) {
|
|
1227
|
+
case 0:
|
|
1228
|
+
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
|
1229
|
+
actionArgs = protocol.uniswapV3LiquidityPositionCollectArgs({
|
|
1230
|
+
nftId: nftId
|
|
1231
|
+
});
|
|
1232
|
+
callArgs = protocol.callOnExternalPositionArgs({
|
|
1233
|
+
actionArgs: actionArgs,
|
|
1234
|
+
actionId: protocol.UniswapV3LiquidityPositionActionId.Collect,
|
|
1235
|
+
externalPositionProxy: externalPositionProxy
|
|
1236
|
+
});
|
|
1237
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
|
1238
|
+
|
|
1239
|
+
case 4:
|
|
1240
|
+
case "end":
|
|
1241
|
+
return _context3.stop();
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
}, _callee3);
|
|
1245
|
+
}));
|
|
1246
|
+
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function uniswapV3LiquidityPositionMint(_x4) {
|
|
1250
|
+
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function _uniswapV3LiquidityPositionMint() {
|
|
1254
|
+
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
|
1255
|
+
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
|
1256
|
+
|
|
1257
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
1258
|
+
while (1) {
|
|
1259
|
+
switch (_context4.prev = _context4.next) {
|
|
1260
|
+
case 0:
|
|
1261
|
+
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
|
1262
|
+
actionArgs = protocol.uniswapV3LiquidityPositionMintArgs({
|
|
1263
|
+
amount0Desired: amount0Desired,
|
|
1264
|
+
amount0Min: amount0Min,
|
|
1265
|
+
amount1Desired: amount1Desired,
|
|
1266
|
+
amount1Min: amount1Min,
|
|
1267
|
+
fee: fee,
|
|
1268
|
+
tickLower: tickLower,
|
|
1269
|
+
tickUpper: tickUpper
|
|
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
|
+
|
|
917
1384
|
function generateFeeManagerConfigWithMockFees(_x) {
|
|
918
1385
|
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
|
919
1386
|
}
|
|
@@ -1018,8 +1485,8 @@ function _aaveLend() {
|
|
|
1018
1485
|
});
|
|
1019
1486
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1020
1487
|
adapter: aaveAdapter,
|
|
1021
|
-
|
|
1022
|
-
|
|
1488
|
+
encodedCallArgs: lendArgs,
|
|
1489
|
+
selector: protocol.lendSelector
|
|
1023
1490
|
});
|
|
1024
1491
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1025
1492
|
return _context.abrupt("return", lendTx);
|
|
@@ -1053,8 +1520,8 @@ function _aaveRedeem() {
|
|
|
1053
1520
|
});
|
|
1054
1521
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1055
1522
|
adapter: aaveAdapter,
|
|
1056
|
-
|
|
1057
|
-
|
|
1523
|
+
encodedCallArgs: redeemArgs,
|
|
1524
|
+
selector: protocol.redeemSelector
|
|
1058
1525
|
});
|
|
1059
1526
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1060
1527
|
return _context2.abrupt("return", redeemTx);
|
|
@@ -1086,13 +1553,13 @@ function _compoundLend() {
|
|
|
1086
1553
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, cToken = _ref.cToken, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$tokenAmount, _ref$cTokenAmount = _ref.cTokenAmount, cTokenAmount = _ref$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$cTokenAmount;
|
|
1087
1554
|
lendArgs = protocol.compoundArgs({
|
|
1088
1555
|
cToken: cToken,
|
|
1089
|
-
|
|
1090
|
-
|
|
1556
|
+
minIncomingAssetAmount: cTokenAmount,
|
|
1557
|
+
outgoingAssetAmount: tokenAmount
|
|
1091
1558
|
});
|
|
1092
1559
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1093
1560
|
adapter: compoundAdapter,
|
|
1094
|
-
|
|
1095
|
-
|
|
1561
|
+
encodedCallArgs: lendArgs,
|
|
1562
|
+
selector: protocol.lendSelector
|
|
1096
1563
|
});
|
|
1097
1564
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1098
1565
|
return _context.abrupt("return", lendTx);
|
|
@@ -1115,601 +1582,825 @@ function _compoundRedeem() {
|
|
|
1115
1582
|
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
1116
1583
|
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref2$tokenAmount, tokenAmount, _ref2$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
|
1117
1584
|
|
|
1118
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1585
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1586
|
+
while (1) {
|
|
1587
|
+
switch (_context2.prev = _context2.next) {
|
|
1588
|
+
case 0:
|
|
1589
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, _ref2$tokenAmount = _ref2.tokenAmount, tokenAmount = _ref2$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref2$tokenAmount, _ref2$cTokenAmount = _ref2.cTokenAmount, cTokenAmount = _ref2$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref2$cTokenAmount;
|
|
1590
|
+
redeemArgs = protocol.compoundArgs({
|
|
1591
|
+
cToken: ethers$1.resolveAddress(cToken),
|
|
1592
|
+
minIncomingAssetAmount: tokenAmount,
|
|
1593
|
+
outgoingAssetAmount: cTokenAmount
|
|
1594
|
+
});
|
|
1595
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1596
|
+
adapter: compoundAdapter,
|
|
1597
|
+
encodedCallArgs: redeemArgs,
|
|
1598
|
+
selector: protocol.redeemSelector
|
|
1599
|
+
});
|
|
1600
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1601
|
+
return _context2.abrupt("return", redeemTx);
|
|
1602
|
+
|
|
1603
|
+
case 5:
|
|
1604
|
+
case "end":
|
|
1605
|
+
return _context2.stop();
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}, _callee2);
|
|
1609
|
+
}));
|
|
1610
|
+
return _compoundRedeem.apply(this, arguments);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
|
1614
|
+
var CurveLiquidityGaugeV2 = ethers$1.contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
|
1615
|
+
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
|
|
1616
|
+
|
|
1617
|
+
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"])));
|
|
1618
|
+
var CurveMinter = ethers$1.contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
|
1619
|
+
|
|
1620
|
+
function curveTakeOrder(_x) {
|
|
1621
|
+
return _curveTakeOrder.apply(this, arguments);
|
|
1622
|
+
} // combined liquidity
|
|
1623
|
+
|
|
1624
|
+
function _curveTakeOrder() {
|
|
1625
|
+
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
1626
|
+
var comptrollerProxy, integrationManager, fundOwner, curveExchangeAdapter, pool, outgoingAsset, _ref$outgoingAssetAmo, outgoingAssetAmount, incomingAsset, _ref$minIncomingAsset, minIncomingAssetAmount, takeOrderArgs, callArgs;
|
|
1627
|
+
|
|
1628
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1629
|
+
while (1) {
|
|
1630
|
+
switch (_context.prev = _context.next) {
|
|
1631
|
+
case 0:
|
|
1632
|
+
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;
|
|
1633
|
+
takeOrderArgs = protocol.curveTakeOrderArgs({
|
|
1634
|
+
incomingAsset: incomingAsset,
|
|
1635
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
1636
|
+
outgoingAsset: outgoingAsset,
|
|
1637
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
|
1638
|
+
pool: pool
|
|
1639
|
+
});
|
|
1640
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1641
|
+
adapter: curveExchangeAdapter,
|
|
1642
|
+
encodedCallArgs: takeOrderArgs,
|
|
1643
|
+
selector: protocol.takeOrderSelector
|
|
1644
|
+
});
|
|
1645
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1646
|
+
|
|
1647
|
+
case 4:
|
|
1648
|
+
case "end":
|
|
1649
|
+
return _context.stop();
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
}, _callee);
|
|
1653
|
+
}));
|
|
1654
|
+
return _curveTakeOrder.apply(this, arguments);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
function curveClaimRewards(_ref2) {
|
|
1658
|
+
var comptrollerProxy = _ref2.comptrollerProxy,
|
|
1659
|
+
integrationManager = _ref2.integrationManager,
|
|
1660
|
+
fundOwner = _ref2.fundOwner,
|
|
1661
|
+
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
|
1662
|
+
gaugeToken = _ref2.gaugeToken;
|
|
1663
|
+
var callArgs = protocol.callOnIntegrationArgs({
|
|
1664
|
+
adapter: curveLiquidityAdapter,
|
|
1665
|
+
encodedCallArgs: protocol.curveClaimRewardsArgs({
|
|
1666
|
+
gaugeToken: gaugeToken
|
|
1667
|
+
}),
|
|
1668
|
+
selector: protocol.claimRewardsSelector
|
|
1669
|
+
});
|
|
1670
|
+
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1671
|
+
}
|
|
1672
|
+
function curveLend(_x2) {
|
|
1673
|
+
return _curveLend.apply(this, arguments);
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
function _curveLend() {
|
|
1677
|
+
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref3) {
|
|
1678
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
|
1679
|
+
|
|
1680
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1681
|
+
while (1) {
|
|
1682
|
+
switch (_context2.prev = _context2.next) {
|
|
1683
|
+
case 0:
|
|
1684
|
+
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;
|
|
1685
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1686
|
+
adapter: curveLiquidityAdapter,
|
|
1687
|
+
encodedCallArgs: protocol.curveLendArgs({
|
|
1688
|
+
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
|
1689
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
|
1690
|
+
pool: pool,
|
|
1691
|
+
useUnderlyings: useUnderlyings
|
|
1692
|
+
}),
|
|
1693
|
+
selector: protocol.lendSelector
|
|
1694
|
+
});
|
|
1695
|
+
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1696
|
+
|
|
1697
|
+
case 3:
|
|
1698
|
+
case "end":
|
|
1699
|
+
return _context2.stop();
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}, _callee2);
|
|
1703
|
+
}));
|
|
1704
|
+
return _curveLend.apply(this, arguments);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
function curveLendAndStake(_x3) {
|
|
1708
|
+
return _curveLendAndStake.apply(this, arguments);
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
function _curveLendAndStake() {
|
|
1712
|
+
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref4) {
|
|
1713
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingGaugeToken, _ref4$minIncomingGaug, minIncomingGaugeTokenAmount, useUnderlyings, callArgs;
|
|
1714
|
+
|
|
1715
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
1716
|
+
while (1) {
|
|
1717
|
+
switch (_context3.prev = _context3.next) {
|
|
1718
|
+
case 0:
|
|
1719
|
+
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingGaugeToken = _ref4.incomingGaugeToken, _ref4$minIncomingGaug = _ref4.minIncomingGaugeTokenAmount, minIncomingGaugeTokenAmount = _ref4$minIncomingGaug === void 0 ? ethers.BigNumber.from(1) : _ref4$minIncomingGaug, useUnderlyings = _ref4.useUnderlyings;
|
|
1720
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1721
|
+
adapter: curveLiquidityAdapter,
|
|
1722
|
+
encodedCallArgs: protocol.curveLendAndStakeArgs({
|
|
1723
|
+
incomingGaugeToken: incomingGaugeToken,
|
|
1724
|
+
minIncomingGaugeTokenAmount: minIncomingGaugeTokenAmount,
|
|
1725
|
+
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
|
1726
|
+
pool: pool,
|
|
1727
|
+
useUnderlyings: useUnderlyings
|
|
1728
|
+
}),
|
|
1729
|
+
selector: protocol.lendAndStakeSelector
|
|
1730
|
+
});
|
|
1731
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1732
|
+
|
|
1733
|
+
case 3:
|
|
1734
|
+
case "end":
|
|
1735
|
+
return _context3.stop();
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}, _callee3);
|
|
1739
|
+
}));
|
|
1740
|
+
return _curveLendAndStake.apply(this, arguments);
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
function curveRedeem(_x4) {
|
|
1744
|
+
return _curveRedeem.apply(this, arguments);
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
function _curveRedeem() {
|
|
1748
|
+
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref5) {
|
|
1749
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
|
1750
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
1751
|
+
while (1) {
|
|
1752
|
+
switch (_context4.prev = _context4.next) {
|
|
1753
|
+
case 0:
|
|
1754
|
+
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;
|
|
1755
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1756
|
+
adapter: curveLiquidityAdapter,
|
|
1757
|
+
encodedCallArgs: protocol.curveRedeemArgs({
|
|
1758
|
+
incomingAssetData: incomingAssetData,
|
|
1759
|
+
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
|
1760
|
+
pool: pool,
|
|
1761
|
+
redeemType: redeemType,
|
|
1762
|
+
useUnderlyings: useUnderlyings
|
|
1763
|
+
}),
|
|
1764
|
+
selector: protocol.redeemSelector
|
|
1765
|
+
});
|
|
1766
|
+
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1767
|
+
|
|
1768
|
+
case 3:
|
|
1769
|
+
case "end":
|
|
1770
|
+
return _context4.stop();
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
}, _callee4);
|
|
1774
|
+
}));
|
|
1775
|
+
return _curveRedeem.apply(this, arguments);
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
function curveStake(_x5) {
|
|
1779
|
+
return _curveStake.apply(this, arguments);
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
function _curveStake() {
|
|
1783
|
+
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref6) {
|
|
1784
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingGaugeToken, amount, callArgs;
|
|
1785
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
1786
|
+
while (1) {
|
|
1787
|
+
switch (_context5.prev = _context5.next) {
|
|
1788
|
+
case 0:
|
|
1789
|
+
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingGaugeToken = _ref6.incomingGaugeToken, amount = _ref6.amount;
|
|
1790
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
1791
|
+
adapter: curveLiquidityAdapter,
|
|
1792
|
+
encodedCallArgs: protocol.curveStakeArgs({
|
|
1793
|
+
amount: amount,
|
|
1794
|
+
incomingGaugeToken: incomingGaugeToken,
|
|
1795
|
+
pool: pool
|
|
1796
|
+
}),
|
|
1797
|
+
selector: protocol.stakeSelector
|
|
1798
|
+
});
|
|
1799
|
+
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1800
|
+
|
|
1801
|
+
case 3:
|
|
1802
|
+
case "end":
|
|
1803
|
+
return _context5.stop();
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
}, _callee5);
|
|
1807
|
+
}));
|
|
1808
|
+
return _curveStake.apply(this, arguments);
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
function curveUnstake(_x6) {
|
|
1812
|
+
return _curveUnstake.apply(this, arguments);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
function _curveUnstake() {
|
|
1816
|
+
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref7) {
|
|
1817
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingGaugeToken, amount, callArgs;
|
|
1818
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
1119
1819
|
while (1) {
|
|
1120
|
-
switch (
|
|
1820
|
+
switch (_context6.prev = _context6.next) {
|
|
1121
1821
|
case 0:
|
|
1122
|
-
comptrollerProxy =
|
|
1123
|
-
redeemArgs = protocol.compoundArgs({
|
|
1124
|
-
cToken: ethers$1.resolveAddress(cToken),
|
|
1125
|
-
outgoingAssetAmount: cTokenAmount,
|
|
1126
|
-
minIncomingAssetAmount: tokenAmount
|
|
1127
|
-
});
|
|
1822
|
+
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingGaugeToken = _ref7.outgoingGaugeToken, amount = _ref7.amount;
|
|
1128
1823
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1129
|
-
adapter:
|
|
1130
|
-
|
|
1131
|
-
|
|
1824
|
+
adapter: curveLiquidityAdapter,
|
|
1825
|
+
encodedCallArgs: protocol.curveUnstakeArgs({
|
|
1826
|
+
amount: amount,
|
|
1827
|
+
outgoingGaugeToken: outgoingGaugeToken,
|
|
1828
|
+
pool: pool
|
|
1829
|
+
}),
|
|
1830
|
+
selector: protocol.unstakeSelector
|
|
1132
1831
|
});
|
|
1133
|
-
|
|
1134
|
-
return _context2.abrupt("return", redeemTx);
|
|
1832
|
+
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1135
1833
|
|
|
1136
|
-
case
|
|
1834
|
+
case 3:
|
|
1137
1835
|
case "end":
|
|
1138
|
-
return
|
|
1836
|
+
return _context6.stop();
|
|
1139
1837
|
}
|
|
1140
1838
|
}
|
|
1141
|
-
},
|
|
1839
|
+
}, _callee6);
|
|
1142
1840
|
}));
|
|
1143
|
-
return
|
|
1841
|
+
return _curveUnstake.apply(this, arguments);
|
|
1144
1842
|
}
|
|
1145
1843
|
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
var CurveSwaps = ethers$1.contract()(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
|
1150
|
-
var CurveMinter = ethers$1.contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
|
1151
|
-
|
|
1152
|
-
function curveTakeOrder(_x) {
|
|
1153
|
-
return _curveTakeOrder.apply(this, arguments);
|
|
1844
|
+
function curveUnstakeAndRedeem(_x7) {
|
|
1845
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
|
1154
1846
|
} // aave pool
|
|
1155
1847
|
|
|
1156
|
-
function
|
|
1157
|
-
|
|
1158
|
-
var comptrollerProxy, integrationManager,
|
|
1159
|
-
|
|
1160
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1848
|
+
function _curveUnstakeAndRedeem() {
|
|
1849
|
+
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(_ref8) {
|
|
1850
|
+
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingGaugeToken, outgoingGaugeTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
|
1851
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
1161
1852
|
while (1) {
|
|
1162
|
-
switch (
|
|
1853
|
+
switch (_context7.prev = _context7.next) {
|
|
1163
1854
|
case 0:
|
|
1164
|
-
comptrollerProxy =
|
|
1165
|
-
takeOrderArgs = protocol.curveTakeOrderArgs({
|
|
1166
|
-
pool: pool,
|
|
1167
|
-
outgoingAsset: outgoingAsset,
|
|
1168
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
|
1169
|
-
incomingAsset: incomingAsset,
|
|
1170
|
-
minIncomingAssetAmount: minIncomingAssetAmount
|
|
1171
|
-
});
|
|
1855
|
+
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingGaugeToken = _ref8.outgoingGaugeToken, outgoingGaugeTokenAmount = _ref8.outgoingGaugeTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
|
1172
1856
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1173
|
-
adapter:
|
|
1174
|
-
|
|
1175
|
-
|
|
1857
|
+
adapter: curveLiquidityAdapter,
|
|
1858
|
+
encodedCallArgs: protocol.curveUnstakeAndRedeemArgs({
|
|
1859
|
+
incomingAssetData: incomingAssetData,
|
|
1860
|
+
outgoingGaugeToken: outgoingGaugeToken,
|
|
1861
|
+
outgoingGaugeTokenAmount: outgoingGaugeTokenAmount,
|
|
1862
|
+
pool: pool,
|
|
1863
|
+
redeemType: redeemType,
|
|
1864
|
+
useUnderlyings: useUnderlyings
|
|
1865
|
+
}),
|
|
1866
|
+
selector: protocol.unstakeAndRedeemSelector
|
|
1176
1867
|
});
|
|
1177
|
-
return
|
|
1868
|
+
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1178
1869
|
|
|
1179
|
-
case
|
|
1870
|
+
case 3:
|
|
1180
1871
|
case "end":
|
|
1181
|
-
return
|
|
1872
|
+
return _context7.stop();
|
|
1182
1873
|
}
|
|
1183
1874
|
}
|
|
1184
|
-
},
|
|
1875
|
+
}, _callee7);
|
|
1185
1876
|
}));
|
|
1186
|
-
return
|
|
1877
|
+
return _curveUnstakeAndRedeem.apply(this, arguments);
|
|
1187
1878
|
}
|
|
1188
1879
|
|
|
1189
|
-
function curveAaveClaimRewards(
|
|
1190
|
-
var comptrollerProxy =
|
|
1191
|
-
integrationManager =
|
|
1192
|
-
fundOwner =
|
|
1193
|
-
curveLiquidityAaveAdapter =
|
|
1880
|
+
function curveAaveClaimRewards(_ref9) {
|
|
1881
|
+
var comptrollerProxy = _ref9.comptrollerProxy,
|
|
1882
|
+
integrationManager = _ref9.integrationManager,
|
|
1883
|
+
fundOwner = _ref9.fundOwner,
|
|
1884
|
+
curveLiquidityAaveAdapter = _ref9.curveLiquidityAaveAdapter;
|
|
1194
1885
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1195
1886
|
adapter: curveLiquidityAaveAdapter,
|
|
1196
|
-
|
|
1197
|
-
|
|
1887
|
+
encodedCallArgs: ethers.constants.HashZero,
|
|
1888
|
+
selector: protocol.claimRewardsSelector
|
|
1198
1889
|
});
|
|
1199
1890
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1200
1891
|
}
|
|
1201
|
-
function curveAaveLend(
|
|
1202
|
-
var comptrollerProxy =
|
|
1203
|
-
integrationManager =
|
|
1204
|
-
fundOwner =
|
|
1205
|
-
curveLiquidityAaveAdapter =
|
|
1206
|
-
|
|
1207
|
-
outgoingAaveDaiAmount =
|
|
1208
|
-
|
|
1209
|
-
outgoingAaveUsdcAmount =
|
|
1210
|
-
|
|
1211
|
-
outgoingAaveUsdtAmount =
|
|
1212
|
-
|
|
1213
|
-
minIncomingLPTokenAmount =
|
|
1214
|
-
|
|
1215
|
-
useUnderlyings =
|
|
1892
|
+
function curveAaveLend(_ref10) {
|
|
1893
|
+
var comptrollerProxy = _ref10.comptrollerProxy,
|
|
1894
|
+
integrationManager = _ref10.integrationManager,
|
|
1895
|
+
fundOwner = _ref10.fundOwner,
|
|
1896
|
+
curveLiquidityAaveAdapter = _ref10.curveLiquidityAaveAdapter,
|
|
1897
|
+
_ref10$outgoingAaveDa = _ref10.outgoingAaveDaiAmount,
|
|
1898
|
+
outgoingAaveDaiAmount = _ref10$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveDa,
|
|
1899
|
+
_ref10$outgoingAaveUs = _ref10.outgoingAaveUsdcAmount,
|
|
1900
|
+
outgoingAaveUsdcAmount = _ref10$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs,
|
|
1901
|
+
_ref10$outgoingAaveUs2 = _ref10.outgoingAaveUsdtAmount,
|
|
1902
|
+
outgoingAaveUsdtAmount = _ref10$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs2,
|
|
1903
|
+
_ref10$minIncomingLPT = _ref10.minIncomingLPTokenAmount,
|
|
1904
|
+
minIncomingLPTokenAmount = _ref10$minIncomingLPT === void 0 ? ethers.BigNumber.from(1) : _ref10$minIncomingLPT,
|
|
1905
|
+
_ref10$useUnderlyings = _ref10.useUnderlyings,
|
|
1906
|
+
useUnderlyings = _ref10$useUnderlyings === void 0 ? false : _ref10$useUnderlyings;
|
|
1216
1907
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1217
1908
|
adapter: curveLiquidityAaveAdapter,
|
|
1218
|
-
selector: protocol.lendSelector,
|
|
1219
1909
|
encodedCallArgs: protocol.curveAaveLendArgs({
|
|
1910
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1220
1911
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
|
1221
1912
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
|
1222
1913
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
|
1223
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1224
1914
|
useUnderlyings: useUnderlyings
|
|
1225
|
-
})
|
|
1915
|
+
}),
|
|
1916
|
+
selector: protocol.lendSelector
|
|
1226
1917
|
});
|
|
1227
1918
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1228
1919
|
}
|
|
1229
|
-
function curveAaveLendAndStake(
|
|
1230
|
-
var comptrollerProxy =
|
|
1231
|
-
integrationManager =
|
|
1232
|
-
fundOwner =
|
|
1233
|
-
curveLiquidityAaveAdapter =
|
|
1234
|
-
|
|
1235
|
-
outgoingAaveDaiAmount =
|
|
1236
|
-
|
|
1237
|
-
outgoingAaveUsdcAmount =
|
|
1238
|
-
|
|
1239
|
-
outgoingAaveUsdtAmount =
|
|
1240
|
-
|
|
1241
|
-
minIncomingLiquidityGaugeTokenAmount =
|
|
1242
|
-
|
|
1243
|
-
useUnderlyings =
|
|
1920
|
+
function curveAaveLendAndStake(_ref11) {
|
|
1921
|
+
var comptrollerProxy = _ref11.comptrollerProxy,
|
|
1922
|
+
integrationManager = _ref11.integrationManager,
|
|
1923
|
+
fundOwner = _ref11.fundOwner,
|
|
1924
|
+
curveLiquidityAaveAdapter = _ref11.curveLiquidityAaveAdapter,
|
|
1925
|
+
_ref11$outgoingAaveDa = _ref11.outgoingAaveDaiAmount,
|
|
1926
|
+
outgoingAaveDaiAmount = _ref11$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveDa,
|
|
1927
|
+
_ref11$outgoingAaveUs = _ref11.outgoingAaveUsdcAmount,
|
|
1928
|
+
outgoingAaveUsdcAmount = _ref11$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs,
|
|
1929
|
+
_ref11$outgoingAaveUs2 = _ref11.outgoingAaveUsdtAmount,
|
|
1930
|
+
outgoingAaveUsdtAmount = _ref11$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs2,
|
|
1931
|
+
_ref11$minIncomingLiq = _ref11.minIncomingLiquidityGaugeTokenAmount,
|
|
1932
|
+
minIncomingLiquidityGaugeTokenAmount = _ref11$minIncomingLiq === void 0 ? ethers.BigNumber.from(1) : _ref11$minIncomingLiq,
|
|
1933
|
+
_ref11$useUnderlyings = _ref11.useUnderlyings,
|
|
1934
|
+
useUnderlyings = _ref11$useUnderlyings === void 0 ? false : _ref11$useUnderlyings;
|
|
1244
1935
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1245
1936
|
adapter: curveLiquidityAaveAdapter,
|
|
1246
|
-
selector: protocol.lendAndStakeSelector,
|
|
1247
1937
|
encodedCallArgs: protocol.curveAaveLendAndStakeArgs({
|
|
1938
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1248
1939
|
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
|
1249
1940
|
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
|
1250
1941
|
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
|
1251
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1252
1942
|
useUnderlyings: useUnderlyings
|
|
1253
|
-
})
|
|
1943
|
+
}),
|
|
1944
|
+
selector: protocol.lendAndStakeSelector
|
|
1254
1945
|
});
|
|
1255
1946
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1256
1947
|
}
|
|
1257
|
-
function curveAaveRedeem(
|
|
1258
|
-
var comptrollerProxy =
|
|
1259
|
-
integrationManager =
|
|
1260
|
-
fundOwner =
|
|
1261
|
-
curveLiquidityAaveAdapter =
|
|
1262
|
-
outgoingLPTokenAmount =
|
|
1263
|
-
|
|
1264
|
-
minIncomingAaveDaiAmount =
|
|
1265
|
-
|
|
1266
|
-
minIncomingAaveUsdcAmount =
|
|
1267
|
-
|
|
1268
|
-
minIncomingAaveUsdtAmount =
|
|
1269
|
-
|
|
1270
|
-
receiveSingleAsset =
|
|
1271
|
-
|
|
1272
|
-
useUnderlyings =
|
|
1948
|
+
function curveAaveRedeem(_ref12) {
|
|
1949
|
+
var comptrollerProxy = _ref12.comptrollerProxy,
|
|
1950
|
+
integrationManager = _ref12.integrationManager,
|
|
1951
|
+
fundOwner = _ref12.fundOwner,
|
|
1952
|
+
curveLiquidityAaveAdapter = _ref12.curveLiquidityAaveAdapter,
|
|
1953
|
+
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
|
1954
|
+
_ref12$minIncomingAav = _ref12.minIncomingAaveDaiAmount,
|
|
1955
|
+
minIncomingAaveDaiAmount = _ref12$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav,
|
|
1956
|
+
_ref12$minIncomingAav2 = _ref12.minIncomingAaveUsdcAmount,
|
|
1957
|
+
minIncomingAaveUsdcAmount = _ref12$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav2,
|
|
1958
|
+
_ref12$minIncomingAav3 = _ref12.minIncomingAaveUsdtAmount,
|
|
1959
|
+
minIncomingAaveUsdtAmount = _ref12$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav3,
|
|
1960
|
+
_ref12$receiveSingleA = _ref12.receiveSingleAsset,
|
|
1961
|
+
receiveSingleAsset = _ref12$receiveSingleA === void 0 ? false : _ref12$receiveSingleA,
|
|
1962
|
+
_ref12$useUnderlyings = _ref12.useUnderlyings,
|
|
1963
|
+
useUnderlyings = _ref12$useUnderlyings === void 0 ? false : _ref12$useUnderlyings;
|
|
1273
1964
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1274
1965
|
adapter: curveLiquidityAaveAdapter,
|
|
1275
|
-
selector: protocol.redeemSelector,
|
|
1276
1966
|
encodedCallArgs: protocol.curveAaveRedeemArgs({
|
|
1277
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1278
1967
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
1279
1968
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
1280
1969
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
1970
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1281
1971
|
receiveSingleAsset: receiveSingleAsset,
|
|
1282
1972
|
useUnderlyings: useUnderlyings
|
|
1283
|
-
})
|
|
1973
|
+
}),
|
|
1974
|
+
selector: protocol.redeemSelector
|
|
1284
1975
|
});
|
|
1285
1976
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1286
1977
|
}
|
|
1287
|
-
function curveAaveStake(
|
|
1288
|
-
var comptrollerProxy =
|
|
1289
|
-
integrationManager =
|
|
1290
|
-
fundOwner =
|
|
1291
|
-
curveLiquidityAaveAdapter =
|
|
1292
|
-
outgoingLPTokenAmount =
|
|
1978
|
+
function curveAaveStake(_ref13) {
|
|
1979
|
+
var comptrollerProxy = _ref13.comptrollerProxy,
|
|
1980
|
+
integrationManager = _ref13.integrationManager,
|
|
1981
|
+
fundOwner = _ref13.fundOwner,
|
|
1982
|
+
curveLiquidityAaveAdapter = _ref13.curveLiquidityAaveAdapter,
|
|
1983
|
+
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
|
1293
1984
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1294
1985
|
adapter: curveLiquidityAaveAdapter,
|
|
1295
|
-
selector: protocol.stakeSelector,
|
|
1296
1986
|
encodedCallArgs: protocol.curveAaveStakeArgs({
|
|
1297
1987
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1298
|
-
})
|
|
1988
|
+
}),
|
|
1989
|
+
selector: protocol.stakeSelector
|
|
1299
1990
|
});
|
|
1300
1991
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1301
1992
|
}
|
|
1302
|
-
function curveAaveUnstakeAndRedeem(
|
|
1303
|
-
var comptrollerProxy =
|
|
1304
|
-
integrationManager =
|
|
1305
|
-
fundOwner =
|
|
1306
|
-
curveLiquidityAaveAdapter =
|
|
1307
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
1308
|
-
|
|
1309
|
-
minIncomingAaveDaiAmount =
|
|
1310
|
-
|
|
1311
|
-
minIncomingAaveUsdcAmount =
|
|
1312
|
-
|
|
1313
|
-
minIncomingAaveUsdtAmount =
|
|
1314
|
-
|
|
1315
|
-
receiveSingleAsset =
|
|
1316
|
-
|
|
1317
|
-
useUnderlyings =
|
|
1993
|
+
function curveAaveUnstakeAndRedeem(_ref14) {
|
|
1994
|
+
var comptrollerProxy = _ref14.comptrollerProxy,
|
|
1995
|
+
integrationManager = _ref14.integrationManager,
|
|
1996
|
+
fundOwner = _ref14.fundOwner,
|
|
1997
|
+
curveLiquidityAaveAdapter = _ref14.curveLiquidityAaveAdapter,
|
|
1998
|
+
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
|
1999
|
+
_ref14$minIncomingAav = _ref14.minIncomingAaveDaiAmount,
|
|
2000
|
+
minIncomingAaveDaiAmount = _ref14$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav,
|
|
2001
|
+
_ref14$minIncomingAav2 = _ref14.minIncomingAaveUsdcAmount,
|
|
2002
|
+
minIncomingAaveUsdcAmount = _ref14$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav2,
|
|
2003
|
+
_ref14$minIncomingAav3 = _ref14.minIncomingAaveUsdtAmount,
|
|
2004
|
+
minIncomingAaveUsdtAmount = _ref14$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav3,
|
|
2005
|
+
_ref14$receiveSingleA = _ref14.receiveSingleAsset,
|
|
2006
|
+
receiveSingleAsset = _ref14$receiveSingleA === void 0 ? false : _ref14$receiveSingleA,
|
|
2007
|
+
_ref14$useUnderlyings = _ref14.useUnderlyings,
|
|
2008
|
+
useUnderlyings = _ref14$useUnderlyings === void 0 ? false : _ref14$useUnderlyings;
|
|
1318
2009
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1319
2010
|
adapter: curveLiquidityAaveAdapter,
|
|
1320
|
-
selector: protocol.unstakeAndRedeemSelector,
|
|
1321
2011
|
encodedCallArgs: protocol.curveAaveUnstakeAndRedeemArgs({
|
|
1322
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1323
2012
|
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
|
1324
2013
|
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
|
1325
2014
|
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
|
2015
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1326
2016
|
receiveSingleAsset: receiveSingleAsset,
|
|
1327
2017
|
useUnderlyings: useUnderlyings
|
|
1328
|
-
})
|
|
2018
|
+
}),
|
|
2019
|
+
selector: protocol.unstakeAndRedeemSelector
|
|
1329
2020
|
});
|
|
1330
2021
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1331
2022
|
}
|
|
1332
|
-
function curveAaveUnstake(
|
|
1333
|
-
var comptrollerProxy =
|
|
1334
|
-
integrationManager =
|
|
1335
|
-
fundOwner =
|
|
1336
|
-
curveLiquidityAaveAdapter =
|
|
1337
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
2023
|
+
function curveAaveUnstake(_ref15) {
|
|
2024
|
+
var comptrollerProxy = _ref15.comptrollerProxy,
|
|
2025
|
+
integrationManager = _ref15.integrationManager,
|
|
2026
|
+
fundOwner = _ref15.fundOwner,
|
|
2027
|
+
curveLiquidityAaveAdapter = _ref15.curveLiquidityAaveAdapter,
|
|
2028
|
+
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
|
1338
2029
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1339
2030
|
adapter: curveLiquidityAaveAdapter,
|
|
1340
|
-
selector: protocol.unstakeSelector,
|
|
1341
2031
|
encodedCallArgs: protocol.curveAaveUnstakeArgs({
|
|
1342
2032
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1343
|
-
})
|
|
2033
|
+
}),
|
|
2034
|
+
selector: protocol.unstakeSelector
|
|
1344
2035
|
});
|
|
1345
2036
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1346
2037
|
} // eurs pool
|
|
1347
2038
|
|
|
1348
|
-
function curveEursClaimRewards(
|
|
1349
|
-
var comptrollerProxy =
|
|
1350
|
-
integrationManager =
|
|
1351
|
-
fundOwner =
|
|
1352
|
-
curveLiquidityEursAdapter =
|
|
2039
|
+
function curveEursClaimRewards(_ref16) {
|
|
2040
|
+
var comptrollerProxy = _ref16.comptrollerProxy,
|
|
2041
|
+
integrationManager = _ref16.integrationManager,
|
|
2042
|
+
fundOwner = _ref16.fundOwner,
|
|
2043
|
+
curveLiquidityEursAdapter = _ref16.curveLiquidityEursAdapter;
|
|
1353
2044
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1354
2045
|
adapter: curveLiquidityEursAdapter,
|
|
1355
|
-
|
|
1356
|
-
|
|
2046
|
+
encodedCallArgs: ethers.constants.HashZero,
|
|
2047
|
+
selector: protocol.claimRewardsSelector
|
|
1357
2048
|
});
|
|
1358
2049
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1359
2050
|
}
|
|
1360
|
-
function curveEursLend(
|
|
1361
|
-
var comptrollerProxy =
|
|
1362
|
-
integrationManager =
|
|
1363
|
-
fundOwner =
|
|
1364
|
-
curveLiquidityEursAdapter =
|
|
1365
|
-
outgoingEursAmount =
|
|
1366
|
-
outgoingSeurAmount =
|
|
1367
|
-
minIncomingLPTokenAmount =
|
|
2051
|
+
function curveEursLend(_ref17) {
|
|
2052
|
+
var comptrollerProxy = _ref17.comptrollerProxy,
|
|
2053
|
+
integrationManager = _ref17.integrationManager,
|
|
2054
|
+
fundOwner = _ref17.fundOwner,
|
|
2055
|
+
curveLiquidityEursAdapter = _ref17.curveLiquidityEursAdapter,
|
|
2056
|
+
outgoingEursAmount = _ref17.outgoingEursAmount,
|
|
2057
|
+
outgoingSeurAmount = _ref17.outgoingSeurAmount,
|
|
2058
|
+
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
|
1368
2059
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1369
2060
|
adapter: curveLiquidityEursAdapter,
|
|
1370
|
-
selector: protocol.lendSelector,
|
|
1371
2061
|
encodedCallArgs: protocol.curveEursLendArgs({
|
|
2062
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1372
2063
|
outgoingEursAmount: outgoingEursAmount,
|
|
1373
|
-
outgoingSeurAmount: outgoingSeurAmount
|
|
1374
|
-
|
|
1375
|
-
|
|
2064
|
+
outgoingSeurAmount: outgoingSeurAmount
|
|
2065
|
+
}),
|
|
2066
|
+
selector: protocol.lendSelector
|
|
1376
2067
|
});
|
|
1377
2068
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1378
2069
|
}
|
|
1379
|
-
function curveEursLendAndStake(
|
|
1380
|
-
var comptrollerProxy =
|
|
1381
|
-
integrationManager =
|
|
1382
|
-
fundOwner =
|
|
1383
|
-
curveLiquidityEursAdapter =
|
|
1384
|
-
outgoingEursAmount =
|
|
1385
|
-
outgoingSeurAmount =
|
|
1386
|
-
minIncomingLiquidityGaugeTokenAmount =
|
|
2070
|
+
function curveEursLendAndStake(_ref18) {
|
|
2071
|
+
var comptrollerProxy = _ref18.comptrollerProxy,
|
|
2072
|
+
integrationManager = _ref18.integrationManager,
|
|
2073
|
+
fundOwner = _ref18.fundOwner,
|
|
2074
|
+
curveLiquidityEursAdapter = _ref18.curveLiquidityEursAdapter,
|
|
2075
|
+
outgoingEursAmount = _ref18.outgoingEursAmount,
|
|
2076
|
+
outgoingSeurAmount = _ref18.outgoingSeurAmount,
|
|
2077
|
+
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
|
1387
2078
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1388
2079
|
adapter: curveLiquidityEursAdapter,
|
|
1389
|
-
selector: protocol.lendAndStakeSelector,
|
|
1390
2080
|
encodedCallArgs: protocol.curveEursLendAndStakeArgs({
|
|
2081
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1391
2082
|
outgoingEursAmount: outgoingEursAmount,
|
|
1392
|
-
outgoingSeurAmount: outgoingSeurAmount
|
|
1393
|
-
|
|
1394
|
-
|
|
2083
|
+
outgoingSeurAmount: outgoingSeurAmount
|
|
2084
|
+
}),
|
|
2085
|
+
selector: protocol.lendAndStakeSelector
|
|
1395
2086
|
});
|
|
1396
2087
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1397
2088
|
}
|
|
1398
|
-
function curveEursRedeem(
|
|
1399
|
-
var comptrollerProxy =
|
|
1400
|
-
integrationManager =
|
|
1401
|
-
fundOwner =
|
|
1402
|
-
curveLiquidityEursAdapter =
|
|
1403
|
-
outgoingLPTokenAmount =
|
|
1404
|
-
minIncomingEursAmount =
|
|
1405
|
-
minIncomingSeurAmount =
|
|
1406
|
-
receiveSingleAsset =
|
|
2089
|
+
function curveEursRedeem(_ref19) {
|
|
2090
|
+
var comptrollerProxy = _ref19.comptrollerProxy,
|
|
2091
|
+
integrationManager = _ref19.integrationManager,
|
|
2092
|
+
fundOwner = _ref19.fundOwner,
|
|
2093
|
+
curveLiquidityEursAdapter = _ref19.curveLiquidityEursAdapter,
|
|
2094
|
+
outgoingLPTokenAmount = _ref19.outgoingLPTokenAmount,
|
|
2095
|
+
minIncomingEursAmount = _ref19.minIncomingEursAmount,
|
|
2096
|
+
minIncomingSeurAmount = _ref19.minIncomingSeurAmount,
|
|
2097
|
+
receiveSingleAsset = _ref19.receiveSingleAsset;
|
|
1407
2098
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1408
2099
|
adapter: curveLiquidityEursAdapter,
|
|
1409
|
-
selector: protocol.redeemSelector,
|
|
1410
2100
|
encodedCallArgs: protocol.curveEursRedeemArgs({
|
|
1411
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1412
2101
|
minIncomingEursAmount: minIncomingEursAmount,
|
|
1413
2102
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
|
2103
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1414
2104
|
receiveSingleAsset: receiveSingleAsset
|
|
1415
|
-
})
|
|
2105
|
+
}),
|
|
2106
|
+
selector: protocol.redeemSelector
|
|
1416
2107
|
});
|
|
1417
2108
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1418
2109
|
}
|
|
1419
|
-
function curveEursStake(
|
|
1420
|
-
var comptrollerProxy =
|
|
1421
|
-
integrationManager =
|
|
1422
|
-
fundOwner =
|
|
1423
|
-
curveLiquidityEursAdapter =
|
|
1424
|
-
outgoingLPTokenAmount =
|
|
2110
|
+
function curveEursStake(_ref20) {
|
|
2111
|
+
var comptrollerProxy = _ref20.comptrollerProxy,
|
|
2112
|
+
integrationManager = _ref20.integrationManager,
|
|
2113
|
+
fundOwner = _ref20.fundOwner,
|
|
2114
|
+
curveLiquidityEursAdapter = _ref20.curveLiquidityEursAdapter,
|
|
2115
|
+
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
|
1425
2116
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1426
2117
|
adapter: curveLiquidityEursAdapter,
|
|
1427
|
-
selector: protocol.stakeSelector,
|
|
1428
2118
|
encodedCallArgs: protocol.curveEursStakeArgs({
|
|
1429
2119
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1430
|
-
})
|
|
2120
|
+
}),
|
|
2121
|
+
selector: protocol.stakeSelector
|
|
1431
2122
|
});
|
|
1432
2123
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1433
2124
|
}
|
|
1434
|
-
function curveEursUnstakeAndRedeem(
|
|
1435
|
-
var comptrollerProxy =
|
|
1436
|
-
integrationManager =
|
|
1437
|
-
fundOwner =
|
|
1438
|
-
curveLiquidityEursAdapter =
|
|
1439
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
1440
|
-
minIncomingEursAmount =
|
|
1441
|
-
minIncomingSeurAmount =
|
|
1442
|
-
receiveSingleAsset =
|
|
2125
|
+
function curveEursUnstakeAndRedeem(_ref21) {
|
|
2126
|
+
var comptrollerProxy = _ref21.comptrollerProxy,
|
|
2127
|
+
integrationManager = _ref21.integrationManager,
|
|
2128
|
+
fundOwner = _ref21.fundOwner,
|
|
2129
|
+
curveLiquidityEursAdapter = _ref21.curveLiquidityEursAdapter,
|
|
2130
|
+
outgoingLiquidityGaugeTokenAmount = _ref21.outgoingLiquidityGaugeTokenAmount,
|
|
2131
|
+
minIncomingEursAmount = _ref21.minIncomingEursAmount,
|
|
2132
|
+
minIncomingSeurAmount = _ref21.minIncomingSeurAmount,
|
|
2133
|
+
receiveSingleAsset = _ref21.receiveSingleAsset;
|
|
1443
2134
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1444
2135
|
adapter: curveLiquidityEursAdapter,
|
|
1445
|
-
selector: protocol.unstakeAndRedeemSelector,
|
|
1446
2136
|
encodedCallArgs: protocol.curveEursUnstakeAndRedeemArgs({
|
|
1447
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1448
2137
|
minIncomingEursAmount: minIncomingEursAmount,
|
|
1449
2138
|
minIncomingSeurAmount: minIncomingSeurAmount,
|
|
2139
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1450
2140
|
receiveSingleAsset: receiveSingleAsset
|
|
1451
|
-
})
|
|
2141
|
+
}),
|
|
2142
|
+
selector: protocol.unstakeAndRedeemSelector
|
|
1452
2143
|
});
|
|
1453
2144
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1454
2145
|
}
|
|
1455
|
-
function curveEursUnstake(
|
|
1456
|
-
var comptrollerProxy =
|
|
1457
|
-
integrationManager =
|
|
1458
|
-
fundOwner =
|
|
1459
|
-
curveLiquidityEursAdapter =
|
|
1460
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
2146
|
+
function curveEursUnstake(_ref22) {
|
|
2147
|
+
var comptrollerProxy = _ref22.comptrollerProxy,
|
|
2148
|
+
integrationManager = _ref22.integrationManager,
|
|
2149
|
+
fundOwner = _ref22.fundOwner,
|
|
2150
|
+
curveLiquidityEursAdapter = _ref22.curveLiquidityEursAdapter,
|
|
2151
|
+
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
|
1461
2152
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1462
2153
|
adapter: curveLiquidityEursAdapter,
|
|
1463
|
-
selector: protocol.unstakeSelector,
|
|
1464
2154
|
encodedCallArgs: protocol.curveEursUnstakeArgs({
|
|
1465
2155
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1466
|
-
})
|
|
2156
|
+
}),
|
|
2157
|
+
selector: protocol.unstakeSelector
|
|
1467
2158
|
});
|
|
1468
2159
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1469
2160
|
} // sETH pool
|
|
1470
2161
|
|
|
1471
|
-
function curveSethClaimRewards(
|
|
1472
|
-
var comptrollerProxy =
|
|
1473
|
-
integrationManager =
|
|
1474
|
-
fundOwner =
|
|
1475
|
-
curveLiquiditySethAdapter =
|
|
2162
|
+
function curveSethClaimRewards(_ref23) {
|
|
2163
|
+
var comptrollerProxy = _ref23.comptrollerProxy,
|
|
2164
|
+
integrationManager = _ref23.integrationManager,
|
|
2165
|
+
fundOwner = _ref23.fundOwner,
|
|
2166
|
+
curveLiquiditySethAdapter = _ref23.curveLiquiditySethAdapter;
|
|
1476
2167
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1477
2168
|
adapter: curveLiquiditySethAdapter,
|
|
1478
|
-
|
|
1479
|
-
|
|
2169
|
+
encodedCallArgs: ethers.constants.HashZero,
|
|
2170
|
+
selector: protocol.claimRewardsSelector
|
|
1480
2171
|
});
|
|
1481
2172
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1482
2173
|
}
|
|
1483
|
-
function curveSethLend(
|
|
1484
|
-
var comptrollerProxy =
|
|
1485
|
-
integrationManager =
|
|
1486
|
-
fundOwner =
|
|
1487
|
-
curveLiquiditySethAdapter =
|
|
1488
|
-
outgoingWethAmount =
|
|
1489
|
-
outgoingSethAmount =
|
|
1490
|
-
minIncomingLPTokenAmount =
|
|
2174
|
+
function curveSethLend(_ref24) {
|
|
2175
|
+
var comptrollerProxy = _ref24.comptrollerProxy,
|
|
2176
|
+
integrationManager = _ref24.integrationManager,
|
|
2177
|
+
fundOwner = _ref24.fundOwner,
|
|
2178
|
+
curveLiquiditySethAdapter = _ref24.curveLiquiditySethAdapter,
|
|
2179
|
+
outgoingWethAmount = _ref24.outgoingWethAmount,
|
|
2180
|
+
outgoingSethAmount = _ref24.outgoingSethAmount,
|
|
2181
|
+
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
|
1491
2182
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1492
2183
|
adapter: curveLiquiditySethAdapter,
|
|
1493
|
-
selector: protocol.lendSelector,
|
|
1494
2184
|
encodedCallArgs: protocol.curveSethLendArgs({
|
|
1495
|
-
|
|
2185
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1496
2186
|
outgoingSethAmount: outgoingSethAmount,
|
|
1497
|
-
|
|
1498
|
-
})
|
|
2187
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2188
|
+
}),
|
|
2189
|
+
selector: protocol.lendSelector
|
|
1499
2190
|
});
|
|
1500
2191
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1501
2192
|
}
|
|
1502
|
-
function curveSethLendAndStake(
|
|
1503
|
-
var comptrollerProxy =
|
|
1504
|
-
integrationManager =
|
|
1505
|
-
fundOwner =
|
|
1506
|
-
curveLiquiditySethAdapter =
|
|
1507
|
-
outgoingWethAmount =
|
|
1508
|
-
outgoingSethAmount =
|
|
1509
|
-
minIncomingLiquidityGaugeTokenAmount =
|
|
2193
|
+
function curveSethLendAndStake(_ref25) {
|
|
2194
|
+
var comptrollerProxy = _ref25.comptrollerProxy,
|
|
2195
|
+
integrationManager = _ref25.integrationManager,
|
|
2196
|
+
fundOwner = _ref25.fundOwner,
|
|
2197
|
+
curveLiquiditySethAdapter = _ref25.curveLiquiditySethAdapter,
|
|
2198
|
+
outgoingWethAmount = _ref25.outgoingWethAmount,
|
|
2199
|
+
outgoingSethAmount = _ref25.outgoingSethAmount,
|
|
2200
|
+
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
|
1510
2201
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1511
2202
|
adapter: curveLiquiditySethAdapter,
|
|
1512
|
-
selector: protocol.lendAndStakeSelector,
|
|
1513
2203
|
encodedCallArgs: protocol.curveSethLendAndStakeArgs({
|
|
1514
|
-
|
|
2204
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1515
2205
|
outgoingSethAmount: outgoingSethAmount,
|
|
1516
|
-
|
|
1517
|
-
})
|
|
2206
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2207
|
+
}),
|
|
2208
|
+
selector: protocol.lendAndStakeSelector
|
|
1518
2209
|
});
|
|
1519
2210
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1520
2211
|
}
|
|
1521
|
-
function curveSethRedeem(
|
|
1522
|
-
var comptrollerProxy =
|
|
1523
|
-
integrationManager =
|
|
1524
|
-
fundOwner =
|
|
1525
|
-
curveLiquiditySethAdapter =
|
|
1526
|
-
outgoingLPTokenAmount =
|
|
1527
|
-
minIncomingWethAmount =
|
|
1528
|
-
minIncomingSethAmount =
|
|
1529
|
-
receiveSingleAsset =
|
|
2212
|
+
function curveSethRedeem(_ref26) {
|
|
2213
|
+
var comptrollerProxy = _ref26.comptrollerProxy,
|
|
2214
|
+
integrationManager = _ref26.integrationManager,
|
|
2215
|
+
fundOwner = _ref26.fundOwner,
|
|
2216
|
+
curveLiquiditySethAdapter = _ref26.curveLiquiditySethAdapter,
|
|
2217
|
+
outgoingLPTokenAmount = _ref26.outgoingLPTokenAmount,
|
|
2218
|
+
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
|
2219
|
+
minIncomingSethAmount = _ref26.minIncomingSethAmount,
|
|
2220
|
+
receiveSingleAsset = _ref26.receiveSingleAsset;
|
|
1530
2221
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1531
2222
|
adapter: curveLiquiditySethAdapter,
|
|
1532
|
-
selector: protocol.redeemSelector,
|
|
1533
2223
|
encodedCallArgs: protocol.curveSethRedeemArgs({
|
|
1534
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1535
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1536
2224
|
minIncomingSethAmount: minIncomingSethAmount,
|
|
2225
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2226
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1537
2227
|
receiveSingleAsset: receiveSingleAsset
|
|
1538
|
-
})
|
|
2228
|
+
}),
|
|
2229
|
+
selector: protocol.redeemSelector
|
|
1539
2230
|
});
|
|
1540
2231
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1541
2232
|
}
|
|
1542
|
-
function curveSethStake(
|
|
1543
|
-
var comptrollerProxy =
|
|
1544
|
-
integrationManager =
|
|
1545
|
-
fundOwner =
|
|
1546
|
-
curveLiquiditySethAdapter =
|
|
1547
|
-
outgoingLPTokenAmount =
|
|
2233
|
+
function curveSethStake(_ref27) {
|
|
2234
|
+
var comptrollerProxy = _ref27.comptrollerProxy,
|
|
2235
|
+
integrationManager = _ref27.integrationManager,
|
|
2236
|
+
fundOwner = _ref27.fundOwner,
|
|
2237
|
+
curveLiquiditySethAdapter = _ref27.curveLiquiditySethAdapter,
|
|
2238
|
+
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
|
1548
2239
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1549
2240
|
adapter: curveLiquiditySethAdapter,
|
|
1550
|
-
selector: protocol.stakeSelector,
|
|
1551
2241
|
encodedCallArgs: protocol.curveSethStakeArgs({
|
|
1552
2242
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1553
|
-
})
|
|
2243
|
+
}),
|
|
2244
|
+
selector: protocol.stakeSelector
|
|
1554
2245
|
});
|
|
1555
2246
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1556
2247
|
}
|
|
1557
|
-
function curveSethUnstakeAndRedeem(
|
|
1558
|
-
var comptrollerProxy =
|
|
1559
|
-
integrationManager =
|
|
1560
|
-
fundOwner =
|
|
1561
|
-
curveLiquiditySethAdapter =
|
|
1562
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
1563
|
-
minIncomingWethAmount =
|
|
1564
|
-
minIncomingSethAmount =
|
|
1565
|
-
receiveSingleAsset =
|
|
2248
|
+
function curveSethUnstakeAndRedeem(_ref28) {
|
|
2249
|
+
var comptrollerProxy = _ref28.comptrollerProxy,
|
|
2250
|
+
integrationManager = _ref28.integrationManager,
|
|
2251
|
+
fundOwner = _ref28.fundOwner,
|
|
2252
|
+
curveLiquiditySethAdapter = _ref28.curveLiquiditySethAdapter,
|
|
2253
|
+
outgoingLiquidityGaugeTokenAmount = _ref28.outgoingLiquidityGaugeTokenAmount,
|
|
2254
|
+
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
|
2255
|
+
minIncomingSethAmount = _ref28.minIncomingSethAmount,
|
|
2256
|
+
receiveSingleAsset = _ref28.receiveSingleAsset;
|
|
1566
2257
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1567
2258
|
adapter: curveLiquiditySethAdapter,
|
|
1568
|
-
selector: protocol.unstakeAndRedeemSelector,
|
|
1569
2259
|
encodedCallArgs: protocol.curveSethUnstakeAndRedeemArgs({
|
|
1570
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1571
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1572
2260
|
minIncomingSethAmount: minIncomingSethAmount,
|
|
2261
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2262
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1573
2263
|
receiveSingleAsset: receiveSingleAsset
|
|
1574
|
-
})
|
|
2264
|
+
}),
|
|
2265
|
+
selector: protocol.unstakeAndRedeemSelector
|
|
1575
2266
|
});
|
|
1576
2267
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1577
2268
|
}
|
|
1578
|
-
function curveSethUnstake(
|
|
1579
|
-
var comptrollerProxy =
|
|
1580
|
-
integrationManager =
|
|
1581
|
-
fundOwner =
|
|
1582
|
-
curveLiquiditySethAdapter =
|
|
1583
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
2269
|
+
function curveSethUnstake(_ref29) {
|
|
2270
|
+
var comptrollerProxy = _ref29.comptrollerProxy,
|
|
2271
|
+
integrationManager = _ref29.integrationManager,
|
|
2272
|
+
fundOwner = _ref29.fundOwner,
|
|
2273
|
+
curveLiquiditySethAdapter = _ref29.curveLiquiditySethAdapter,
|
|
2274
|
+
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
|
1584
2275
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1585
2276
|
adapter: curveLiquiditySethAdapter,
|
|
1586
|
-
selector: protocol.unstakeSelector,
|
|
1587
2277
|
encodedCallArgs: protocol.curveSethUnstakeArgs({
|
|
1588
2278
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1589
|
-
})
|
|
2279
|
+
}),
|
|
2280
|
+
selector: protocol.unstakeSelector
|
|
1590
2281
|
});
|
|
1591
2282
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1592
2283
|
} // stETH pool
|
|
1593
2284
|
|
|
1594
|
-
function curveStethClaimRewards(
|
|
1595
|
-
var comptrollerProxy =
|
|
1596
|
-
integrationManager =
|
|
1597
|
-
fundOwner =
|
|
1598
|
-
curveLiquidityStethAdapter =
|
|
2285
|
+
function curveStethClaimRewards(_ref30) {
|
|
2286
|
+
var comptrollerProxy = _ref30.comptrollerProxy,
|
|
2287
|
+
integrationManager = _ref30.integrationManager,
|
|
2288
|
+
fundOwner = _ref30.fundOwner,
|
|
2289
|
+
curveLiquidityStethAdapter = _ref30.curveLiquidityStethAdapter;
|
|
1599
2290
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1600
2291
|
adapter: curveLiquidityStethAdapter,
|
|
1601
|
-
|
|
1602
|
-
|
|
2292
|
+
encodedCallArgs: ethers.constants.HashZero,
|
|
2293
|
+
selector: protocol.claimRewardsSelector
|
|
1603
2294
|
});
|
|
1604
2295
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1605
2296
|
}
|
|
1606
|
-
function curveStethLend(
|
|
1607
|
-
var comptrollerProxy =
|
|
1608
|
-
integrationManager =
|
|
1609
|
-
fundOwner =
|
|
1610
|
-
curveLiquidityStethAdapter =
|
|
1611
|
-
outgoingWethAmount =
|
|
1612
|
-
outgoingStethAmount =
|
|
1613
|
-
minIncomingLPTokenAmount =
|
|
2297
|
+
function curveStethLend(_ref31) {
|
|
2298
|
+
var comptrollerProxy = _ref31.comptrollerProxy,
|
|
2299
|
+
integrationManager = _ref31.integrationManager,
|
|
2300
|
+
fundOwner = _ref31.fundOwner,
|
|
2301
|
+
curveLiquidityStethAdapter = _ref31.curveLiquidityStethAdapter,
|
|
2302
|
+
outgoingWethAmount = _ref31.outgoingWethAmount,
|
|
2303
|
+
outgoingStethAmount = _ref31.outgoingStethAmount,
|
|
2304
|
+
minIncomingLPTokenAmount = _ref31.minIncomingLPTokenAmount;
|
|
1614
2305
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1615
2306
|
adapter: curveLiquidityStethAdapter,
|
|
1616
|
-
selector: protocol.lendSelector,
|
|
1617
2307
|
encodedCallArgs: protocol.curveStethLendArgs({
|
|
1618
|
-
|
|
2308
|
+
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
|
1619
2309
|
outgoingStethAmount: outgoingStethAmount,
|
|
1620
|
-
|
|
1621
|
-
})
|
|
2310
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2311
|
+
}),
|
|
2312
|
+
selector: protocol.lendSelector
|
|
1622
2313
|
});
|
|
1623
2314
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1624
2315
|
}
|
|
1625
|
-
function curveStethLendAndStake(
|
|
1626
|
-
var comptrollerProxy =
|
|
1627
|
-
integrationManager =
|
|
1628
|
-
fundOwner =
|
|
1629
|
-
curveLiquidityStethAdapter =
|
|
1630
|
-
outgoingWethAmount =
|
|
1631
|
-
outgoingStethAmount =
|
|
1632
|
-
minIncomingLiquidityGaugeTokenAmount =
|
|
2316
|
+
function curveStethLendAndStake(_ref32) {
|
|
2317
|
+
var comptrollerProxy = _ref32.comptrollerProxy,
|
|
2318
|
+
integrationManager = _ref32.integrationManager,
|
|
2319
|
+
fundOwner = _ref32.fundOwner,
|
|
2320
|
+
curveLiquidityStethAdapter = _ref32.curveLiquidityStethAdapter,
|
|
2321
|
+
outgoingWethAmount = _ref32.outgoingWethAmount,
|
|
2322
|
+
outgoingStethAmount = _ref32.outgoingStethAmount,
|
|
2323
|
+
minIncomingLiquidityGaugeTokenAmount = _ref32.minIncomingLiquidityGaugeTokenAmount;
|
|
1633
2324
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1634
2325
|
adapter: curveLiquidityStethAdapter,
|
|
1635
|
-
selector: protocol.lendAndStakeSelector,
|
|
1636
2326
|
encodedCallArgs: protocol.curveStethLendAndStakeArgs({
|
|
1637
|
-
|
|
2327
|
+
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
|
1638
2328
|
outgoingStethAmount: outgoingStethAmount,
|
|
1639
|
-
|
|
1640
|
-
})
|
|
2329
|
+
outgoingWethAmount: outgoingWethAmount
|
|
2330
|
+
}),
|
|
2331
|
+
selector: protocol.lendAndStakeSelector
|
|
1641
2332
|
});
|
|
1642
2333
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1643
2334
|
}
|
|
1644
|
-
function curveStethRedeem(
|
|
1645
|
-
var comptrollerProxy =
|
|
1646
|
-
integrationManager =
|
|
1647
|
-
fundOwner =
|
|
1648
|
-
curveLiquidityStethAdapter =
|
|
1649
|
-
outgoingLPTokenAmount =
|
|
1650
|
-
minIncomingWethAmount =
|
|
1651
|
-
minIncomingStethAmount =
|
|
1652
|
-
receiveSingleAsset =
|
|
2335
|
+
function curveStethRedeem(_ref33) {
|
|
2336
|
+
var comptrollerProxy = _ref33.comptrollerProxy,
|
|
2337
|
+
integrationManager = _ref33.integrationManager,
|
|
2338
|
+
fundOwner = _ref33.fundOwner,
|
|
2339
|
+
curveLiquidityStethAdapter = _ref33.curveLiquidityStethAdapter,
|
|
2340
|
+
outgoingLPTokenAmount = _ref33.outgoingLPTokenAmount,
|
|
2341
|
+
minIncomingWethAmount = _ref33.minIncomingWethAmount,
|
|
2342
|
+
minIncomingStethAmount = _ref33.minIncomingStethAmount,
|
|
2343
|
+
receiveSingleAsset = _ref33.receiveSingleAsset;
|
|
1653
2344
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1654
2345
|
adapter: curveLiquidityStethAdapter,
|
|
1655
|
-
selector: protocol.redeemSelector,
|
|
1656
2346
|
encodedCallArgs: protocol.curveStethRedeemArgs({
|
|
1657
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1658
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1659
2347
|
minIncomingStethAmount: minIncomingStethAmount,
|
|
2348
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2349
|
+
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
|
1660
2350
|
receiveSingleAsset: receiveSingleAsset
|
|
1661
|
-
})
|
|
2351
|
+
}),
|
|
2352
|
+
selector: protocol.redeemSelector
|
|
1662
2353
|
});
|
|
1663
2354
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1664
2355
|
}
|
|
1665
|
-
function curveStethStake(
|
|
1666
|
-
var comptrollerProxy =
|
|
1667
|
-
integrationManager =
|
|
1668
|
-
fundOwner =
|
|
1669
|
-
curveLiquidityStethAdapter =
|
|
1670
|
-
outgoingLPTokenAmount =
|
|
2356
|
+
function curveStethStake(_ref34) {
|
|
2357
|
+
var comptrollerProxy = _ref34.comptrollerProxy,
|
|
2358
|
+
integrationManager = _ref34.integrationManager,
|
|
2359
|
+
fundOwner = _ref34.fundOwner,
|
|
2360
|
+
curveLiquidityStethAdapter = _ref34.curveLiquidityStethAdapter,
|
|
2361
|
+
outgoingLPTokenAmount = _ref34.outgoingLPTokenAmount;
|
|
1671
2362
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1672
2363
|
adapter: curveLiquidityStethAdapter,
|
|
1673
|
-
selector: protocol.stakeSelector,
|
|
1674
2364
|
encodedCallArgs: protocol.curveStethStakeArgs({
|
|
1675
2365
|
outgoingLPTokenAmount: outgoingLPTokenAmount
|
|
1676
|
-
})
|
|
2366
|
+
}),
|
|
2367
|
+
selector: protocol.stakeSelector
|
|
1677
2368
|
});
|
|
1678
2369
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1679
2370
|
}
|
|
1680
|
-
function curveStethUnstakeAndRedeem(
|
|
1681
|
-
var comptrollerProxy =
|
|
1682
|
-
integrationManager =
|
|
1683
|
-
fundOwner =
|
|
1684
|
-
curveLiquidityStethAdapter =
|
|
1685
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
1686
|
-
minIncomingWethAmount =
|
|
1687
|
-
minIncomingStethAmount =
|
|
1688
|
-
receiveSingleAsset =
|
|
2371
|
+
function curveStethUnstakeAndRedeem(_ref35) {
|
|
2372
|
+
var comptrollerProxy = _ref35.comptrollerProxy,
|
|
2373
|
+
integrationManager = _ref35.integrationManager,
|
|
2374
|
+
fundOwner = _ref35.fundOwner,
|
|
2375
|
+
curveLiquidityStethAdapter = _ref35.curveLiquidityStethAdapter,
|
|
2376
|
+
outgoingLiquidityGaugeTokenAmount = _ref35.outgoingLiquidityGaugeTokenAmount,
|
|
2377
|
+
minIncomingWethAmount = _ref35.minIncomingWethAmount,
|
|
2378
|
+
minIncomingStethAmount = _ref35.minIncomingStethAmount,
|
|
2379
|
+
receiveSingleAsset = _ref35.receiveSingleAsset;
|
|
1689
2380
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1690
2381
|
adapter: curveLiquidityStethAdapter,
|
|
1691
|
-
selector: protocol.unstakeAndRedeemSelector,
|
|
1692
2382
|
encodedCallArgs: protocol.curveStethUnstakeAndRedeemArgs({
|
|
1693
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1694
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
|
1695
2383
|
minIncomingStethAmount: minIncomingStethAmount,
|
|
2384
|
+
minIncomingWethAmount: minIncomingWethAmount,
|
|
2385
|
+
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
|
1696
2386
|
receiveSingleAsset: receiveSingleAsset
|
|
1697
|
-
})
|
|
2387
|
+
}),
|
|
2388
|
+
selector: protocol.unstakeAndRedeemSelector
|
|
1698
2389
|
});
|
|
1699
2390
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1700
2391
|
}
|
|
1701
|
-
function curveStethUnstake(
|
|
1702
|
-
var comptrollerProxy =
|
|
1703
|
-
integrationManager =
|
|
1704
|
-
fundOwner =
|
|
1705
|
-
curveLiquidityStethAdapter =
|
|
1706
|
-
outgoingLiquidityGaugeTokenAmount =
|
|
2392
|
+
function curveStethUnstake(_ref36) {
|
|
2393
|
+
var comptrollerProxy = _ref36.comptrollerProxy,
|
|
2394
|
+
integrationManager = _ref36.integrationManager,
|
|
2395
|
+
fundOwner = _ref36.fundOwner,
|
|
2396
|
+
curveLiquidityStethAdapter = _ref36.curveLiquidityStethAdapter,
|
|
2397
|
+
outgoingLiquidityGaugeTokenAmount = _ref36.outgoingLiquidityGaugeTokenAmount;
|
|
1707
2398
|
var callArgs = protocol.callOnIntegrationArgs({
|
|
1708
2399
|
adapter: curveLiquidityStethAdapter,
|
|
1709
|
-
selector: protocol.unstakeSelector,
|
|
1710
2400
|
encodedCallArgs: protocol.curveStethUnstakeArgs({
|
|
1711
2401
|
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
|
1712
|
-
})
|
|
2402
|
+
}),
|
|
2403
|
+
selector: protocol.unstakeSelector
|
|
1713
2404
|
});
|
|
1714
2405
|
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1715
2406
|
}
|
|
@@ -1728,10 +2419,10 @@ function _idleClaimRewards() {
|
|
|
1728
2419
|
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
|
1729
2420
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1730
2421
|
adapter: idleAdapter,
|
|
1731
|
-
selector: protocol.claimRewardsSelector,
|
|
1732
2422
|
encodedCallArgs: protocol.idleClaimRewardsArgs({
|
|
1733
2423
|
idleToken: idleToken
|
|
1734
|
-
})
|
|
2424
|
+
}),
|
|
2425
|
+
selector: protocol.claimRewardsSelector
|
|
1735
2426
|
});
|
|
1736
2427
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1737
2428
|
|
|
@@ -1760,12 +2451,12 @@ function _idleLend() {
|
|
|
1760
2451
|
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;
|
|
1761
2452
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1762
2453
|
adapter: idleAdapter,
|
|
1763
|
-
selector: protocol.lendSelector,
|
|
1764
2454
|
encodedCallArgs: protocol.idleLendArgs({
|
|
1765
2455
|
idleToken: idleToken,
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
})
|
|
2456
|
+
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
|
2457
|
+
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
|
2458
|
+
}),
|
|
2459
|
+
selector: protocol.lendSelector
|
|
1769
2460
|
});
|
|
1770
2461
|
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1771
2462
|
|
|
@@ -1794,12 +2485,12 @@ function _idleRedeem() {
|
|
|
1794
2485
|
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;
|
|
1795
2486
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1796
2487
|
adapter: idleAdapter,
|
|
1797
|
-
selector: protocol.redeemSelector,
|
|
1798
2488
|
encodedCallArgs: protocol.idleRedeemArgs({
|
|
1799
2489
|
idleToken: idleToken,
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
})
|
|
2490
|
+
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
|
2491
|
+
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
|
2492
|
+
}),
|
|
2493
|
+
selector: protocol.redeemSelector
|
|
1803
2494
|
});
|
|
1804
2495
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1805
2496
|
|
|
@@ -1870,17 +2561,17 @@ function _mockGenericSwap() {
|
|
|
1870
2561
|
|
|
1871
2562
|
case 9:
|
|
1872
2563
|
swapArgs = mockGenericSwapArgs({
|
|
1873
|
-
|
|
1874
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
|
2564
|
+
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
|
1875
2565
|
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
|
1876
2566
|
incomingAssets: incomingAssets,
|
|
2567
|
+
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
|
1877
2568
|
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
|
1878
|
-
|
|
2569
|
+
spendAssets: spendAssets
|
|
1879
2570
|
});
|
|
1880
2571
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1881
2572
|
adapter: mockGenericAdapter,
|
|
1882
|
-
|
|
1883
|
-
|
|
2573
|
+
encodedCallArgs: swapArgs,
|
|
2574
|
+
selector: selector
|
|
1884
2575
|
});
|
|
1885
2576
|
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
1886
2577
|
_context.next = 14;
|
|
@@ -1899,14 +2590,80 @@ function _mockGenericSwap() {
|
|
|
1899
2590
|
return _mockGenericSwap.apply(this, arguments);
|
|
1900
2591
|
}
|
|
1901
2592
|
|
|
2593
|
+
function olympusV2Stake(_x) {
|
|
2594
|
+
return _olympusV2Stake.apply(this, arguments);
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
function _olympusV2Stake() {
|
|
2598
|
+
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
2599
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
|
2600
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2601
|
+
while (1) {
|
|
2602
|
+
switch (_context.prev = _context.next) {
|
|
2603
|
+
case 0:
|
|
2604
|
+
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
|
2605
|
+
stakeArgs = protocol.olympusV2StakeArgs({
|
|
2606
|
+
amount: amount
|
|
2607
|
+
});
|
|
2608
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2609
|
+
adapter: olympusV2Adapter,
|
|
2610
|
+
encodedCallArgs: stakeArgs,
|
|
2611
|
+
selector: protocol.stakeSelector
|
|
2612
|
+
});
|
|
2613
|
+
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2614
|
+
return _context.abrupt("return", stakeTx);
|
|
2615
|
+
|
|
2616
|
+
case 5:
|
|
2617
|
+
case "end":
|
|
2618
|
+
return _context.stop();
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
}, _callee);
|
|
2622
|
+
}));
|
|
2623
|
+
return _olympusV2Stake.apply(this, arguments);
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
function olympusV2Unstake(_x2) {
|
|
2627
|
+
return _olympusV2Unstake.apply(this, arguments);
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
function _olympusV2Unstake() {
|
|
2631
|
+
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
2632
|
+
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
|
2633
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
2634
|
+
while (1) {
|
|
2635
|
+
switch (_context2.prev = _context2.next) {
|
|
2636
|
+
case 0:
|
|
2637
|
+
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
|
2638
|
+
unstakeArgs = protocol.olympusV2UnstakeArgs({
|
|
2639
|
+
amount: amount
|
|
2640
|
+
});
|
|
2641
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2642
|
+
adapter: olympusV2Adapter,
|
|
2643
|
+
encodedCallArgs: unstakeArgs,
|
|
2644
|
+
selector: protocol.unstakeSelector
|
|
2645
|
+
});
|
|
2646
|
+
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2647
|
+
return _context2.abrupt("return", unstakeTx);
|
|
2648
|
+
|
|
2649
|
+
case 5:
|
|
2650
|
+
case "end":
|
|
2651
|
+
return _context2.stop();
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
}, _callee2);
|
|
2655
|
+
}));
|
|
2656
|
+
return _olympusV2Unstake.apply(this, arguments);
|
|
2657
|
+
}
|
|
2658
|
+
|
|
1902
2659
|
function paraSwapV4GenerateDummyPaths(_ref) {
|
|
1903
2660
|
var toTokens = _ref.toTokens;
|
|
1904
2661
|
return toTokens.map(function (toToken) {
|
|
1905
2662
|
return {
|
|
1906
|
-
to: toToken,
|
|
1907
|
-
totalNetworkFee: 0,
|
|
1908
2663
|
// Not supported in our protocol
|
|
1909
|
-
routes: []
|
|
2664
|
+
routes: [],
|
|
2665
|
+
to: toToken,
|
|
2666
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
|
1910
2667
|
|
|
1911
2668
|
};
|
|
1912
2669
|
});
|
|
@@ -1925,16 +2682,16 @@ function _paraSwapV4TakeOrder() {
|
|
|
1925
2682
|
case 0:
|
|
1926
2683
|
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;
|
|
1927
2684
|
takeOrderArgs = protocol.paraSwapV4TakeOrderArgs({
|
|
1928
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
1929
2685
|
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
|
2686
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
1930
2687
|
outgoingAsset: outgoingAsset,
|
|
1931
2688
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
1932
2689
|
paths: paths
|
|
1933
2690
|
});
|
|
1934
2691
|
callArgs = protocol.callOnIntegrationArgs({
|
|
1935
2692
|
adapter: paraSwapV4Adapter,
|
|
1936
|
-
|
|
1937
|
-
|
|
2693
|
+
encodedCallArgs: takeOrderArgs,
|
|
2694
|
+
selector: protocol.takeOrderSelector
|
|
1938
2695
|
});
|
|
1939
2696
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
1940
2697
|
|
|
@@ -1948,6 +2705,161 @@ function _paraSwapV4TakeOrder() {
|
|
|
1948
2705
|
return _paraSwapV4TakeOrder.apply(this, arguments);
|
|
1949
2706
|
}
|
|
1950
2707
|
|
|
2708
|
+
function paraSwapV5GenerateDummyPaths(_ref) {
|
|
2709
|
+
var toTokens = _ref.toTokens;
|
|
2710
|
+
return toTokens.map(function (toToken) {
|
|
2711
|
+
return {
|
|
2712
|
+
// Not supported in our protocol
|
|
2713
|
+
adapters: [],
|
|
2714
|
+
to: toToken,
|
|
2715
|
+
totalNetworkFee: 0 // Can ignore this param in the dummy
|
|
2716
|
+
|
|
2717
|
+
};
|
|
2718
|
+
});
|
|
2719
|
+
}
|
|
2720
|
+
function paraSwapV5TakeOrder(_x) {
|
|
2721
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
function _paraSwapV5TakeOrder() {
|
|
2725
|
+
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
|
2726
|
+
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
|
2727
|
+
|
|
2728
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2729
|
+
while (1) {
|
|
2730
|
+
switch (_context.prev = _context.next) {
|
|
2731
|
+
case 0:
|
|
2732
|
+
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;
|
|
2733
|
+
takeOrderArgs = protocol.paraSwapV5TakeOrderArgs({
|
|
2734
|
+
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
|
2735
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2736
|
+
outgoingAsset: outgoingAsset,
|
|
2737
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
|
2738
|
+
paths: paths,
|
|
2739
|
+
uuid: uuid
|
|
2740
|
+
});
|
|
2741
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2742
|
+
adapter: paraSwapV5Adapter,
|
|
2743
|
+
encodedCallArgs: takeOrderArgs,
|
|
2744
|
+
selector: protocol.takeOrderSelector
|
|
2745
|
+
});
|
|
2746
|
+
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2747
|
+
|
|
2748
|
+
case 4:
|
|
2749
|
+
case "end":
|
|
2750
|
+
return _context.stop();
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
}, _callee);
|
|
2754
|
+
}));
|
|
2755
|
+
return _paraSwapV5TakeOrder.apply(this, arguments);
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
function poolTogetherV4Lend(_x) {
|
|
2759
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
function _poolTogetherV4Lend() {
|
|
2763
|
+
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
2764
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
|
2765
|
+
|
|
2766
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2767
|
+
while (1) {
|
|
2768
|
+
switch (_context.prev = _context.next) {
|
|
2769
|
+
case 0:
|
|
2770
|
+
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;
|
|
2771
|
+
lendArgs = protocol.poolTogetherV4LendArgs({
|
|
2772
|
+
amount: amount,
|
|
2773
|
+
ptToken: ptToken
|
|
2774
|
+
});
|
|
2775
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2776
|
+
adapter: poolTogetherV4Adapter,
|
|
2777
|
+
encodedCallArgs: lendArgs,
|
|
2778
|
+
selector: protocol.lendSelector
|
|
2779
|
+
});
|
|
2780
|
+
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2781
|
+
return _context.abrupt("return", lendTx);
|
|
2782
|
+
|
|
2783
|
+
case 5:
|
|
2784
|
+
case "end":
|
|
2785
|
+
return _context.stop();
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
}, _callee);
|
|
2789
|
+
}));
|
|
2790
|
+
return _poolTogetherV4Lend.apply(this, arguments);
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
function poolTogetherV4Redeem(_x2) {
|
|
2794
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
function _poolTogetherV4Redeem() {
|
|
2798
|
+
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
2799
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
|
2800
|
+
|
|
2801
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
2802
|
+
while (1) {
|
|
2803
|
+
switch (_context2.prev = _context2.next) {
|
|
2804
|
+
case 0:
|
|
2805
|
+
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;
|
|
2806
|
+
redeemArgs = protocol.poolTogetherV4RedeemArgs({
|
|
2807
|
+
amount: amount,
|
|
2808
|
+
ptToken: ptToken
|
|
2809
|
+
});
|
|
2810
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2811
|
+
adapter: poolTogetherV4Adapter,
|
|
2812
|
+
encodedCallArgs: redeemArgs,
|
|
2813
|
+
selector: protocol.redeemSelector
|
|
2814
|
+
});
|
|
2815
|
+
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2816
|
+
return _context2.abrupt("return", redeemTx);
|
|
2817
|
+
|
|
2818
|
+
case 5:
|
|
2819
|
+
case "end":
|
|
2820
|
+
return _context2.stop();
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
}, _callee2);
|
|
2824
|
+
}));
|
|
2825
|
+
return _poolTogetherV4Redeem.apply(this, arguments);
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
function poolTogetherV4ClaimRewards(_x3) {
|
|
2829
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
function _poolTogetherV4ClaimRewards() {
|
|
2833
|
+
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2834
|
+
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
|
2835
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2836
|
+
while (1) {
|
|
2837
|
+
switch (_context3.prev = _context3.next) {
|
|
2838
|
+
case 0:
|
|
2839
|
+
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
|
2840
|
+
claimRewardsArgs = protocol.poolTogetherV4ClaimRewardsArgs({
|
|
2841
|
+
drawIds: drawIds,
|
|
2842
|
+
prizeDistributor: prizeDistributor,
|
|
2843
|
+
winningPicks: winningPicks
|
|
2844
|
+
});
|
|
2845
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2846
|
+
adapter: poolTogetherV4Adapter,
|
|
2847
|
+
encodedCallArgs: claimRewardsArgs,
|
|
2848
|
+
selector: protocol.claimRewardsSelector
|
|
2849
|
+
});
|
|
2850
|
+
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2851
|
+
return _context3.abrupt("return", claimTx);
|
|
2852
|
+
|
|
2853
|
+
case 5:
|
|
2854
|
+
case "end":
|
|
2855
|
+
return _context3.stop();
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
}, _callee3);
|
|
2859
|
+
}));
|
|
2860
|
+
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
|
2861
|
+
}
|
|
2862
|
+
|
|
1951
2863
|
function synthetixAssignExchangeDelegate(_x) {
|
|
1952
2864
|
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
|
1953
2865
|
}
|
|
@@ -2005,26 +2917,58 @@ function _synthetixResolveAddress() {
|
|
|
2005
2917
|
return _synthetixResolveAddress.apply(this, arguments);
|
|
2006
2918
|
}
|
|
2007
2919
|
|
|
2008
|
-
function
|
|
2920
|
+
function synthetixRedeem(_x3) {
|
|
2921
|
+
return _synthetixRedeem.apply(this, arguments);
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
function _synthetixRedeem() {
|
|
2925
|
+
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2926
|
+
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
|
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, signer = _ref3.signer, synthetixAdapter = _ref3.synthetixAdapter, synths = _ref3.synths;
|
|
2932
|
+
redeemArgs = protocol.synthetixRedeemArgs({
|
|
2933
|
+
synths: synths
|
|
2934
|
+
});
|
|
2935
|
+
callArgs = protocol.callOnIntegrationArgs({
|
|
2936
|
+
adapter: synthetixAdapter,
|
|
2937
|
+
encodedCallArgs: redeemArgs,
|
|
2938
|
+
selector: protocol.redeemSelector
|
|
2939
|
+
});
|
|
2940
|
+
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2941
|
+
|
|
2942
|
+
case 4:
|
|
2943
|
+
case "end":
|
|
2944
|
+
return _context3.stop();
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
}, _callee3);
|
|
2948
|
+
}));
|
|
2949
|
+
return _synthetixRedeem.apply(this, arguments);
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
function synthetixTakeOrder(_x4) {
|
|
2009
2953
|
return _synthetixTakeOrder.apply(this, arguments);
|
|
2010
2954
|
}
|
|
2011
2955
|
|
|
2012
2956
|
function _synthetixTakeOrder() {
|
|
2013
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2014
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset,
|
|
2957
|
+
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
|
2958
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref4$outgoingAssetAm, outgoingAssetAmount, incomingAsset, _ref4$minIncomingAsse, minIncomingAssetAmount, _ref4$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
2015
2959
|
|
|
2016
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2960
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
2017
2961
|
while (1) {
|
|
2018
|
-
switch (
|
|
2962
|
+
switch (_context4.prev = _context4.next) {
|
|
2019
2963
|
case 0:
|
|
2020
|
-
comptrollerProxy =
|
|
2964
|
+
comptrollerProxy = _ref4.comptrollerProxy, vaultProxy = _ref4.vaultProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, synthetixAdapter = _ref4.synthetixAdapter, outgoingAsset = _ref4.outgoingAsset, _ref4$outgoingAssetAm = _ref4.outgoingAssetAmount, outgoingAssetAmount = _ref4$outgoingAssetAm === void 0 ? ethers.utils.parseEther('1') : _ref4$outgoingAssetAm, incomingAsset = _ref4.incomingAsset, _ref4$minIncomingAsse = _ref4.minIncomingAssetAmount, minIncomingAssetAmount = _ref4$minIncomingAsse === void 0 ? ethers.utils.parseEther('1') : _ref4$minIncomingAsse, _ref4$seedFund = _ref4.seedFund, seedFund = _ref4$seedFund === void 0 ? false : _ref4$seedFund;
|
|
2021
2965
|
|
|
2022
2966
|
if (!seedFund) {
|
|
2023
|
-
|
|
2967
|
+
_context4.next = 4;
|
|
2024
2968
|
break;
|
|
2025
2969
|
}
|
|
2026
2970
|
|
|
2027
|
-
|
|
2971
|
+
_context4.next = 4;
|
|
2028
2972
|
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
|
2029
2973
|
|
|
2030
2974
|
case 4:
|
|
@@ -2034,23 +2978,23 @@ function _synthetixTakeOrder() {
|
|
|
2034
2978
|
outgoingAsset: outgoingAsset,
|
|
2035
2979
|
outgoingAssetAmount: outgoingAssetAmount
|
|
2036
2980
|
});
|
|
2037
|
-
|
|
2981
|
+
_context4.next = 7;
|
|
2038
2982
|
return protocol.callOnIntegrationArgs({
|
|
2039
2983
|
adapter: synthetixAdapter,
|
|
2040
|
-
|
|
2041
|
-
|
|
2984
|
+
encodedCallArgs: takeOrderArgs,
|
|
2985
|
+
selector: protocol.takeOrderSelector
|
|
2042
2986
|
});
|
|
2043
2987
|
|
|
2044
2988
|
case 7:
|
|
2045
|
-
callArgs =
|
|
2046
|
-
return
|
|
2989
|
+
callArgs = _context4.sent;
|
|
2990
|
+
return _context4.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2047
2991
|
|
|
2048
2992
|
case 9:
|
|
2049
2993
|
case "end":
|
|
2050
|
-
return
|
|
2994
|
+
return _context4.stop();
|
|
2051
2995
|
}
|
|
2052
2996
|
}
|
|
2053
|
-
},
|
|
2997
|
+
}, _callee4);
|
|
2054
2998
|
}));
|
|
2055
2999
|
return _synthetixTakeOrder.apply(this, arguments);
|
|
2056
3000
|
}
|
|
@@ -2063,13 +3007,13 @@ function uniswapV2Lend(_x) {
|
|
|
2063
3007
|
|
|
2064
3008
|
function _uniswapV2Lend() {
|
|
2065
3009
|
_uniswapV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
2066
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
|
3010
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, minPoolTokenAmount, _ref$seedFund, seedFund, lendArgs, callArgs, lendTx;
|
|
2067
3011
|
|
|
2068
3012
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2069
3013
|
while (1) {
|
|
2070
3014
|
switch (_context.prev = _context.next) {
|
|
2071
3015
|
case 0:
|
|
2072
|
-
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner,
|
|
3016
|
+
comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV2LiquidityAdapter = _ref.uniswapV2LiquidityAdapter, tokenA = _ref.tokenA, tokenB = _ref.tokenB, amountADesired = _ref.amountADesired, amountBDesired = _ref.amountBDesired, amountAMin = _ref.amountAMin, amountBMin = _ref.amountBMin, minPoolTokenAmount = _ref.minPoolTokenAmount, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
|
2073
3017
|
|
|
2074
3018
|
if (!seedFund) {
|
|
2075
3019
|
_context.next = 6;
|
|
@@ -2085,18 +3029,18 @@ function _uniswapV2Lend() {
|
|
|
2085
3029
|
|
|
2086
3030
|
case 6:
|
|
2087
3031
|
lendArgs = protocol.uniswapV2LendArgs({
|
|
2088
|
-
tokenA: tokenA,
|
|
2089
|
-
tokenB: tokenB,
|
|
2090
3032
|
amountADesired: amountADesired,
|
|
2091
|
-
amountBDesired: amountBDesired,
|
|
2092
3033
|
amountAMin: amountAMin,
|
|
3034
|
+
amountBDesired: amountBDesired,
|
|
2093
3035
|
amountBMin: amountBMin,
|
|
2094
|
-
minPoolTokenAmount: minPoolTokenAmount
|
|
3036
|
+
minPoolTokenAmount: minPoolTokenAmount,
|
|
3037
|
+
tokenA: tokenA,
|
|
3038
|
+
tokenB: tokenB
|
|
2095
3039
|
});
|
|
2096
3040
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2097
|
-
adapter:
|
|
2098
|
-
|
|
2099
|
-
|
|
3041
|
+
adapter: uniswapV2LiquidityAdapter,
|
|
3042
|
+
encodedCallArgs: lendArgs,
|
|
3043
|
+
selector: protocol.lendSelector
|
|
2100
3044
|
});
|
|
2101
3045
|
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2102
3046
|
_context.next = 11;
|
|
@@ -2121,23 +3065,23 @@ function uniswapV2Redeem(_x2) {
|
|
|
2121
3065
|
|
|
2122
3066
|
function _uniswapV2Redeem() {
|
|
2123
3067
|
_uniswapV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
|
2124
|
-
var comptrollerProxy, integrationManager, fundOwner,
|
|
3068
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, poolTokenAmount, tokenA, tokenB, amountAMin, amountBMin, redeemArgs, callArgs, redeemTx;
|
|
2125
3069
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
2126
3070
|
while (1) {
|
|
2127
3071
|
switch (_context2.prev = _context2.next) {
|
|
2128
3072
|
case 0:
|
|
2129
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner,
|
|
3073
|
+
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;
|
|
2130
3074
|
redeemArgs = protocol.uniswapV2RedeemArgs({
|
|
3075
|
+
amountAMin: amountAMin,
|
|
3076
|
+
amountBMin: amountBMin,
|
|
2131
3077
|
poolTokenAmount: poolTokenAmount,
|
|
2132
3078
|
tokenA: tokenA,
|
|
2133
|
-
tokenB: tokenB
|
|
2134
|
-
amountAMin: amountAMin,
|
|
2135
|
-
amountBMin: amountBMin
|
|
3079
|
+
tokenB: tokenB
|
|
2136
3080
|
});
|
|
2137
3081
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2138
|
-
adapter:
|
|
2139
|
-
|
|
2140
|
-
|
|
3082
|
+
adapter: uniswapV2LiquidityAdapter,
|
|
3083
|
+
encodedCallArgs: redeemArgs,
|
|
3084
|
+
selector: protocol.redeemSelector
|
|
2141
3085
|
});
|
|
2142
3086
|
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
|
2143
3087
|
_context2.next = 6;
|
|
@@ -2162,13 +3106,13 @@ function uniswapV2TakeOrder(_x3) {
|
|
|
2162
3106
|
|
|
2163
3107
|
function _uniswapV2TakeOrder() {
|
|
2164
3108
|
_uniswapV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2165
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner,
|
|
3109
|
+
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2ExchangeAdapter, path, outgoingAssetAmount, minIncomingAssetAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
2166
3110
|
|
|
2167
3111
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2168
3112
|
while (1) {
|
|
2169
3113
|
switch (_context3.prev = _context3.next) {
|
|
2170
3114
|
case 0:
|
|
2171
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner,
|
|
3115
|
+
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, uniswapV2ExchangeAdapter = _ref3.uniswapV2ExchangeAdapter, path = _ref3.path, outgoingAssetAmount = _ref3.outgoingAssetAmount, minIncomingAssetAmount = _ref3.minIncomingAssetAmount, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
|
2172
3116
|
|
|
2173
3117
|
if (!seedFund) {
|
|
2174
3118
|
_context3.next = 4;
|
|
@@ -2180,14 +3124,14 @@ function _uniswapV2TakeOrder() {
|
|
|
2180
3124
|
|
|
2181
3125
|
case 4:
|
|
2182
3126
|
takeOrderArgs = protocol.uniswapV2TakeOrderArgs({
|
|
2183
|
-
|
|
3127
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2184
3128
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
2185
|
-
|
|
3129
|
+
path: path
|
|
2186
3130
|
});
|
|
2187
3131
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2188
|
-
adapter:
|
|
2189
|
-
|
|
2190
|
-
|
|
3132
|
+
adapter: uniswapV2ExchangeAdapter,
|
|
3133
|
+
encodedCallArgs: takeOrderArgs,
|
|
3134
|
+
selector: protocol.takeOrderSelector
|
|
2191
3135
|
});
|
|
2192
3136
|
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2193
3137
|
|
|
@@ -2207,7 +3151,7 @@ function uniswapV3TakeOrder(_x) {
|
|
|
2207
3151
|
|
|
2208
3152
|
function _uniswapV3TakeOrder() {
|
|
2209
3153
|
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
2210
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, takeOrderArgs, callArgs;
|
|
3154
|
+
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
|
2211
3155
|
|
|
2212
3156
|
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2213
3157
|
while (1) {
|
|
@@ -2216,35 +3160,33 @@ function _uniswapV3TakeOrder() {
|
|
|
2216
3160
|
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;
|
|
2217
3161
|
|
|
2218
3162
|
if (!seedFund) {
|
|
2219
|
-
_context.next =
|
|
3163
|
+
_context.next = 7;
|
|
2220
3164
|
break;
|
|
2221
3165
|
}
|
|
2222
3166
|
|
|
2223
|
-
_context.
|
|
2224
|
-
_context.next = 5;
|
|
3167
|
+
_context.next = 4;
|
|
2225
3168
|
return comptrollerProxy.getVaultProxy();
|
|
2226
3169
|
|
|
2227
|
-
case
|
|
2228
|
-
|
|
2229
|
-
_context.
|
|
2230
|
-
|
|
2231
|
-
return _context.t0.transfer.call(_context.t0, _context.t1, _context.t2);
|
|
3170
|
+
case 4:
|
|
3171
|
+
vaultProxy = _context.sent;
|
|
3172
|
+
_context.next = 7;
|
|
3173
|
+
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
|
2232
3174
|
|
|
2233
|
-
case
|
|
3175
|
+
case 7:
|
|
2234
3176
|
takeOrderArgs = protocol.uniswapV3TakeOrderArgs({
|
|
2235
|
-
|
|
2236
|
-
pathFees: pathFees,
|
|
3177
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
|
2237
3178
|
outgoingAssetAmount: outgoingAssetAmount,
|
|
2238
|
-
|
|
3179
|
+
pathAddresses: pathAddresses,
|
|
3180
|
+
pathFees: pathFees
|
|
2239
3181
|
});
|
|
2240
3182
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2241
3183
|
adapter: uniswapV3Adapter,
|
|
2242
|
-
|
|
2243
|
-
|
|
3184
|
+
encodedCallArgs: takeOrderArgs,
|
|
3185
|
+
selector: protocol.takeOrderSelector
|
|
2244
3186
|
});
|
|
2245
3187
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2246
3188
|
|
|
2247
|
-
case
|
|
3189
|
+
case 10:
|
|
2248
3190
|
case "end":
|
|
2249
3191
|
return _context.stop();
|
|
2250
3192
|
}
|
|
@@ -2269,12 +3211,12 @@ function _yearnVaultV2Lend() {
|
|
|
2269
3211
|
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;
|
|
2270
3212
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2271
3213
|
adapter: yearnVaultV2Adapter,
|
|
2272
|
-
selector: protocol.lendSelector,
|
|
2273
3214
|
encodedCallArgs: protocol.yearnVaultV2LendArgs({
|
|
2274
|
-
|
|
3215
|
+
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
|
2275
3216
|
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
|
2276
|
-
|
|
2277
|
-
})
|
|
3217
|
+
yVault: yVault
|
|
3218
|
+
}),
|
|
3219
|
+
selector: protocol.lendSelector
|
|
2278
3220
|
});
|
|
2279
3221
|
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2280
3222
|
|
|
@@ -2303,13 +3245,13 @@ function _yearnVaultV2Redeem() {
|
|
|
2303
3245
|
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;
|
|
2304
3246
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2305
3247
|
adapter: yearnVaultV2Adapter,
|
|
2306
|
-
selector: protocol.redeemSelector,
|
|
2307
3248
|
encodedCallArgs: protocol.yearnVaultV2RedeemArgs({
|
|
2308
|
-
yVault: yVault,
|
|
2309
3249
|
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
|
2310
3250
|
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
|
2311
|
-
slippageToleranceBps: slippageToleranceBps
|
|
2312
|
-
|
|
3251
|
+
slippageToleranceBps: slippageToleranceBps,
|
|
3252
|
+
yVault: yVault
|
|
3253
|
+
}),
|
|
3254
|
+
selector: protocol.redeemSelector
|
|
2313
3255
|
});
|
|
2314
3256
|
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2315
3257
|
|
|
@@ -2341,8 +3283,8 @@ function _zeroExV2TakeOrder() {
|
|
|
2341
3283
|
});
|
|
2342
3284
|
callArgs = protocol.callOnIntegrationArgs({
|
|
2343
3285
|
adapter: zeroExV2Adapter,
|
|
2344
|
-
|
|
2345
|
-
|
|
3286
|
+
encodedCallArgs: takeOrderArgs,
|
|
3287
|
+
selector: protocol.takeOrderSelector
|
|
2346
3288
|
});
|
|
2347
3289
|
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
|
2348
3290
|
|
|
@@ -2485,7 +3427,8 @@ function assertEvent(receipt, event, match) {
|
|
|
2485
3427
|
var events = ethers$1.extractEvent(receipt, event);
|
|
2486
3428
|
expect(events.length).toBe(1);
|
|
2487
3429
|
expect(receipt).toHaveEmittedWith(event, match);
|
|
2488
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args;
|
|
3430
|
+
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
|
|
3431
|
+
|
|
2489
3432
|
return args;
|
|
2490
3433
|
}
|
|
2491
3434
|
function assertNoEvent(receipt, event) {
|
|
@@ -2646,6 +3589,7 @@ function _createComptrollerProxy() {
|
|
|
2646
3589
|
comptrollerProxyContract = _context.sent;
|
|
2647
3590
|
return _context.abrupt("return", {
|
|
2648
3591
|
comptrollerProxy: new protocol.ComptrollerLib(comptrollerProxyContract, signer),
|
|
3592
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2649
3593
|
receipt: comptrollerProxyContract.deployment
|
|
2650
3594
|
});
|
|
2651
3595
|
|
|
@@ -2678,14 +3622,14 @@ function _createMigrationRequest() {
|
|
|
2678
3622
|
case 3:
|
|
2679
3623
|
receipt = _context2.sent;
|
|
2680
3624
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2681
|
-
creator: signer,
|
|
2682
3625
|
comptrollerProxy: expect.any(String),
|
|
3626
|
+
creator: signer,
|
|
2683
3627
|
denominationAsset: denominationAsset,
|
|
2684
3628
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
|
2685
3629
|
});
|
|
2686
3630
|
return _context2.abrupt("return", {
|
|
2687
|
-
|
|
2688
|
-
|
|
3631
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
3632
|
+
receipt: receipt
|
|
2689
3633
|
});
|
|
2690
3634
|
|
|
2691
3635
|
case 6:
|
|
@@ -2704,29 +3648,29 @@ function createNewFund(_x3) {
|
|
|
2704
3648
|
|
|
2705
3649
|
function _createNewFund() {
|
|
2706
3650
|
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2707
|
-
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;
|
|
3651
|
+
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;
|
|
2708
3652
|
|
|
2709
3653
|
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2710
3654
|
while (1) {
|
|
2711
3655
|
switch (_context3.prev = _context3.next) {
|
|
2712
3656
|
case 0:
|
|
2713
|
-
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;
|
|
3657
|
+
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;
|
|
2714
3658
|
_context3.next = 3;
|
|
2715
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
|
3659
|
+
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
|
2716
3660
|
|
|
2717
3661
|
case 3:
|
|
2718
3662
|
receipt = _context3.sent;
|
|
2719
3663
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2720
|
-
creator: signer,
|
|
2721
3664
|
comptrollerProxy: expect.any(String),
|
|
3665
|
+
creator: signer,
|
|
2722
3666
|
denominationAsset: denominationAsset,
|
|
2723
3667
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
|
2724
3668
|
});
|
|
2725
3669
|
comptrollerProxy = new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
|
2726
3670
|
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
|
3671
|
+
comptrollerProxy: comptrollerProxy,
|
|
2727
3672
|
creator: signer,
|
|
2728
|
-
vaultProxy: expect.any(String)
|
|
2729
|
-
comptrollerProxy: comptrollerProxy
|
|
3673
|
+
vaultProxy: expect.any(String)
|
|
2730
3674
|
});
|
|
2731
3675
|
vaultProxy = new protocol.VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
|
2732
3676
|
|
|
@@ -2777,14 +3721,14 @@ function _createReconfigurationRequest() {
|
|
|
2777
3721
|
case 3:
|
|
2778
3722
|
receipt = _context4.sent;
|
|
2779
3723
|
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
2780
|
-
creator: signer,
|
|
2781
3724
|
comptrollerProxy: expect.any(String),
|
|
3725
|
+
creator: signer,
|
|
2782
3726
|
denominationAsset: denominationAsset,
|
|
2783
3727
|
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
|
2784
3728
|
});
|
|
2785
3729
|
return _context4.abrupt("return", {
|
|
2786
|
-
|
|
2787
|
-
|
|
3730
|
+
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
3731
|
+
receipt: receipt
|
|
2788
3732
|
});
|
|
2789
3733
|
|
|
2790
3734
|
case 6:
|
|
@@ -2866,16 +3810,49 @@ function _setupGasRelayerPaymaster() {
|
|
|
2866
3810
|
return _setupGasRelayerPaymaster.apply(this, arguments);
|
|
2867
3811
|
}
|
|
2868
3812
|
|
|
2869
|
-
function
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
3813
|
+
function vaultCallCreateNewList(_x) {
|
|
3814
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
function _vaultCallCreateNewList() {
|
|
3818
|
+
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
|
3819
|
+
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
|
3820
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
3821
|
+
while (1) {
|
|
3822
|
+
switch (_context.prev = _context.next) {
|
|
3823
|
+
case 0:
|
|
3824
|
+
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
|
3825
|
+
_context.next = 3;
|
|
3826
|
+
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, protocol.addressListRegistryCreateListSelector, protocol.encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
|
3827
|
+
|
|
3828
|
+
case 3:
|
|
3829
|
+
_context.next = 5;
|
|
3830
|
+
return addressListRegistry.getListCount();
|
|
3831
|
+
|
|
3832
|
+
case 5:
|
|
3833
|
+
listCount = _context.sent;
|
|
3834
|
+
return _context.abrupt("return", listCount.sub(1));
|
|
3835
|
+
|
|
3836
|
+
case 7:
|
|
3837
|
+
case "end":
|
|
3838
|
+
return _context.stop();
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
}, _callee);
|
|
3842
|
+
}));
|
|
3843
|
+
return _vaultCallCreateNewList.apply(this, arguments);
|
|
2874
3844
|
}
|
|
2875
|
-
|
|
3845
|
+
|
|
3846
|
+
function vaultCallCurveMinterMint(_ref2) {
|
|
2876
3847
|
var comptrollerProxy = _ref2.comptrollerProxy,
|
|
2877
3848
|
minter = _ref2.minter,
|
|
2878
|
-
|
|
3849
|
+
gauge = _ref2.gauge;
|
|
3850
|
+
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintSelector, protocol.encodeArgs(['address'], [gauge]));
|
|
3851
|
+
}
|
|
3852
|
+
function vaultCallCurveMinterMintMany(_ref3) {
|
|
3853
|
+
var comptrollerProxy = _ref3.comptrollerProxy,
|
|
3854
|
+
minter = _ref3.minter,
|
|
3855
|
+
gauges = _ref3.gauges;
|
|
2879
3856
|
var gaugesFormatted = new Array(8).fill(ethers.constants.AddressZero);
|
|
2880
3857
|
|
|
2881
3858
|
for (var i in gauges) {
|
|
@@ -2884,16 +3861,16 @@ function vaultCallCurveMinterMintMany(_ref2) {
|
|
|
2884
3861
|
|
|
2885
3862
|
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintManySelector, protocol.encodeArgs(['address[8]'], [gaugesFormatted]));
|
|
2886
3863
|
}
|
|
2887
|
-
function vaultCallCurveMinterToggleApproveMint(
|
|
2888
|
-
var comptrollerProxy =
|
|
2889
|
-
minter =
|
|
2890
|
-
account =
|
|
3864
|
+
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
|
3865
|
+
var comptrollerProxy = _ref4.comptrollerProxy,
|
|
3866
|
+
minter = _ref4.minter,
|
|
3867
|
+
account = _ref4.account;
|
|
2891
3868
|
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterToggleApproveMintSelector, protocol.encodeArgs(['address'], [account]));
|
|
2892
3869
|
}
|
|
2893
|
-
function vaultCallStartAssetBypassTimelock(
|
|
2894
|
-
var comptrollerProxy =
|
|
2895
|
-
contract =
|
|
2896
|
-
asset =
|
|
3870
|
+
function vaultCallStartAssetBypassTimelock(_ref5) {
|
|
3871
|
+
var comptrollerProxy = _ref5.comptrollerProxy,
|
|
3872
|
+
contract = _ref5.contract,
|
|
3873
|
+
asset = _ref5.asset;
|
|
2897
3874
|
return comptrollerProxy.vaultCallOnContract(contract, protocol.sighash(ethers.utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), protocol.encodeArgs(['address'], [asset]));
|
|
2898
3875
|
}
|
|
2899
3876
|
|
|
@@ -2949,8 +3926,8 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
|
2949
3926
|
// 50% discount
|
|
2950
3927
|
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
|
2951
3928
|
return _context2.abrupt("return", {
|
|
2952
|
-
|
|
2953
|
-
|
|
3929
|
+
mlnAmountToBurn: mlnAmountToBurn,
|
|
3930
|
+
mlnValue: mlnValueOfBuyback
|
|
2954
3931
|
});
|
|
2955
3932
|
|
|
2956
3933
|
case 8:
|
|
@@ -2966,43 +3943,55 @@ function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
|
|
2966
3943
|
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; }
|
|
2967
3944
|
|
|
2968
3945
|
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; }
|
|
3946
|
+
|
|
3947
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
2969
3948
|
var whales = {
|
|
2970
|
-
|
|
2971
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
|
2972
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
3949
|
+
// primitives
|
|
2973
3950
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
|
2974
3951
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
2975
|
-
bnt: '
|
|
2976
|
-
|
|
3952
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
|
3953
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
3954
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
|
2977
3955
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
|
2978
|
-
dai: '
|
|
2979
|
-
knc: '
|
|
3956
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
3957
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
|
2980
3958
|
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
|
2981
3959
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
|
2982
3960
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
|
2983
3961
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
|
3962
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
|
2984
3963
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
|
2985
3964
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
3965
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
|
3966
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
|
2986
3967
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
|
2987
3968
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
|
2988
3969
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
|
2989
3970
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
|
2990
3971
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
|
2991
|
-
|
|
3972
|
+
// aTokens
|
|
3973
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
3974
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
|
3975
|
+
// cTokens
|
|
2992
3976
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
|
2993
|
-
cdai: '
|
|
3977
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
|
2994
3978
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
3979
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
|
3980
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
|
3981
|
+
// ptTokens
|
|
3982
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
|
3983
|
+
// synths
|
|
2999
3984
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
|
3000
|
-
seur: '
|
|
3001
|
-
|
|
3985
|
+
seur: '0xc3f2f91723b16b95bef0619b2504c049075d5b0b',
|
|
3986
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
|
3987
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
|
3988
|
+
// misc
|
|
3002
3989
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
|
3003
3990
|
eurs: '0x98ed26de6451db36246672df78ae7c50f2c76f6d',
|
|
3004
|
-
|
|
3991
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621'
|
|
3005
3992
|
};
|
|
3993
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
3994
|
+
|
|
3006
3995
|
function unlockWhale(_x) {
|
|
3007
3996
|
return _unlockWhale.apply(this, arguments);
|
|
3008
3997
|
}
|
|
@@ -3174,8 +4163,8 @@ function _relayTransaction() {
|
|
|
3174
4163
|
defaultMaxAcceptance = ethers.BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
|
3175
4164
|
|
|
3176
4165
|
mergedRelayRequest = {
|
|
3177
|
-
|
|
3178
|
-
|
|
4166
|
+
relayData: relayData,
|
|
4167
|
+
request: relayRequest
|
|
3179
4168
|
};
|
|
3180
4169
|
relayHub = new protocol.IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
|
3181
4170
|
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
|
@@ -3194,14 +4183,14 @@ var relayed = ethers.utils.EventFragment.fromString('TransactionRelayed(address
|
|
|
3194
4183
|
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)');
|
|
3195
4184
|
function assertDidRelay(receipt) {
|
|
3196
4185
|
return assertEvent(receipt, relayed, {
|
|
3197
|
-
|
|
3198
|
-
relayWorker: expect.any(String),
|
|
4186
|
+
charge: expect.anything(),
|
|
3199
4187
|
from: expect.any(String),
|
|
3200
|
-
to: expect.any(String),
|
|
3201
4188
|
paymaster: expect.any(String),
|
|
4189
|
+
relayManager: expect.any(String),
|
|
4190
|
+
relayWorker: expect.any(String),
|
|
3202
4191
|
selector: expect.any(String),
|
|
3203
4192
|
status: expect.anything(),
|
|
3204
|
-
|
|
4193
|
+
to: expect.any(String)
|
|
3205
4194
|
});
|
|
3206
4195
|
}
|
|
3207
4196
|
function assertDidRelaySuccessfully(receipt) {
|
|
@@ -3218,14 +4207,14 @@ function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
|
|
3218
4207
|
}
|
|
3219
4208
|
function assertPaymasterDidReject(receipt) {
|
|
3220
4209
|
return assertEvent(receipt, rejected, {
|
|
3221
|
-
relayManager: expect.any(String),
|
|
3222
|
-
paymaster: expect.any(String),
|
|
3223
4210
|
from: expect.any(String),
|
|
3224
|
-
|
|
4211
|
+
innerGasUsed: expect.anything(),
|
|
4212
|
+
paymaster: expect.any(String),
|
|
4213
|
+
reason: expect.any(String),
|
|
4214
|
+
relayManager: expect.any(String),
|
|
3225
4215
|
relayWorker: expect.any(String),
|
|
3226
4216
|
selector: expect.any(String),
|
|
3227
|
-
|
|
3228
|
-
reason: expect.any(String)
|
|
4217
|
+
to: expect.any(String)
|
|
3229
4218
|
});
|
|
3230
4219
|
}
|
|
3231
4220
|
function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
@@ -3235,12 +4224,13 @@ function assertPaymasterDidRejectForReason(receipt, reason) {
|
|
|
3235
4224
|
|
|
3236
4225
|
exports.CurveLiquidityGaugeV2 = CurveLiquidityGaugeV2;
|
|
3237
4226
|
exports.CurveMinter = CurveMinter;
|
|
4227
|
+
exports.CurveRegistry = CurveRegistry;
|
|
3238
4228
|
exports.CurveSwaps = CurveSwaps;
|
|
3239
4229
|
exports.ICompoundComptroller = ICompoundComptroller;
|
|
4230
|
+
exports.IUniswapV3NonFungibleTokenManager = IUniswapV3NonFungibleTokenManager;
|
|
3240
4231
|
exports.UniswapV2Factory = UniswapV2Factory;
|
|
3241
4232
|
exports.aaveLend = aaveLend;
|
|
3242
4233
|
exports.aaveRedeem = aaveRedeem;
|
|
3243
|
-
exports.addCollateral = addCollateral;
|
|
3244
4234
|
exports.addNewAssetsToFund = addNewAssetsToFund;
|
|
3245
4235
|
exports.addTrackedAssetsToVault = addTrackedAssetsToVault;
|
|
3246
4236
|
exports.assertDidRelay = assertDidRelay;
|
|
@@ -3251,12 +4241,16 @@ exports.assertEvent = assertEvent;
|
|
|
3251
4241
|
exports.assertNoEvent = assertNoEvent;
|
|
3252
4242
|
exports.assertPaymasterDidReject = assertPaymasterDidReject;
|
|
3253
4243
|
exports.assertPaymasterDidRejectForReason = assertPaymasterDidRejectForReason;
|
|
3254
|
-
exports.borrow = borrow;
|
|
3255
4244
|
exports.buyShares = buyShares;
|
|
3256
4245
|
exports.buySharesFunction = buySharesFunction;
|
|
3257
4246
|
exports.calcMlnValueAndBurnAmountForSharesBuyback = calcMlnValueAndBurnAmountForSharesBuyback;
|
|
3258
4247
|
exports.callOnExtension = callOnExtension;
|
|
3259
|
-
exports.
|
|
4248
|
+
exports.callOnExternalPosition = callOnExternalPosition;
|
|
4249
|
+
exports.compoundDebtPositionAddCollateral = compoundDebtPositionAddCollateral;
|
|
4250
|
+
exports.compoundDebtPositionBorrow = compoundDebtPositionBorrow;
|
|
4251
|
+
exports.compoundDebtPositionClaimComp = compoundDebtPositionClaimComp;
|
|
4252
|
+
exports.compoundDebtPositionRemoveCollateral = compoundDebtPositionRemoveCollateral;
|
|
4253
|
+
exports.compoundDebtPositionRepayBorrow = compoundDebtPositionRepayBorrow;
|
|
3260
4254
|
exports.compoundLend = compoundLend;
|
|
3261
4255
|
exports.compoundRedeem = compoundRedeem;
|
|
3262
4256
|
exports.createCompoundDebtPosition = createCompoundDebtPosition;
|
|
@@ -3267,6 +4261,7 @@ exports.createMigrationRequest = createMigrationRequest;
|
|
|
3267
4261
|
exports.createMockExternalPosition = createMockExternalPosition;
|
|
3268
4262
|
exports.createNewFund = createNewFund;
|
|
3269
4263
|
exports.createReconfigurationRequest = createReconfigurationRequest;
|
|
4264
|
+
exports.createUniswapV3LiquidityPosition = createUniswapV3LiquidityPosition;
|
|
3270
4265
|
exports.createVaultProxy = createVaultProxy;
|
|
3271
4266
|
exports.curveAaveClaimRewards = curveAaveClaimRewards;
|
|
3272
4267
|
exports.curveAaveLend = curveAaveLend;
|
|
@@ -3275,6 +4270,7 @@ exports.curveAaveRedeem = curveAaveRedeem;
|
|
|
3275
4270
|
exports.curveAaveStake = curveAaveStake;
|
|
3276
4271
|
exports.curveAaveUnstake = curveAaveUnstake;
|
|
3277
4272
|
exports.curveAaveUnstakeAndRedeem = curveAaveUnstakeAndRedeem;
|
|
4273
|
+
exports.curveClaimRewards = curveClaimRewards;
|
|
3278
4274
|
exports.curveEursClaimRewards = curveEursClaimRewards;
|
|
3279
4275
|
exports.curveEursLend = curveEursLend;
|
|
3280
4276
|
exports.curveEursLendAndStake = curveEursLendAndStake;
|
|
@@ -3282,6 +4278,9 @@ exports.curveEursRedeem = curveEursRedeem;
|
|
|
3282
4278
|
exports.curveEursStake = curveEursStake;
|
|
3283
4279
|
exports.curveEursUnstake = curveEursUnstake;
|
|
3284
4280
|
exports.curveEursUnstakeAndRedeem = curveEursUnstakeAndRedeem;
|
|
4281
|
+
exports.curveLend = curveLend;
|
|
4282
|
+
exports.curveLendAndStake = curveLendAndStake;
|
|
4283
|
+
exports.curveRedeem = curveRedeem;
|
|
3285
4284
|
exports.curveSethClaimRewards = curveSethClaimRewards;
|
|
3286
4285
|
exports.curveSethLend = curveSethLend;
|
|
3287
4286
|
exports.curveSethLendAndStake = curveSethLendAndStake;
|
|
@@ -3289,6 +4288,7 @@ exports.curveSethRedeem = curveSethRedeem;
|
|
|
3289
4288
|
exports.curveSethStake = curveSethStake;
|
|
3290
4289
|
exports.curveSethUnstake = curveSethUnstake;
|
|
3291
4290
|
exports.curveSethUnstakeAndRedeem = curveSethUnstakeAndRedeem;
|
|
4291
|
+
exports.curveStake = curveStake;
|
|
3292
4292
|
exports.curveStethClaimRewards = curveStethClaimRewards;
|
|
3293
4293
|
exports.curveStethLend = curveStethLend;
|
|
3294
4294
|
exports.curveStethLendAndStake = curveStethLendAndStake;
|
|
@@ -3297,7 +4297,8 @@ exports.curveStethStake = curveStethStake;
|
|
|
3297
4297
|
exports.curveStethUnstake = curveStethUnstake;
|
|
3298
4298
|
exports.curveStethUnstakeAndRedeem = curveStethUnstakeAndRedeem;
|
|
3299
4299
|
exports.curveTakeOrder = curveTakeOrder;
|
|
3300
|
-
exports.
|
|
4300
|
+
exports.curveUnstake = curveUnstake;
|
|
4301
|
+
exports.curveUnstakeAndRedeem = curveUnstakeAndRedeem;
|
|
3301
4302
|
exports.deployProtocolFixture = deployProtocolFixture;
|
|
3302
4303
|
exports.generateFeeManagerConfigWithMockFees = generateFeeManagerConfigWithMockFees;
|
|
3303
4304
|
exports.generateMockFees = generateMockFees;
|
|
@@ -3310,6 +4311,10 @@ exports.getUnnamedSigners = getUnnamedSigners;
|
|
|
3310
4311
|
exports.idleClaimRewards = idleClaimRewards;
|
|
3311
4312
|
exports.idleLend = idleLend;
|
|
3312
4313
|
exports.idleRedeem = idleRedeem;
|
|
4314
|
+
exports.mockExternalPositionAddDebtAssets = mockExternalPositionAddDebtAssets;
|
|
4315
|
+
exports.mockExternalPositionAddManagedAssets = mockExternalPositionAddManagedAssets;
|
|
4316
|
+
exports.mockExternalPositionRemoveDebtAssets = mockExternalPositionRemoveDebtAssets;
|
|
4317
|
+
exports.mockExternalPositionRemoveManagedAssets = mockExternalPositionRemoveManagedAssets;
|
|
3313
4318
|
exports.mockGenericRemoveOnlySelector = mockGenericRemoveOnlySelector;
|
|
3314
4319
|
exports.mockGenericSwap = mockGenericSwap;
|
|
3315
4320
|
exports.mockGenericSwapASelector = mockGenericSwapASelector;
|
|
@@ -3317,29 +4322,44 @@ exports.mockGenericSwapArgs = mockGenericSwapArgs;
|
|
|
3317
4322
|
exports.mockGenericSwapBSelector = mockGenericSwapBSelector;
|
|
3318
4323
|
exports.mockGenericSwapDirectFromVaultSelector = mockGenericSwapDirectFromVaultSelector;
|
|
3319
4324
|
exports.mockGenericSwapViaApprovalSelector = mockGenericSwapViaApprovalSelector;
|
|
4325
|
+
exports.olympusV2Stake = olympusV2Stake;
|
|
4326
|
+
exports.olympusV2Unstake = olympusV2Unstake;
|
|
3320
4327
|
exports.paraSwapV4GenerateDummyPaths = paraSwapV4GenerateDummyPaths;
|
|
3321
4328
|
exports.paraSwapV4TakeOrder = paraSwapV4TakeOrder;
|
|
4329
|
+
exports.paraSwapV5GenerateDummyPaths = paraSwapV5GenerateDummyPaths;
|
|
4330
|
+
exports.paraSwapV5TakeOrder = paraSwapV5TakeOrder;
|
|
4331
|
+
exports.poolTogetherV4ClaimRewards = poolTogetherV4ClaimRewards;
|
|
4332
|
+
exports.poolTogetherV4Lend = poolTogetherV4Lend;
|
|
4333
|
+
exports.poolTogetherV4Redeem = poolTogetherV4Redeem;
|
|
3322
4334
|
exports.reactivateExternalPosition = reactivateExternalPosition;
|
|
3323
4335
|
exports.redeemSharesForSpecificAssets = redeemSharesForSpecificAssets;
|
|
3324
4336
|
exports.redeemSharesInKind = redeemSharesInKind;
|
|
3325
4337
|
exports.relayTransaction = relayTransaction;
|
|
3326
|
-
exports.removeCollateral = removeCollateral;
|
|
3327
4338
|
exports.removeExternalPosition = removeExternalPosition;
|
|
3328
4339
|
exports.removeTrackedAssetsFromVault = removeTrackedAssetsFromVault;
|
|
3329
|
-
exports.repayBorrow = repayBorrow;
|
|
3330
4340
|
exports.setupGasRelayerPaymaster = setupGasRelayerPaymaster;
|
|
3331
4341
|
exports.synthetixAssignExchangeDelegate = synthetixAssignExchangeDelegate;
|
|
4342
|
+
exports.synthetixRedeem = synthetixRedeem;
|
|
3332
4343
|
exports.synthetixResolveAddress = synthetixResolveAddress;
|
|
3333
4344
|
exports.synthetixTakeOrder = synthetixTakeOrder;
|
|
3334
4345
|
exports.transactionTimestamp = transactionTimestamp;
|
|
3335
4346
|
exports.uniswapV2Lend = uniswapV2Lend;
|
|
3336
4347
|
exports.uniswapV2Redeem = uniswapV2Redeem;
|
|
3337
4348
|
exports.uniswapV2TakeOrder = uniswapV2TakeOrder;
|
|
4349
|
+
exports.uniswapV3LiquidityPositionAddLiquidity = uniswapV3LiquidityPositionAddLiquidity;
|
|
4350
|
+
exports.uniswapV3LiquidityPositionCollect = uniswapV3LiquidityPositionCollect;
|
|
4351
|
+
exports.uniswapV3LiquidityPositionGetMaxTick = uniswapV3LiquidityPositionGetMaxTick;
|
|
4352
|
+
exports.uniswapV3LiquidityPositionGetMinTick = uniswapV3LiquidityPositionGetMinTick;
|
|
4353
|
+
exports.uniswapV3LiquidityPositionMint = uniswapV3LiquidityPositionMint;
|
|
4354
|
+
exports.uniswapV3LiquidityPositionPurge = uniswapV3LiquidityPositionPurge;
|
|
4355
|
+
exports.uniswapV3LiquidityPositionRemoveLiquidity = uniswapV3LiquidityPositionRemoveLiquidity;
|
|
4356
|
+
exports.uniswapV3OrderTokenPair = uniswapV3OrderTokenPair;
|
|
3338
4357
|
exports.uniswapV3TakeOrder = uniswapV3TakeOrder;
|
|
3339
4358
|
exports.unlockAllWhales = unlockAllWhales;
|
|
3340
4359
|
exports.unlockWhale = unlockWhale;
|
|
3341
4360
|
exports.unlockWhales = unlockWhales;
|
|
3342
4361
|
exports.updateChainlinkAggregator = updateChainlinkAggregator;
|
|
4362
|
+
exports.vaultCallCreateNewList = vaultCallCreateNewList;
|
|
3343
4363
|
exports.vaultCallCurveMinterMint = vaultCallCurveMinterMint;
|
|
3344
4364
|
exports.vaultCallCurveMinterMintMany = vaultCallCurveMinterMintMany;
|
|
3345
4365
|
exports.vaultCallCurveMinterToggleApproveMint = vaultCallCurveMinterToggleApproveMint;
|