@enzymefinance/testutils 4.0.0-next.7 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1553 -0
- package/dist/index.js +3352 -0
- package/dist/index.mjs +3352 -0
- package/package.json +74 -11
- package/CHANGELOG.md +0 -60
- package/dist/declarations/src/assertions.d.ts +0 -4
- package/dist/declarations/src/deployment.d.ts +0 -195
- package/dist/declarations/src/gasRelayer.d.ts +0 -56
- package/dist/declarations/src/helpers.d.ts +0 -16
- package/dist/declarations/src/index.d.ts +0 -6
- package/dist/declarations/src/scaffolding/assets.d.ts +0 -10
- package/dist/declarations/src/scaffolding/chainlink.d.ts +0 -3
- package/dist/declarations/src/scaffolding/common.d.ts +0 -7
- package/dist/declarations/src/scaffolding/core.d.ts +0 -16
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +0 -11
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +0 -36
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +0 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +0 -100
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +0 -12
- package/dist/declarations/src/scaffolding/extensions/index.d.ts +0 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +0 -20
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +0 -288
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +0 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +0 -32
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +0 -17
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +0 -23
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +0 -23
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +0 -29
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +0 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +0 -46
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +0 -22
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +0 -12
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +0 -17
- package/dist/declarations/src/scaffolding/index.d.ts +0 -8
- package/dist/declarations/src/scaffolding/setup.d.ts +0 -77
- package/dist/declarations/src/scaffolding/shares.d.ts +0 -35
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +0 -32
- package/dist/declarations/src/whales.d.ts +0 -49
- package/dist/enzymefinance-testutils.browser.cjs.js +0 -4428
- package/dist/enzymefinance-testutils.browser.esm.js +0 -4281
- package/dist/enzymefinance-testutils.cjs.d.ts +0 -1
- package/dist/enzymefinance-testutils.cjs.dev.js +0 -4428
- package/dist/enzymefinance-testutils.cjs.js +0 -7
- package/dist/enzymefinance-testutils.cjs.prod.js +0 -4428
- package/dist/enzymefinance-testutils.esm.js +0 -4281
- package/src/assertions.ts +0 -23
- package/src/deployment.ts +0 -289
- package/src/gasRelayer.ts +0 -95
- package/src/helpers.ts +0 -39
- package/src/index.ts +0 -6
- package/src/scaffolding/assets.ts +0 -37
- package/src/scaffolding/chainlink.ts +0 -8
- package/src/scaffolding/common.ts +0 -11
- package/src/scaffolding/core.ts +0 -103
- package/src/scaffolding/extensions/common.ts +0 -30
- package/src/scaffolding/extensions/external-positions/actions.ts +0 -108
- package/src/scaffolding/extensions/external-positions/compound.ts +0 -190
- package/src/scaffolding/extensions/external-positions/index.ts +0 -4
- package/src/scaffolding/extensions/external-positions/mocks.ts +0 -191
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +0 -284
- package/src/scaffolding/extensions/fees.ts +0 -70
- package/src/scaffolding/extensions/index.ts +0 -5
- package/src/scaffolding/extensions/integrations/aave.ts +0 -78
- package/src/scaffolding/extensions/integrations/compound.ts +0 -255
- package/src/scaffolding/extensions/integrations/curve.ts +0 -1029
- package/src/scaffolding/extensions/integrations/idle.ts +0 -104
- package/src/scaffolding/extensions/integrations/index.ts +0 -15
- package/src/scaffolding/extensions/integrations/mock.ts +0 -116
- package/src/scaffolding/extensions/integrations/olympusV2.ts +0 -71
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +0 -70
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +0 -73
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +0 -117
- package/src/scaffolding/extensions/integrations/synthetix.ts +0 -111
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +0 -48
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +0 -175
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +0 -55
- package/src/scaffolding/extensions/integrations/yearn.ts +0 -79
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +0 -47
- package/src/scaffolding/extensions/policies.ts +0 -112
- package/src/scaffolding/index.ts +0 -8
- package/src/scaffolding/setup.ts +0 -243
- package/src/scaffolding/shares.ts +0 -80
- package/src/scaffolding/vaultCalls.ts +0 -105
- package/src/types.d.ts +0 -2
- package/src/whales.ts +0 -82
- package/tsconfig.json +0 -5
@@ -1,4428 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
6
|
-
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
7
|
-
var protocol = require('@enzymefinance/protocol');
|
8
|
-
var ethers = require('ethers');
|
9
|
-
var ethers$1 = require('@enzymefinance/ethers');
|
10
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
11
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
12
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
13
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
14
|
-
|
15
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
16
|
-
|
17
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
|
18
|
-
|
19
|
-
function getNamedSigner(_x) {
|
20
|
-
return _getNamedSigner.apply(this, arguments);
|
21
|
-
}
|
22
|
-
|
23
|
-
function _getNamedSigner() {
|
24
|
-
_getNamedSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(name) {
|
25
|
-
var accounts;
|
26
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
27
|
-
while (1) {
|
28
|
-
switch (_context.prev = _context.next) {
|
29
|
-
case 0:
|
30
|
-
_context.next = 2;
|
31
|
-
return hre.getNamedAccounts();
|
32
|
-
|
33
|
-
case 2:
|
34
|
-
accounts = _context.sent;
|
35
|
-
|
36
|
-
if (accounts[name]) {
|
37
|
-
_context.next = 5;
|
38
|
-
break;
|
39
|
-
}
|
40
|
-
|
41
|
-
throw new Error("Missing account with name ".concat(name));
|
42
|
-
|
43
|
-
case 5:
|
44
|
-
return _context.abrupt("return", provider.getSignerWithAddress(accounts[name]));
|
45
|
-
|
46
|
-
case 6:
|
47
|
-
case "end":
|
48
|
-
return _context.stop();
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}, _callee);
|
52
|
-
}));
|
53
|
-
return _getNamedSigner.apply(this, arguments);
|
54
|
-
}
|
55
|
-
|
56
|
-
function getUnnamedSigners() {
|
57
|
-
return _getUnnamedSigners.apply(this, arguments);
|
58
|
-
}
|
59
|
-
|
60
|
-
function _getUnnamedSigners() {
|
61
|
-
_getUnnamedSigners = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
62
|
-
var accounts;
|
63
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
64
|
-
while (1) {
|
65
|
-
switch (_context2.prev = _context2.next) {
|
66
|
-
case 0:
|
67
|
-
_context2.next = 2;
|
68
|
-
return hre.getUnnamedAccounts();
|
69
|
-
|
70
|
-
case 2:
|
71
|
-
accounts = _context2.sent;
|
72
|
-
return _context2.abrupt("return", Promise.all(accounts.map(function (account) {
|
73
|
-
return provider.getSignerWithAddress(account);
|
74
|
-
})));
|
75
|
-
|
76
|
-
case 4:
|
77
|
-
case "end":
|
78
|
-
return _context2.stop();
|
79
|
-
}
|
80
|
-
}
|
81
|
-
}, _callee2);
|
82
|
-
}));
|
83
|
-
return _getUnnamedSigners.apply(this, arguments);
|
84
|
-
}
|
85
|
-
|
86
|
-
function deployProtocolFixture() {
|
87
|
-
return _deployProtocolFixture.apply(this, arguments);
|
88
|
-
}
|
89
|
-
|
90
|
-
function _deployProtocolFixture() {
|
91
|
-
_deployProtocolFixture = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
92
|
-
var fixture, deployer, accounts, config, deployment;
|
93
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
94
|
-
while (1) {
|
95
|
-
switch (_context3.prev = _context3.next) {
|
96
|
-
case 0:
|
97
|
-
_context3.next = 2;
|
98
|
-
return hre.deployments.fixture();
|
99
|
-
|
100
|
-
case 2:
|
101
|
-
fixture = _context3.sent;
|
102
|
-
_context3.next = 5;
|
103
|
-
return getNamedSigner('deployer');
|
104
|
-
|
105
|
-
case 5:
|
106
|
-
deployer = _context3.sent;
|
107
|
-
_context3.next = 8;
|
108
|
-
return getUnnamedSigners();
|
109
|
-
|
110
|
-
case 8:
|
111
|
-
accounts = _context3.sent;
|
112
|
-
config = fixture['Config'].linkedData; // prettier-ignore
|
113
|
-
|
114
|
-
deployment = {
|
115
|
-
aaveAdapter: new protocol.AaveAdapter(fixture['AaveAdapter'].address, deployer),
|
116
|
-
aavePriceFeed: new protocol.AavePriceFeed(fixture['AavePriceFeed'].address, deployer),
|
117
|
-
addressListRegistry: new protocol.AddressListRegistry(fixture['AddressListRegistry'].address, deployer),
|
118
|
-
allowedAdapterIncomingAssetsPolicy: new protocol.AllowedAdapterIncomingAssetsPolicy(fixture['AllowedAdapterIncomingAssetsPolicy'].address, deployer),
|
119
|
-
allowedAdaptersPolicy: new protocol.AllowedAdaptersPolicy(fixture['AllowedAdaptersPolicy'].address, deployer),
|
120
|
-
allowedAssetsForRedemptionPolicy: new protocol.AllowedAssetsForRedemptionPolicy(fixture['AllowedAssetsForRedemptionPolicy'].address, deployer),
|
121
|
-
allowedDepositRecipientsPolicy: new protocol.AllowedDepositRecipientsPolicy(fixture['AllowedDepositRecipientsPolicy'].address, deployer),
|
122
|
-
allowedExternalPositionTypesPolicy: new protocol.AllowedExternalPositionTypesPolicy(fixture['AllowedExternalPositionTypesPolicy'].address, deployer),
|
123
|
-
allowedSharesTransferRecipientsPolicy: new protocol.AllowedSharesTransferRecipientsPolicy(fixture['AllowedSharesTransferRecipientsPolicy'].address, deployer),
|
124
|
-
compoundAdapter: new protocol.CompoundAdapter(fixture['CompoundAdapter'].address, deployer),
|
125
|
-
compoundDebtPositionLib: new protocol.CompoundDebtPositionLib(fixture['CompoundDebtPositionLib'].address, deployer),
|
126
|
-
compoundDebtPositionParser: new protocol.CompoundDebtPositionParser(fixture['CompoundDebtPositionParser'].address, deployer),
|
127
|
-
compoundPriceFeed: new protocol.CompoundPriceFeed(fixture['CompoundPriceFeed'].address, deployer),
|
128
|
-
comptrollerLib: new protocol.ComptrollerLib(fixture['ComptrollerLib'].address, deployer),
|
129
|
-
convexCurveLpStakingAdapter: new protocol.ConvexCurveLpStakingAdapter(fixture['ConvexCurveLpStakingAdapter'].address, deployer),
|
130
|
-
convexCurveLpStakingWrapperFactory: new protocol.ConvexCurveLpStakingWrapperFactory(fixture['ConvexCurveLpStakingWrapperFactory'].address, deployer),
|
131
|
-
convexCurveLpStakingWrapperPriceFeed: new protocol.ConvexCurveLpStakingWrapperPriceFeed(fixture['ConvexCurveLpStakingWrapperPriceFeed'].address, deployer),
|
132
|
-
cumulativeSlippageTolerancePolicy: new protocol.CumulativeSlippageTolerancePolicy(fixture['CumulativeSlippageTolerancePolicy'].address, deployer),
|
133
|
-
curveExchangeAdapter: new protocol.CurveExchangeAdapter(fixture['CurveExchangeAdapter'].address, deployer),
|
134
|
-
curveLiquidityAaveAdapter: new protocol.CurveLiquidityAaveAdapter(fixture['CurveLiquidityAaveAdapter'].address, deployer),
|
135
|
-
curveLiquidityAdapter: new protocol.CurveLiquidityAdapter(fixture['CurveLiquidityAdapter'].address, deployer),
|
136
|
-
curveLiquiditySethAdapter: new protocol.CurveLiquiditySethAdapter(fixture['CurveLiquiditySethAdapter'].address, deployer),
|
137
|
-
curveLiquidityStethAdapter: new protocol.CurveLiquidityStethAdapter(fixture['CurveLiquidityStethAdapter'].address, deployer),
|
138
|
-
curvePriceFeed: new protocol.CurvePriceFeed(fixture['CurvePriceFeed'].address, deployer),
|
139
|
-
depositWrapper: new protocol.DepositWrapper(fixture['DepositWrapper'].address, deployer),
|
140
|
-
dispatcher: new protocol.Dispatcher(fixture['Dispatcher'].address, deployer),
|
141
|
-
entranceRateBurnFee: new protocol.EntranceRateBurnFee(fixture['EntranceRateBurnFee'].address, deployer),
|
142
|
-
entranceRateDirectFee: new protocol.EntranceRateDirectFee(fixture['EntranceRateDirectFee'].address, deployer),
|
143
|
-
exitRateBurnFee: new protocol.ExitRateBurnFee(fixture['ExitRateBurnFee'].address, deployer),
|
144
|
-
exitRateDirectFee: new protocol.ExitRateDirectFee(fixture['ExitRateDirectFee'].address, deployer),
|
145
|
-
externalPositionFactory: new protocol.ExternalPositionFactory(fixture['ExternalPositionFactory'].address, deployer),
|
146
|
-
externalPositionManager: new protocol.ExternalPositionManager(fixture['ExternalPositionManager'].address, deployer),
|
147
|
-
feeManager: new protocol.FeeManager(fixture['FeeManager'].address, deployer),
|
148
|
-
fundDeployer: new protocol.FundDeployer(fixture['FundDeployer'].address, deployer),
|
149
|
-
fundValueCalculator: new protocol.FundValueCalculator(fixture['FundValueCalculator'].address, deployer),
|
150
|
-
fundValueCalculatorRouter: new protocol.FundValueCalculatorRouter(fixture['FundValueCalculatorRouter'].address, deployer),
|
151
|
-
fundValueCalculatorUsdWrapper: new protocol.FundValueCalculatorUsdWrapper(fixture['FundValueCalculatorUsdWrapper'].address, deployer),
|
152
|
-
fuseAdapter: new protocol.FuseAdapter(fixture['FuseAdapter'].address, deployer),
|
153
|
-
fusePriceFeed: new protocol.FusePriceFeed(fixture['FusePriceFeed'].address, deployer),
|
154
|
-
gasRelayPaymasterFactory: new protocol.GasRelayPaymasterFactory(fixture['GasRelayPaymasterFactory'].address, deployer),
|
155
|
-
idleAdapter: new protocol.IdleAdapter(fixture['IdleAdapter'].address, deployer),
|
156
|
-
idlePriceFeed: new protocol.IdlePriceFeed(fixture['IdlePriceFeed'].address, deployer),
|
157
|
-
integrationManager: new protocol.IntegrationManager(fixture['IntegrationManager'].address, deployer),
|
158
|
-
lidoStethPriceFeed: new protocol.LidoStethPriceFeed(fixture['LidoStethPriceFeed'].address, deployer),
|
159
|
-
managementFee: new protocol.ManagementFee(fixture['ManagementFee'].address, deployer),
|
160
|
-
minAssetBalancesPostRedemptionPolicy: new protocol.MinAssetBalancesPostRedemptionPolicy(fixture['MinAssetBalancesPostRedemptionPolicy'].address, deployer),
|
161
|
-
minMaxInvestmentPolicy: new protocol.MinMaxInvestmentPolicy(fixture['MinMaxInvestmentPolicy'].address, deployer),
|
162
|
-
olympusV2Adapter: new protocol.OlympusV2Adapter(fixture['OlympusV2Adapter'].address, deployer),
|
163
|
-
onlyRemoveDustExternalPositionPolicy: new protocol.OnlyRemoveDustExternalPositionPolicy(fixture['OnlyRemoveDustExternalPositionPolicy'].address, deployer),
|
164
|
-
onlyUntrackDustOrPricelessAssetsPolicy: new protocol.OnlyUntrackDustOrPricelessAssetsPolicy(fixture['OnlyUntrackDustOrPricelessAssetsPolicy'].address, deployer),
|
165
|
-
paraSwapV4Adapter: new protocol.ParaSwapV4Adapter(fixture['ParaSwapV4Adapter'].address, deployer),
|
166
|
-
paraSwapV5Adapter: new protocol.ParaSwapV5Adapter(fixture['ParaSwapV5Adapter'].address, deployer),
|
167
|
-
performanceFee: new protocol.PerformanceFee(fixture['PerformanceFee'].address, deployer),
|
168
|
-
policyManager: new protocol.PolicyManager(fixture['PolicyManager'].address, deployer),
|
169
|
-
poolTogetherV4Adapter: new protocol.PoolTogetherV4Adapter(fixture['PoolTogetherV4Adapter'].address, deployer),
|
170
|
-
poolTogetherV4PriceFeed: new protocol.PoolTogetherV4PriceFeed(fixture['PoolTogetherV4PriceFeed'].address, deployer),
|
171
|
-
protocolFeeReserveLib: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveLib'].address, deployer),
|
172
|
-
protocolFeeReserveProxy: new protocol.ProtocolFeeReserveLib(fixture['ProtocolFeeReserveProxy'].address, deployer),
|
173
|
-
protocolFeeTracker: new protocol.ProtocolFeeTracker(fixture['ProtocolFeeTracker'].address, deployer),
|
174
|
-
revertingPriceFeed: new protocol.RevertingPriceFeed(fixture['RevertingPriceFeed'].address, deployer),
|
175
|
-
stakehoundEthPriceFeed: new protocol.StakehoundEthPriceFeed(fixture['StakehoundEthPriceFeed'].address, deployer),
|
176
|
-
synthetixAdapter: new protocol.SynthetixAdapter(fixture['SynthetixAdapter'].address, deployer),
|
177
|
-
uniswapV2ExchangeAdapter: new protocol.UniswapV2ExchangeAdapter(fixture['UniswapV2ExchangeAdapter'].address, deployer),
|
178
|
-
uniswapV2LiquidityAdapter: new protocol.UniswapV2LiquidityAdapter(fixture['UniswapV2LiquidityAdapter'].address, deployer),
|
179
|
-
uniswapV2PoolPriceFeed: new protocol.UniswapV2PoolPriceFeed(fixture['UniswapV2PoolPriceFeed'].address, deployer),
|
180
|
-
uniswapV3Adapter: new protocol.UniswapV3Adapter(fixture['UniswapV3Adapter'].address, deployer),
|
181
|
-
unpermissionedActionsWrapper: new protocol.UnpermissionedActionsWrapper(fixture['UnpermissionedActionsWrapper'].address, deployer),
|
182
|
-
valueInterpreter: new protocol.ValueInterpreter(fixture['ValueInterpreter'].address, deployer),
|
183
|
-
vaultLib: new protocol.VaultLib(fixture['VaultLib'].address, deployer),
|
184
|
-
yearnVaultV2Adapter: new protocol.YearnVaultV2Adapter(fixture['YearnVaultV2Adapter'].address, deployer),
|
185
|
-
yearnVaultV2PriceFeed: new protocol.YearnVaultV2PriceFeed(fixture['YearnVaultV2PriceFeed'].address, deployer),
|
186
|
-
zeroExV2Adapter: new protocol.ZeroExV2Adapter(fixture['ZeroExV2Adapter'].address, deployer)
|
187
|
-
};
|
188
|
-
return _context3.abrupt("return", {
|
189
|
-
accounts: accounts,
|
190
|
-
config: config,
|
191
|
-
deployer: deployer,
|
192
|
-
deployment: deployment
|
193
|
-
});
|
194
|
-
|
195
|
-
case 12:
|
196
|
-
case "end":
|
197
|
-
return _context3.stop();
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}, _callee3);
|
201
|
-
}));
|
202
|
-
return _deployProtocolFixture.apply(this, arguments);
|
203
|
-
}
|
204
|
-
|
205
|
-
function addTrackedAssetsToVault(_ref) {
|
206
|
-
var signer = _ref.signer,
|
207
|
-
comptrollerProxy = _ref.comptrollerProxy,
|
208
|
-
integrationManager = _ref.integrationManager,
|
209
|
-
assets = _ref.assets;
|
210
|
-
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.AddTrackedAssetsToVault, protocol.addTrackedAssetsToVaultArgs({
|
211
|
-
assets: assets
|
212
|
-
}));
|
213
|
-
}
|
214
|
-
function removeTrackedAssetsFromVault(_ref2) {
|
215
|
-
var signer = _ref2.signer,
|
216
|
-
comptrollerProxy = _ref2.comptrollerProxy,
|
217
|
-
integrationManager = _ref2.integrationManager,
|
218
|
-
assets = _ref2.assets;
|
219
|
-
return comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.RemoveTrackedAssetsFromVault, protocol.removeTrackedAssetsFromVaultArgs({
|
220
|
-
assets: assets
|
221
|
-
}));
|
222
|
-
}
|
223
|
-
|
224
|
-
function addNewAssetsToFund(_x) {
|
225
|
-
return _addNewAssetsToFund.apply(this, arguments);
|
226
|
-
}
|
227
|
-
|
228
|
-
function _addNewAssetsToFund() {
|
229
|
-
_addNewAssetsToFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
230
|
-
var signer, comptrollerProxy, integrationManager, assets, _ref$amounts, amounts, receipt, vaultProxy, i;
|
231
|
-
|
232
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
233
|
-
while (1) {
|
234
|
-
switch (_context.prev = _context.next) {
|
235
|
-
case 0:
|
236
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, assets = _ref.assets, _ref$amounts = _ref.amounts, amounts = _ref$amounts === void 0 ? new Array(assets.length).fill(1) : _ref$amounts;
|
237
|
-
// First, add tracked assets
|
238
|
-
receipt = addTrackedAssetsToVault({
|
239
|
-
assets: assets,
|
240
|
-
comptrollerProxy: comptrollerProxy,
|
241
|
-
integrationManager: integrationManager,
|
242
|
-
signer: signer
|
243
|
-
}); // Then seed the vault with balances as necessary
|
244
|
-
|
245
|
-
_context.next = 4;
|
246
|
-
return comptrollerProxy.getVaultProxy();
|
247
|
-
|
248
|
-
case 4:
|
249
|
-
vaultProxy = _context.sent;
|
250
|
-
_context.t0 = _regeneratorRuntime__default['default'].keys(assets);
|
251
|
-
|
252
|
-
case 6:
|
253
|
-
if ((_context.t1 = _context.t0()).done) {
|
254
|
-
_context.next = 13;
|
255
|
-
break;
|
256
|
-
}
|
257
|
-
|
258
|
-
i = _context.t1.value;
|
259
|
-
|
260
|
-
if (!(amounts[i] > 0)) {
|
261
|
-
_context.next = 11;
|
262
|
-
break;
|
263
|
-
}
|
264
|
-
|
265
|
-
_context.next = 11;
|
266
|
-
return assets[i].transfer(vaultProxy, amounts[i]);
|
267
|
-
|
268
|
-
case 11:
|
269
|
-
_context.next = 6;
|
270
|
-
break;
|
271
|
-
|
272
|
-
case 13:
|
273
|
-
return _context.abrupt("return", receipt);
|
274
|
-
|
275
|
-
case 14:
|
276
|
-
case "end":
|
277
|
-
return _context.stop();
|
278
|
-
}
|
279
|
-
}
|
280
|
-
}, _callee);
|
281
|
-
}));
|
282
|
-
return _addNewAssetsToFund.apply(this, arguments);
|
283
|
-
}
|
284
|
-
|
285
|
-
function updateChainlinkAggregator(_x, _x2) {
|
286
|
-
return _updateChainlinkAggregator.apply(this, arguments);
|
287
|
-
}
|
288
|
-
|
289
|
-
function _updateChainlinkAggregator() {
|
290
|
-
_updateChainlinkAggregator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(aggregator, price) {
|
291
|
-
var answer, block;
|
292
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
293
|
-
while (1) {
|
294
|
-
switch (_context.prev = _context.next) {
|
295
|
-
case 0:
|
296
|
-
if (!(price !== null && price !== void 0)) {
|
297
|
-
_context.next = 4;
|
298
|
-
break;
|
299
|
-
}
|
300
|
-
|
301
|
-
_context.t0 = price;
|
302
|
-
_context.next = 7;
|
303
|
-
break;
|
304
|
-
|
305
|
-
case 4:
|
306
|
-
_context.next = 6;
|
307
|
-
return aggregator.latestAnswer();
|
308
|
-
|
309
|
-
case 6:
|
310
|
-
_context.t0 = _context.sent;
|
311
|
-
|
312
|
-
case 7:
|
313
|
-
answer = _context.t0;
|
314
|
-
_context.next = 10;
|
315
|
-
return aggregator.provider.getBlock('latest');
|
316
|
-
|
317
|
-
case 10:
|
318
|
-
block = _context.sent;
|
319
|
-
_context.next = 13;
|
320
|
-
return aggregator.setLatestAnswer(answer, block.timestamp);
|
321
|
-
|
322
|
-
case 13:
|
323
|
-
case "end":
|
324
|
-
return _context.stop();
|
325
|
-
}
|
326
|
-
}
|
327
|
-
}, _callee);
|
328
|
-
}));
|
329
|
-
return _updateChainlinkAggregator.apply(this, arguments);
|
330
|
-
}
|
331
|
-
|
332
|
-
function getAssetBalances(_x) {
|
333
|
-
return _getAssetBalances.apply(this, arguments);
|
334
|
-
}
|
335
|
-
|
336
|
-
function _getAssetBalances() {
|
337
|
-
_getAssetBalances = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
338
|
-
var account, assets;
|
339
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
340
|
-
while (1) {
|
341
|
-
switch (_context.prev = _context.next) {
|
342
|
-
case 0:
|
343
|
-
account = _ref.account, assets = _ref.assets;
|
344
|
-
return _context.abrupt("return", Promise.all(assets.map(function (asset) {
|
345
|
-
return new protocol.StandardToken(asset, provider).balanceOf(account);
|
346
|
-
})));
|
347
|
-
|
348
|
-
case 2:
|
349
|
-
case "end":
|
350
|
-
return _context.stop();
|
351
|
-
}
|
352
|
-
}
|
353
|
-
}, _callee);
|
354
|
-
}));
|
355
|
-
return _getAssetBalances.apply(this, arguments);
|
356
|
-
}
|
357
|
-
|
358
|
-
function getAssetUnit(_x2) {
|
359
|
-
return _getAssetUnit.apply(this, arguments);
|
360
|
-
}
|
361
|
-
|
362
|
-
function _getAssetUnit() {
|
363
|
-
_getAssetUnit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(asset) {
|
364
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
365
|
-
while (1) {
|
366
|
-
switch (_context2.prev = _context2.next) {
|
367
|
-
case 0:
|
368
|
-
_context2.t0 = ethers.utils;
|
369
|
-
_context2.next = 3;
|
370
|
-
return asset.decimals();
|
371
|
-
|
372
|
-
case 3:
|
373
|
-
_context2.t1 = _context2.sent;
|
374
|
-
return _context2.abrupt("return", _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1));
|
375
|
-
|
376
|
-
case 5:
|
377
|
-
case "end":
|
378
|
-
return _context2.stop();
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}, _callee2);
|
382
|
-
}));
|
383
|
-
return _getAssetUnit.apply(this, arguments);
|
384
|
-
}
|
385
|
-
|
386
|
-
// TODO: Should refactor this function to take all deployment contracts and set up everything by default,
|
387
|
-
// unless overrides are passed-in
|
388
|
-
function createFundDeployer(_x) {
|
389
|
-
return _createFundDeployer.apply(this, arguments);
|
390
|
-
}
|
391
|
-
|
392
|
-
function _createFundDeployer() {
|
393
|
-
_createFundDeployer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
394
|
-
var deployer, externalPositionManager, dispatcher, gasRelayPaymasterFactory, valueInterpreter, vaultLib, _ref$setOnDispatcher, setOnDispatcher, _ref$setReleaseLive, setReleaseLive, mlnToken, wethToken, protocolFeeReserve, nextFundDeployer, nextPolicyManager, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextComptrollerLib, nextProtocolFeeTracker, nextVaultLib;
|
395
|
-
|
396
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
397
|
-
while (1) {
|
398
|
-
switch (_context.prev = _context.next) {
|
399
|
-
case 0:
|
400
|
-
deployer = _ref.deployer, externalPositionManager = _ref.externalPositionManager, dispatcher = _ref.dispatcher, gasRelayPaymasterFactory = _ref.gasRelayPaymasterFactory, valueInterpreter = _ref.valueInterpreter, vaultLib = _ref.vaultLib, _ref$setOnDispatcher = _ref.setOnDispatcher, setOnDispatcher = _ref$setOnDispatcher === void 0 ? true : _ref$setOnDispatcher, _ref$setReleaseLive = _ref.setReleaseLive, setReleaseLive = _ref$setReleaseLive === void 0 ? true : _ref$setReleaseLive;
|
401
|
-
_context.next = 3;
|
402
|
-
return vaultLib.getMlnToken();
|
403
|
-
|
404
|
-
case 3:
|
405
|
-
mlnToken = _context.sent;
|
406
|
-
_context.next = 6;
|
407
|
-
return vaultLib.getWethToken();
|
408
|
-
|
409
|
-
case 6:
|
410
|
-
wethToken = _context.sent;
|
411
|
-
_context.next = 9;
|
412
|
-
return vaultLib.getProtocolFeeReserve();
|
413
|
-
|
414
|
-
case 9:
|
415
|
-
protocolFeeReserve = _context.sent;
|
416
|
-
_context.next = 12;
|
417
|
-
return protocol.FundDeployer.deploy(deployer, dispatcher, gasRelayPaymasterFactory);
|
418
|
-
|
419
|
-
case 12:
|
420
|
-
nextFundDeployer = _context.sent;
|
421
|
-
_context.next = 15;
|
422
|
-
return protocol.PolicyManager.deploy(deployer, nextFundDeployer, gasRelayPaymasterFactory);
|
423
|
-
|
424
|
-
case 15:
|
425
|
-
nextPolicyManager = _context.sent;
|
426
|
-
_context.t0 = protocol.ExternalPositionManager;
|
427
|
-
_context.t1 = deployer;
|
428
|
-
_context.t2 = nextFundDeployer;
|
429
|
-
_context.next = 21;
|
430
|
-
return externalPositionManager.getExternalPositionFactory();
|
431
|
-
|
432
|
-
case 21:
|
433
|
-
_context.t3 = _context.sent;
|
434
|
-
_context.t4 = nextPolicyManager;
|
435
|
-
_context.next = 25;
|
436
|
-
return _context.t0.deploy.call(_context.t0, _context.t1, _context.t2, _context.t3, _context.t4);
|
437
|
-
|
438
|
-
case 25:
|
439
|
-
nextExternalPositionManager = _context.sent;
|
440
|
-
_context.next = 28;
|
441
|
-
return protocol.FeeManager.deploy(deployer, nextFundDeployer);
|
442
|
-
|
443
|
-
case 28:
|
444
|
-
nextFeeManager = _context.sent;
|
445
|
-
_context.next = 31;
|
446
|
-
return protocol.IntegrationManager.deploy(deployer, nextFundDeployer, nextPolicyManager, valueInterpreter);
|
447
|
-
|
448
|
-
case 31:
|
449
|
-
nextIntegrationManager = _context.sent;
|
450
|
-
_context.next = 34;
|
451
|
-
return protocol.ComptrollerLib.deploy(deployer, dispatcher, protocolFeeReserve, nextFundDeployer, valueInterpreter, nextExternalPositionManager, nextFeeManager, nextIntegrationManager, nextPolicyManager, gasRelayPaymasterFactory, mlnToken, wethToken);
|
452
|
-
|
453
|
-
case 34:
|
454
|
-
nextComptrollerLib = _context.sent;
|
455
|
-
_context.next = 37;
|
456
|
-
return nextFundDeployer.setComptrollerLib(nextComptrollerLib);
|
457
|
-
|
458
|
-
case 37:
|
459
|
-
_context.next = 39;
|
460
|
-
return protocol.ProtocolFeeTracker.deploy(deployer, nextFundDeployer);
|
461
|
-
|
462
|
-
case 39:
|
463
|
-
nextProtocolFeeTracker = _context.sent;
|
464
|
-
_context.next = 42;
|
465
|
-
return nextFundDeployer.setProtocolFeeTracker(nextProtocolFeeTracker);
|
466
|
-
|
467
|
-
case 42:
|
468
|
-
_context.t5 = protocol.VaultLib;
|
469
|
-
_context.t6 = deployer;
|
470
|
-
_context.t7 = externalPositionManager;
|
471
|
-
_context.next = 47;
|
472
|
-
return vaultLib.getGasRelayPaymasterFactory();
|
473
|
-
|
474
|
-
case 47:
|
475
|
-
_context.t8 = _context.sent;
|
476
|
-
_context.next = 50;
|
477
|
-
return vaultLib.getProtocolFeeReserve();
|
478
|
-
|
479
|
-
case 50:
|
480
|
-
_context.t9 = _context.sent;
|
481
|
-
_context.t10 = nextProtocolFeeTracker;
|
482
|
-
_context.next = 54;
|
483
|
-
return vaultLib.getMlnToken();
|
484
|
-
|
485
|
-
case 54:
|
486
|
-
_context.t11 = _context.sent;
|
487
|
-
_context.next = 57;
|
488
|
-
return vaultLib.getMlnBurner();
|
489
|
-
|
490
|
-
case 57:
|
491
|
-
_context.t12 = _context.sent;
|
492
|
-
_context.next = 60;
|
493
|
-
return vaultLib.getWethToken();
|
494
|
-
|
495
|
-
case 60:
|
496
|
-
_context.t13 = _context.sent;
|
497
|
-
_context.next = 63;
|
498
|
-
return vaultLib.getPositionsLimit();
|
499
|
-
|
500
|
-
case 63:
|
501
|
-
_context.t14 = _context.sent;
|
502
|
-
_context.next = 66;
|
503
|
-
return _context.t5.deploy.call(_context.t5, _context.t6, _context.t7, _context.t8, _context.t9, _context.t10, _context.t11, _context.t12, _context.t13, _context.t14);
|
504
|
-
|
505
|
-
case 66:
|
506
|
-
nextVaultLib = _context.sent;
|
507
|
-
_context.next = 69;
|
508
|
-
return nextFundDeployer.setVaultLib(nextVaultLib);
|
509
|
-
|
510
|
-
case 69:
|
511
|
-
if (!setReleaseLive) {
|
512
|
-
_context.next = 72;
|
513
|
-
break;
|
514
|
-
}
|
515
|
-
|
516
|
-
_context.next = 72;
|
517
|
-
return nextFundDeployer.setReleaseLive();
|
518
|
-
|
519
|
-
case 72:
|
520
|
-
if (!setOnDispatcher) {
|
521
|
-
_context.next = 75;
|
522
|
-
break;
|
523
|
-
}
|
524
|
-
|
525
|
-
_context.next = 75;
|
526
|
-
return dispatcher.setCurrentFundDeployer(nextFundDeployer);
|
527
|
-
|
528
|
-
case 75:
|
529
|
-
return _context.abrupt("return", nextFundDeployer);
|
530
|
-
|
531
|
-
case 76:
|
532
|
-
case "end":
|
533
|
-
return _context.stop();
|
534
|
-
}
|
535
|
-
}
|
536
|
-
}, _callee);
|
537
|
-
}));
|
538
|
-
return _createFundDeployer.apply(this, arguments);
|
539
|
-
}
|
540
|
-
|
541
|
-
function callOnExtension(_x) {
|
542
|
-
return _callOnExtension.apply(this, arguments);
|
543
|
-
}
|
544
|
-
|
545
|
-
function _callOnExtension() {
|
546
|
-
_callOnExtension = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
547
|
-
var comptrollerProxy, extension, actionId, _ref$callArgs, callArgs, signer, callOnExtensionTx;
|
548
|
-
|
549
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
550
|
-
while (1) {
|
551
|
-
switch (_context.prev = _context.next) {
|
552
|
-
case 0:
|
553
|
-
comptrollerProxy = _ref.comptrollerProxy, extension = _ref.extension, actionId = _ref.actionId, _ref$callArgs = _ref.callArgs, callArgs = _ref$callArgs === void 0 ? '0x' : _ref$callArgs, signer = _ref.signer;
|
554
|
-
|
555
|
-
if (signer) {
|
556
|
-
callOnExtensionTx = comptrollerProxy.connect(signer).callOnExtension(extension, actionId, callArgs);
|
557
|
-
} else {
|
558
|
-
callOnExtensionTx = comptrollerProxy.callOnExtension(extension, actionId, callArgs);
|
559
|
-
}
|
560
|
-
|
561
|
-
_context.next = 4;
|
562
|
-
return expect(callOnExtensionTx).resolves.toBeReceipt();
|
563
|
-
|
564
|
-
case 4:
|
565
|
-
return _context.abrupt("return", callOnExtensionTx);
|
566
|
-
|
567
|
-
case 5:
|
568
|
-
case "end":
|
569
|
-
return _context.stop();
|
570
|
-
}
|
571
|
-
}
|
572
|
-
}, _callee);
|
573
|
-
}));
|
574
|
-
return _callOnExtension.apply(this, arguments);
|
575
|
-
}
|
576
|
-
|
577
|
-
function callOnExternalPosition(_x) {
|
578
|
-
return _callOnExternalPosition.apply(this, arguments);
|
579
|
-
}
|
580
|
-
|
581
|
-
function _callOnExternalPosition() {
|
582
|
-
_callOnExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
583
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, actionId, actionArgs, callArgs;
|
584
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
585
|
-
while (1) {
|
586
|
-
switch (_context.prev = _context.next) {
|
587
|
-
case 0:
|
588
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionProxy = _ref.externalPositionProxy, actionId = _ref.actionId, actionArgs = _ref.actionArgs;
|
589
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
590
|
-
actionArgs: actionArgs,
|
591
|
-
actionId: actionId,
|
592
|
-
externalPositionProxy: externalPositionProxy
|
593
|
-
});
|
594
|
-
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
595
|
-
|
596
|
-
case 3:
|
597
|
-
case "end":
|
598
|
-
return _context.stop();
|
599
|
-
}
|
600
|
-
}
|
601
|
-
}, _callee);
|
602
|
-
}));
|
603
|
-
return _callOnExternalPosition.apply(this, arguments);
|
604
|
-
}
|
605
|
-
|
606
|
-
function createExternalPosition(_x2) {
|
607
|
-
return _createExternalPosition.apply(this, arguments);
|
608
|
-
}
|
609
|
-
|
610
|
-
function _createExternalPosition() {
|
611
|
-
_createExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
612
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionTypeId, _ref2$initializationD, initializationData, _ref2$callOnExternalP, callOnExternalPositionData, receipt, event, externalPositionProxy;
|
613
|
-
|
614
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
615
|
-
while (1) {
|
616
|
-
switch (_context2.prev = _context2.next) {
|
617
|
-
case 0:
|
618
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionTypeId = _ref2.externalPositionTypeId, _ref2$initializationD = _ref2.initializationData, initializationData = _ref2$initializationD === void 0 ? '0x' : _ref2$initializationD, _ref2$callOnExternalP = _ref2.callOnExternalPositionData, callOnExternalPositionData = _ref2$callOnExternalP === void 0 ? '0x' : _ref2$callOnExternalP;
|
619
|
-
_context2.next = 3;
|
620
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CreateExternalPosition, protocol.encodeArgs(['uint256', 'bytes', 'bytes'], [externalPositionTypeId, initializationData, callOnExternalPositionData]));
|
621
|
-
|
622
|
-
case 3:
|
623
|
-
receipt = _context2.sent;
|
624
|
-
event = ethers$1.extractEvent(receipt, externalPositionManager.abi.getEvent('ExternalPositionDeployedForFund'));
|
625
|
-
externalPositionProxy = new protocol.IExternalPositionProxy(event[0].args.externalPosition, signer);
|
626
|
-
return _context2.abrupt("return", {
|
627
|
-
externalPositionProxy: externalPositionProxy,
|
628
|
-
receipt: receipt
|
629
|
-
});
|
630
|
-
|
631
|
-
case 7:
|
632
|
-
case "end":
|
633
|
-
return _context2.stop();
|
634
|
-
}
|
635
|
-
}
|
636
|
-
}, _callee2);
|
637
|
-
}));
|
638
|
-
return _createExternalPosition.apply(this, arguments);
|
639
|
-
}
|
640
|
-
|
641
|
-
function reactivateExternalPosition(_x3) {
|
642
|
-
return _reactivateExternalPosition.apply(this, arguments);
|
643
|
-
}
|
644
|
-
|
645
|
-
function _reactivateExternalPosition() {
|
646
|
-
_reactivateExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
647
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
648
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
649
|
-
while (1) {
|
650
|
-
switch (_context3.prev = _context3.next) {
|
651
|
-
case 0:
|
652
|
-
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy;
|
653
|
-
callArgs = protocol.externalPositionReactivateArgs({
|
654
|
-
externalPositionProxy: externalPositionProxy
|
655
|
-
});
|
656
|
-
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.ReactivateExternalPosition, callArgs));
|
657
|
-
|
658
|
-
case 3:
|
659
|
-
case "end":
|
660
|
-
return _context3.stop();
|
661
|
-
}
|
662
|
-
}
|
663
|
-
}, _callee3);
|
664
|
-
}));
|
665
|
-
return _reactivateExternalPosition.apply(this, arguments);
|
666
|
-
}
|
667
|
-
|
668
|
-
function removeExternalPosition(_x4) {
|
669
|
-
return _removeExternalPosition.apply(this, arguments);
|
670
|
-
}
|
671
|
-
|
672
|
-
function _removeExternalPosition() {
|
673
|
-
_removeExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
674
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, callArgs;
|
675
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
676
|
-
while (1) {
|
677
|
-
switch (_context4.prev = _context4.next) {
|
678
|
-
case 0:
|
679
|
-
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy;
|
680
|
-
callArgs = protocol.externalPositionRemoveArgs({
|
681
|
-
externalPositionProxy: externalPositionProxy
|
682
|
-
});
|
683
|
-
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.RemoveExternalPosition, callArgs));
|
684
|
-
|
685
|
-
case 3:
|
686
|
-
case "end":
|
687
|
-
return _context4.stop();
|
688
|
-
}
|
689
|
-
}
|
690
|
-
}, _callee4);
|
691
|
-
}));
|
692
|
-
return _removeExternalPosition.apply(this, arguments);
|
693
|
-
}
|
694
|
-
|
695
|
-
function compoundDebtPositionAddCollateral(_x) {
|
696
|
-
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
697
|
-
}
|
698
|
-
|
699
|
-
function _compoundDebtPositionAddCollateral() {
|
700
|
-
_compoundDebtPositionAddCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
701
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
702
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
703
|
-
while (1) {
|
704
|
-
switch (_context.prev = _context.next) {
|
705
|
-
case 0:
|
706
|
-
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, fundOwner = _ref.fundOwner, assets = _ref.assets, amounts = _ref.amounts, externalPositionProxy = _ref.externalPositionProxy, cTokens = _ref.cTokens;
|
707
|
-
actionArgs = protocol.compoundExternalPositionActionArgs({
|
708
|
-
amounts: amounts,
|
709
|
-
assets: assets,
|
710
|
-
data: protocol.encodeArgs(['address[]'], [cTokens])
|
711
|
-
});
|
712
|
-
return _context.abrupt("return", callOnExternalPosition({
|
713
|
-
actionArgs: actionArgs,
|
714
|
-
actionId: protocol.CompoundDebtPositionActionId.AddCollateralAssets,
|
715
|
-
comptrollerProxy: comptrollerProxy,
|
716
|
-
externalPositionManager: externalPositionManager,
|
717
|
-
externalPositionProxy: externalPositionProxy,
|
718
|
-
signer: fundOwner
|
719
|
-
}));
|
720
|
-
|
721
|
-
case 3:
|
722
|
-
case "end":
|
723
|
-
return _context.stop();
|
724
|
-
}
|
725
|
-
}
|
726
|
-
}, _callee);
|
727
|
-
}));
|
728
|
-
return _compoundDebtPositionAddCollateral.apply(this, arguments);
|
729
|
-
}
|
730
|
-
|
731
|
-
function compoundDebtPositionBorrow(_x2) {
|
732
|
-
return _compoundDebtPositionBorrow.apply(this, arguments);
|
733
|
-
}
|
734
|
-
|
735
|
-
function _compoundDebtPositionBorrow() {
|
736
|
-
_compoundDebtPositionBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
737
|
-
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, assets, amounts, cTokens, actionArgs;
|
738
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
739
|
-
while (1) {
|
740
|
-
switch (_context2.prev = _context2.next) {
|
741
|
-
case 0:
|
742
|
-
comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, fundOwner = _ref2.fundOwner, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts, cTokens = _ref2.cTokens;
|
743
|
-
actionArgs = protocol.compoundExternalPositionActionArgs({
|
744
|
-
amounts: amounts,
|
745
|
-
assets: assets,
|
746
|
-
data: protocol.encodeArgs(['address[]'], [cTokens])
|
747
|
-
});
|
748
|
-
return _context2.abrupt("return", callOnExternalPosition({
|
749
|
-
actionArgs: actionArgs,
|
750
|
-
actionId: protocol.CompoundDebtPositionActionId.BorrowAsset,
|
751
|
-
comptrollerProxy: comptrollerProxy,
|
752
|
-
externalPositionManager: externalPositionManager,
|
753
|
-
externalPositionProxy: externalPositionProxy,
|
754
|
-
signer: fundOwner
|
755
|
-
}));
|
756
|
-
|
757
|
-
case 3:
|
758
|
-
case "end":
|
759
|
-
return _context2.stop();
|
760
|
-
}
|
761
|
-
}
|
762
|
-
}, _callee2);
|
763
|
-
}));
|
764
|
-
return _compoundDebtPositionBorrow.apply(this, arguments);
|
765
|
-
}
|
766
|
-
|
767
|
-
function compoundDebtPositionClaimComp(_x3) {
|
768
|
-
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
769
|
-
}
|
770
|
-
|
771
|
-
function _compoundDebtPositionClaimComp() {
|
772
|
-
_compoundDebtPositionClaimComp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
773
|
-
var comptrollerProxy, externalPositionManager, fundOwner, externalPositionProxy, actionArgs;
|
774
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
775
|
-
while (1) {
|
776
|
-
switch (_context3.prev = _context3.next) {
|
777
|
-
case 0:
|
778
|
-
comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, fundOwner = _ref3.fundOwner, externalPositionProxy = _ref3.externalPositionProxy;
|
779
|
-
actionArgs = protocol.compoundExternalPositionActionArgs({
|
780
|
-
amounts: [],
|
781
|
-
assets: [],
|
782
|
-
data: '0x'
|
783
|
-
});
|
784
|
-
return _context3.abrupt("return", callOnExternalPosition({
|
785
|
-
actionArgs: actionArgs,
|
786
|
-
actionId: protocol.CompoundDebtPositionActionId.ClaimComp,
|
787
|
-
comptrollerProxy: comptrollerProxy,
|
788
|
-
externalPositionManager: externalPositionManager,
|
789
|
-
externalPositionProxy: externalPositionProxy,
|
790
|
-
signer: fundOwner
|
791
|
-
}));
|
792
|
-
|
793
|
-
case 3:
|
794
|
-
case "end":
|
795
|
-
return _context3.stop();
|
796
|
-
}
|
797
|
-
}
|
798
|
-
}, _callee3);
|
799
|
-
}));
|
800
|
-
return _compoundDebtPositionClaimComp.apply(this, arguments);
|
801
|
-
}
|
802
|
-
|
803
|
-
function compoundDebtPositionRemoveCollateral(_x4) {
|
804
|
-
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
805
|
-
}
|
806
|
-
|
807
|
-
function _compoundDebtPositionRemoveCollateral() {
|
808
|
-
_compoundDebtPositionRemoveCollateral = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
809
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
810
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
811
|
-
while (1) {
|
812
|
-
switch (_context4.prev = _context4.next) {
|
813
|
-
case 0:
|
814
|
-
comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, fundOwner = _ref4.fundOwner, assets = _ref4.assets, amounts = _ref4.amounts, externalPositionProxy = _ref4.externalPositionProxy, cTokens = _ref4.cTokens;
|
815
|
-
actionArgs = protocol.compoundExternalPositionActionArgs({
|
816
|
-
amounts: amounts,
|
817
|
-
assets: assets,
|
818
|
-
data: protocol.encodeArgs(['address[]'], [cTokens])
|
819
|
-
});
|
820
|
-
return _context4.abrupt("return", callOnExternalPosition({
|
821
|
-
actionArgs: actionArgs,
|
822
|
-
actionId: protocol.CompoundDebtPositionActionId.RemoveCollateralAssets,
|
823
|
-
comptrollerProxy: comptrollerProxy,
|
824
|
-
externalPositionManager: externalPositionManager,
|
825
|
-
externalPositionProxy: externalPositionProxy,
|
826
|
-
signer: fundOwner
|
827
|
-
}));
|
828
|
-
|
829
|
-
case 3:
|
830
|
-
case "end":
|
831
|
-
return _context4.stop();
|
832
|
-
}
|
833
|
-
}
|
834
|
-
}, _callee4);
|
835
|
-
}));
|
836
|
-
return _compoundDebtPositionRemoveCollateral.apply(this, arguments);
|
837
|
-
}
|
838
|
-
|
839
|
-
function compoundDebtPositionRepayBorrow(_x5) {
|
840
|
-
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
841
|
-
}
|
842
|
-
|
843
|
-
function _compoundDebtPositionRepayBorrow() {
|
844
|
-
_compoundDebtPositionRepayBorrow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
845
|
-
var comptrollerProxy, externalPositionManager, fundOwner, assets, amounts, externalPositionProxy, cTokens, actionArgs;
|
846
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
847
|
-
while (1) {
|
848
|
-
switch (_context5.prev = _context5.next) {
|
849
|
-
case 0:
|
850
|
-
comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, fundOwner = _ref5.fundOwner, assets = _ref5.assets, amounts = _ref5.amounts, externalPositionProxy = _ref5.externalPositionProxy, cTokens = _ref5.cTokens;
|
851
|
-
actionArgs = protocol.compoundExternalPositionActionArgs({
|
852
|
-
amounts: amounts,
|
853
|
-
assets: assets,
|
854
|
-
data: protocol.encodeArgs(['address[]'], [cTokens])
|
855
|
-
});
|
856
|
-
return _context5.abrupt("return", callOnExternalPosition({
|
857
|
-
actionArgs: actionArgs,
|
858
|
-
actionId: protocol.CompoundDebtPositionActionId.RepayBorrowedAssets,
|
859
|
-
comptrollerProxy: comptrollerProxy,
|
860
|
-
externalPositionManager: externalPositionManager,
|
861
|
-
externalPositionProxy: externalPositionProxy,
|
862
|
-
signer: fundOwner
|
863
|
-
}));
|
864
|
-
|
865
|
-
case 3:
|
866
|
-
case "end":
|
867
|
-
return _context5.stop();
|
868
|
-
}
|
869
|
-
}
|
870
|
-
}, _callee5);
|
871
|
-
}));
|
872
|
-
return _compoundDebtPositionRepayBorrow.apply(this, arguments);
|
873
|
-
}
|
874
|
-
|
875
|
-
function createCompoundDebtPosition(_x6) {
|
876
|
-
return _createCompoundDebtPosition.apply(this, arguments);
|
877
|
-
}
|
878
|
-
|
879
|
-
function _createCompoundDebtPosition() {
|
880
|
-
_createCompoundDebtPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
881
|
-
var signer, comptrollerProxy, externalPositionManager;
|
882
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
883
|
-
while (1) {
|
884
|
-
switch (_context6.prev = _context6.next) {
|
885
|
-
case 0:
|
886
|
-
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager;
|
887
|
-
return _context6.abrupt("return", createExternalPosition({
|
888
|
-
comptrollerProxy: comptrollerProxy,
|
889
|
-
externalPositionManager: externalPositionManager,
|
890
|
-
externalPositionTypeId: protocol.ExternalPositionType.CompoundDebtPosition,
|
891
|
-
signer: signer
|
892
|
-
}));
|
893
|
-
|
894
|
-
case 2:
|
895
|
-
case "end":
|
896
|
-
return _context6.stop();
|
897
|
-
}
|
898
|
-
}
|
899
|
-
}, _callee6);
|
900
|
-
}));
|
901
|
-
return _createCompoundDebtPosition.apply(this, arguments);
|
902
|
-
}
|
903
|
-
|
904
|
-
function createMockExternalPosition(_x) {
|
905
|
-
return _createMockExternalPosition.apply(this, arguments);
|
906
|
-
}
|
907
|
-
|
908
|
-
function _createMockExternalPosition() {
|
909
|
-
_createMockExternalPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
910
|
-
var comptrollerProxy, externalPositionManager, externalPositionFactory, defaultActionAssetsToTransfer, defaultActionAmountsToTransfer, defaultActionAssetsToReceive, fundOwner, deployer, vaultProxy, typeId, mockGenericExternalPositionLib, mockExternalPositionParser, receipt, externalPositionProxy;
|
911
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
912
|
-
while (1) {
|
913
|
-
switch (_context.prev = _context.next) {
|
914
|
-
case 0:
|
915
|
-
comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, externalPositionFactory = _ref.externalPositionFactory, defaultActionAssetsToTransfer = _ref.defaultActionAssetsToTransfer, defaultActionAmountsToTransfer = _ref.defaultActionAmountsToTransfer, defaultActionAssetsToReceive = _ref.defaultActionAssetsToReceive, fundOwner = _ref.fundOwner, deployer = _ref.deployer;
|
916
|
-
_context.t0 = protocol.VaultLib;
|
917
|
-
_context.next = 4;
|
918
|
-
return comptrollerProxy.getVaultProxy();
|
919
|
-
|
920
|
-
case 4:
|
921
|
-
_context.t1 = _context.sent;
|
922
|
-
_context.t2 = deployer;
|
923
|
-
vaultProxy = new _context.t0(_context.t1, _context.t2);
|
924
|
-
_context.next = 9;
|
925
|
-
return externalPositionFactory.getPositionTypeCounter();
|
926
|
-
|
927
|
-
case 9:
|
928
|
-
typeId = _context.sent;
|
929
|
-
_context.next = 12;
|
930
|
-
return externalPositionFactory.addNewPositionTypes(['TEST']);
|
931
|
-
|
932
|
-
case 12:
|
933
|
-
_context.next = 14;
|
934
|
-
return protocol.MockGenericExternalPositionLib.deploy(deployer);
|
935
|
-
|
936
|
-
case 14:
|
937
|
-
mockGenericExternalPositionLib = _context.sent;
|
938
|
-
_context.next = 17;
|
939
|
-
return protocol.MockGenericExternalPositionParser.deploy(deployer);
|
940
|
-
|
941
|
-
case 17:
|
942
|
-
mockExternalPositionParser = _context.sent;
|
943
|
-
mockExternalPositionParser.setAssetsForAction(0, defaultActionAssetsToTransfer, defaultActionAmountsToTransfer, defaultActionAssetsToReceive);
|
944
|
-
_context.next = 21;
|
945
|
-
return externalPositionManager.updateExternalPositionTypesInfo([typeId], [mockGenericExternalPositionLib], [mockExternalPositionParser]);
|
946
|
-
|
947
|
-
case 21:
|
948
|
-
_context.next = 23;
|
949
|
-
return createExternalPosition({
|
950
|
-
comptrollerProxy: comptrollerProxy,
|
951
|
-
externalPositionManager: externalPositionManager,
|
952
|
-
externalPositionTypeId: typeId,
|
953
|
-
signer: fundOwner
|
954
|
-
});
|
955
|
-
|
956
|
-
case 23:
|
957
|
-
receipt = _context.sent;
|
958
|
-
_context.next = 26;
|
959
|
-
return vaultProxy.getActiveExternalPositions();
|
960
|
-
|
961
|
-
case 26:
|
962
|
-
externalPositionProxy = _context.sent[0];
|
963
|
-
return _context.abrupt("return", {
|
964
|
-
externalPositionProxy: externalPositionProxy,
|
965
|
-
mockExternalPositionParser: mockExternalPositionParser,
|
966
|
-
mockGenericExternalPositionLib: mockGenericExternalPositionLib,
|
967
|
-
receipt: receipt,
|
968
|
-
typeId: typeId
|
969
|
-
});
|
970
|
-
|
971
|
-
case 28:
|
972
|
-
case "end":
|
973
|
-
return _context.stop();
|
974
|
-
}
|
975
|
-
}
|
976
|
-
}, _callee);
|
977
|
-
}));
|
978
|
-
return _createMockExternalPosition.apply(this, arguments);
|
979
|
-
}
|
980
|
-
|
981
|
-
function mockExternalPositionAddDebtAssets(_x2) {
|
982
|
-
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
983
|
-
}
|
984
|
-
|
985
|
-
function _mockExternalPositionAddDebtAssets() {
|
986
|
-
_mockExternalPositionAddDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
987
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
988
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
989
|
-
while (1) {
|
990
|
-
switch (_context2.prev = _context2.next) {
|
991
|
-
case 0:
|
992
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, assets = _ref2.assets, amounts = _ref2.amounts;
|
993
|
-
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
994
|
-
amounts: amounts,
|
995
|
-
assets: assets
|
996
|
-
});
|
997
|
-
return _context2.abrupt("return", callOnExternalPosition({
|
998
|
-
actionArgs: actionArgs,
|
999
|
-
actionId: protocol.MockGenericExternalPositionActionId.AddDebtAssets,
|
1000
|
-
comptrollerProxy: comptrollerProxy,
|
1001
|
-
externalPositionManager: externalPositionManager,
|
1002
|
-
externalPositionProxy: externalPositionProxy,
|
1003
|
-
signer: signer
|
1004
|
-
}));
|
1005
|
-
|
1006
|
-
case 3:
|
1007
|
-
case "end":
|
1008
|
-
return _context2.stop();
|
1009
|
-
}
|
1010
|
-
}
|
1011
|
-
}, _callee2);
|
1012
|
-
}));
|
1013
|
-
return _mockExternalPositionAddDebtAssets.apply(this, arguments);
|
1014
|
-
}
|
1015
|
-
|
1016
|
-
function mockExternalPositionAddManagedAssets(_x3) {
|
1017
|
-
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1018
|
-
}
|
1019
|
-
|
1020
|
-
function _mockExternalPositionAddManagedAssets() {
|
1021
|
-
_mockExternalPositionAddManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1022
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1023
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1024
|
-
while (1) {
|
1025
|
-
switch (_context3.prev = _context3.next) {
|
1026
|
-
case 0:
|
1027
|
-
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, assets = _ref3.assets, amounts = _ref3.amounts;
|
1028
|
-
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1029
|
-
amounts: amounts,
|
1030
|
-
assets: assets
|
1031
|
-
});
|
1032
|
-
return _context3.abrupt("return", callOnExternalPosition({
|
1033
|
-
actionArgs: actionArgs,
|
1034
|
-
actionId: protocol.MockGenericExternalPositionActionId.AddManagedAssets,
|
1035
|
-
comptrollerProxy: comptrollerProxy,
|
1036
|
-
externalPositionManager: externalPositionManager,
|
1037
|
-
externalPositionProxy: externalPositionProxy,
|
1038
|
-
signer: signer
|
1039
|
-
}));
|
1040
|
-
|
1041
|
-
case 3:
|
1042
|
-
case "end":
|
1043
|
-
return _context3.stop();
|
1044
|
-
}
|
1045
|
-
}
|
1046
|
-
}, _callee3);
|
1047
|
-
}));
|
1048
|
-
return _mockExternalPositionAddManagedAssets.apply(this, arguments);
|
1049
|
-
}
|
1050
|
-
|
1051
|
-
function mockExternalPositionRemoveDebtAssets(_x4) {
|
1052
|
-
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1053
|
-
}
|
1054
|
-
|
1055
|
-
function _mockExternalPositionRemoveDebtAssets() {
|
1056
|
-
_mockExternalPositionRemoveDebtAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1057
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1058
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1059
|
-
while (1) {
|
1060
|
-
switch (_context4.prev = _context4.next) {
|
1061
|
-
case 0:
|
1062
|
-
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, assets = _ref4.assets, amounts = _ref4.amounts;
|
1063
|
-
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1064
|
-
amounts: amounts,
|
1065
|
-
assets: assets
|
1066
|
-
});
|
1067
|
-
return _context4.abrupt("return", callOnExternalPosition({
|
1068
|
-
actionArgs: actionArgs,
|
1069
|
-
actionId: protocol.MockGenericExternalPositionActionId.RemoveDebtAssets,
|
1070
|
-
comptrollerProxy: comptrollerProxy,
|
1071
|
-
externalPositionManager: externalPositionManager,
|
1072
|
-
externalPositionProxy: externalPositionProxy,
|
1073
|
-
signer: signer
|
1074
|
-
}));
|
1075
|
-
|
1076
|
-
case 3:
|
1077
|
-
case "end":
|
1078
|
-
return _context4.stop();
|
1079
|
-
}
|
1080
|
-
}
|
1081
|
-
}, _callee4);
|
1082
|
-
}));
|
1083
|
-
return _mockExternalPositionRemoveDebtAssets.apply(this, arguments);
|
1084
|
-
}
|
1085
|
-
|
1086
|
-
function mockExternalPositionRemoveManagedAssets(_x5) {
|
1087
|
-
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1088
|
-
}
|
1089
|
-
|
1090
|
-
function _mockExternalPositionRemoveManagedAssets() {
|
1091
|
-
_mockExternalPositionRemoveManagedAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1092
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, assets, amounts, actionArgs;
|
1093
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1094
|
-
while (1) {
|
1095
|
-
switch (_context5.prev = _context5.next) {
|
1096
|
-
case 0:
|
1097
|
-
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, assets = _ref5.assets, amounts = _ref5.amounts;
|
1098
|
-
actionArgs = protocol.mockGenericExternalPositionActionArgs({
|
1099
|
-
amounts: amounts,
|
1100
|
-
assets: assets
|
1101
|
-
});
|
1102
|
-
return _context5.abrupt("return", callOnExternalPosition({
|
1103
|
-
actionArgs: actionArgs,
|
1104
|
-
actionId: protocol.MockGenericExternalPositionActionId.RemoveManagedAssets,
|
1105
|
-
comptrollerProxy: comptrollerProxy,
|
1106
|
-
externalPositionManager: externalPositionManager,
|
1107
|
-
externalPositionProxy: externalPositionProxy,
|
1108
|
-
signer: signer
|
1109
|
-
}));
|
1110
|
-
|
1111
|
-
case 3:
|
1112
|
-
case "end":
|
1113
|
-
return _context5.stop();
|
1114
|
-
}
|
1115
|
-
}
|
1116
|
-
}, _callee5);
|
1117
|
-
}));
|
1118
|
-
return _mockExternalPositionRemoveManagedAssets.apply(this, arguments);
|
1119
|
-
}
|
1120
|
-
|
1121
|
-
var _templateObject$3;
|
1122
|
-
exports.UniswapV3FeeAmount = void 0;
|
1123
|
-
|
1124
|
-
(function (UniswapV3FeeAmount) {
|
1125
|
-
UniswapV3FeeAmount[UniswapV3FeeAmount["LOW"] = 500] = "LOW";
|
1126
|
-
UniswapV3FeeAmount[UniswapV3FeeAmount["MEDIUM"] = 3000] = "MEDIUM";
|
1127
|
-
UniswapV3FeeAmount[UniswapV3FeeAmount["HIGH"] = 10000] = "HIGH";
|
1128
|
-
})(exports.UniswapV3FeeAmount || (exports.UniswapV3FeeAmount = {}));
|
1129
|
-
|
1130
|
-
var uniswapV3LiquidityPositionGetMinTick = function uniswapV3LiquidityPositionGetMinTick(tickSpacing) {
|
1131
|
-
return Math.ceil(-887272 / tickSpacing) * tickSpacing;
|
1132
|
-
};
|
1133
|
-
var uniswapV3LiquidityPositionGetMaxTick = function uniswapV3LiquidityPositionGetMaxTick(tickSpacing) {
|
1134
|
-
return Math.floor(887272 / tickSpacing) * tickSpacing;
|
1135
|
-
};
|
1136
|
-
var IUniswapV3NonFungibleTokenManager = ethers$1.contract()(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n function positions(uint256 tokenId) view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1)\n"])));
|
1137
|
-
function createUniswapV3LiquidityPosition(_x) {
|
1138
|
-
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1139
|
-
}
|
1140
|
-
|
1141
|
-
function _createUniswapV3LiquidityPosition() {
|
1142
|
-
_createUniswapV3LiquidityPosition = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1143
|
-
var signer, comptrollerProxy, externalPositionManager, _ref$callOnExternalPo, callOnExternalPositionData, _yield$createExternal, externalPositionProxyContract, receipt;
|
1144
|
-
|
1145
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1146
|
-
while (1) {
|
1147
|
-
switch (_context.prev = _context.next) {
|
1148
|
-
case 0:
|
1149
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, externalPositionManager = _ref.externalPositionManager, _ref$callOnExternalPo = _ref.callOnExternalPositionData, callOnExternalPositionData = _ref$callOnExternalPo === void 0 ? '0x' : _ref$callOnExternalPo;
|
1150
|
-
_context.next = 3;
|
1151
|
-
return createExternalPosition({
|
1152
|
-
callOnExternalPositionData: callOnExternalPositionData,
|
1153
|
-
comptrollerProxy: comptrollerProxy,
|
1154
|
-
externalPositionManager: externalPositionManager,
|
1155
|
-
externalPositionTypeId: protocol.ExternalPositionType.UniswapV3LiquidityPosition,
|
1156
|
-
signer: signer
|
1157
|
-
});
|
1158
|
-
|
1159
|
-
case 3:
|
1160
|
-
_yield$createExternal = _context.sent;
|
1161
|
-
externalPositionProxyContract = _yield$createExternal.externalPositionProxy;
|
1162
|
-
receipt = _yield$createExternal.receipt;
|
1163
|
-
return _context.abrupt("return", {
|
1164
|
-
externalPositionProxyAddress: externalPositionProxyContract.address,
|
1165
|
-
receipt: receipt
|
1166
|
-
});
|
1167
|
-
|
1168
|
-
case 7:
|
1169
|
-
case "end":
|
1170
|
-
return _context.stop();
|
1171
|
-
}
|
1172
|
-
}
|
1173
|
-
}, _callee);
|
1174
|
-
}));
|
1175
|
-
return _createUniswapV3LiquidityPosition.apply(this, arguments);
|
1176
|
-
}
|
1177
|
-
|
1178
|
-
function uniswapV3LiquidityPositionAddLiquidity(_x2) {
|
1179
|
-
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1180
|
-
}
|
1181
|
-
|
1182
|
-
function _uniswapV3LiquidityPositionAddLiquidity() {
|
1183
|
-
_uniswapV3LiquidityPositionAddLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1184
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, amount0Desired, amount1Desired, _ref2$amount0Min, amount0Min, _ref2$amount1Min, amount1Min, actionArgs, callArgs;
|
1185
|
-
|
1186
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1187
|
-
while (1) {
|
1188
|
-
switch (_context2.prev = _context2.next) {
|
1189
|
-
case 0:
|
1190
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, externalPositionManager = _ref2.externalPositionManager, externalPositionProxy = _ref2.externalPositionProxy, nftId = _ref2.nftId, amount0Desired = _ref2.amount0Desired, amount1Desired = _ref2.amount1Desired, _ref2$amount0Min = _ref2.amount0Min, amount0Min = _ref2$amount0Min === void 0 ? 0 : _ref2$amount0Min, _ref2$amount1Min = _ref2.amount1Min, amount1Min = _ref2$amount1Min === void 0 ? 0 : _ref2$amount1Min;
|
1191
|
-
actionArgs = protocol.uniswapV3LiquidityPositionAddLiquidityArgs({
|
1192
|
-
amount0Desired: amount0Desired,
|
1193
|
-
amount0Min: amount0Min,
|
1194
|
-
amount1Desired: amount1Desired,
|
1195
|
-
amount1Min: amount1Min,
|
1196
|
-
nftId: nftId
|
1197
|
-
});
|
1198
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
1199
|
-
actionArgs: actionArgs,
|
1200
|
-
actionId: protocol.UniswapV3LiquidityPositionActionId.AddLiquidity,
|
1201
|
-
externalPositionProxy: externalPositionProxy
|
1202
|
-
});
|
1203
|
-
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1204
|
-
|
1205
|
-
case 4:
|
1206
|
-
case "end":
|
1207
|
-
return _context2.stop();
|
1208
|
-
}
|
1209
|
-
}
|
1210
|
-
}, _callee2);
|
1211
|
-
}));
|
1212
|
-
return _uniswapV3LiquidityPositionAddLiquidity.apply(this, arguments);
|
1213
|
-
}
|
1214
|
-
|
1215
|
-
function uniswapV3LiquidityPositionCollect(_x3) {
|
1216
|
-
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1217
|
-
}
|
1218
|
-
|
1219
|
-
function _uniswapV3LiquidityPositionCollect() {
|
1220
|
-
_uniswapV3LiquidityPositionCollect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1221
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, actionArgs, callArgs;
|
1222
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1223
|
-
while (1) {
|
1224
|
-
switch (_context3.prev = _context3.next) {
|
1225
|
-
case 0:
|
1226
|
-
signer = _ref3.signer, comptrollerProxy = _ref3.comptrollerProxy, externalPositionManager = _ref3.externalPositionManager, externalPositionProxy = _ref3.externalPositionProxy, nftId = _ref3.nftId;
|
1227
|
-
actionArgs = protocol.uniswapV3LiquidityPositionCollectArgs({
|
1228
|
-
nftId: nftId
|
1229
|
-
});
|
1230
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
1231
|
-
actionArgs: actionArgs,
|
1232
|
-
actionId: protocol.UniswapV3LiquidityPositionActionId.Collect,
|
1233
|
-
externalPositionProxy: externalPositionProxy
|
1234
|
-
});
|
1235
|
-
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1236
|
-
|
1237
|
-
case 4:
|
1238
|
-
case "end":
|
1239
|
-
return _context3.stop();
|
1240
|
-
}
|
1241
|
-
}
|
1242
|
-
}, _callee3);
|
1243
|
-
}));
|
1244
|
-
return _uniswapV3LiquidityPositionCollect.apply(this, arguments);
|
1245
|
-
}
|
1246
|
-
|
1247
|
-
function uniswapV3LiquidityPositionMint(_x4) {
|
1248
|
-
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1249
|
-
}
|
1250
|
-
|
1251
|
-
function _uniswapV3LiquidityPositionMint() {
|
1252
|
-
_uniswapV3LiquidityPositionMint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1253
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, token0, token1, fee, tickLower, tickUpper, amount0Desired, amount1Desired, _ref4$amount0Min, amount0Min, _ref4$amount1Min, amount1Min, actionArgs, callArgs, receipt, externalPosition, nftId;
|
1254
|
-
|
1255
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1256
|
-
while (1) {
|
1257
|
-
switch (_context4.prev = _context4.next) {
|
1258
|
-
case 0:
|
1259
|
-
signer = _ref4.signer, comptrollerProxy = _ref4.comptrollerProxy, externalPositionManager = _ref4.externalPositionManager, externalPositionProxy = _ref4.externalPositionProxy, token0 = _ref4.token0, token1 = _ref4.token1, fee = _ref4.fee, tickLower = _ref4.tickLower, tickUpper = _ref4.tickUpper, amount0Desired = _ref4.amount0Desired, amount1Desired = _ref4.amount1Desired, _ref4$amount0Min = _ref4.amount0Min, amount0Min = _ref4$amount0Min === void 0 ? 0 : _ref4$amount0Min, _ref4$amount1Min = _ref4.amount1Min, amount1Min = _ref4$amount1Min === void 0 ? 0 : _ref4$amount1Min;
|
1260
|
-
actionArgs = protocol.uniswapV3LiquidityPositionMintArgs({
|
1261
|
-
amount0Desired: amount0Desired,
|
1262
|
-
amount0Min: amount0Min,
|
1263
|
-
amount1Desired: amount1Desired,
|
1264
|
-
amount1Min: amount1Min,
|
1265
|
-
fee: fee,
|
1266
|
-
tickLower: tickLower,
|
1267
|
-
tickUpper: tickUpper,
|
1268
|
-
token0: token0,
|
1269
|
-
token1: token1
|
1270
|
-
});
|
1271
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
1272
|
-
actionArgs: actionArgs,
|
1273
|
-
actionId: protocol.UniswapV3LiquidityPositionActionId.Mint,
|
1274
|
-
externalPositionProxy: externalPositionProxy
|
1275
|
-
});
|
1276
|
-
_context4.next = 5;
|
1277
|
-
return comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs);
|
1278
|
-
|
1279
|
-
case 5:
|
1280
|
-
receipt = _context4.sent;
|
1281
|
-
externalPosition = new protocol.UniswapV3LiquidityPositionLib(externalPositionProxy, provider);
|
1282
|
-
nftId = ethers$1.extractEvent(receipt, externalPosition.abi.getEvent('NFTPositionAdded'))[0].args.tokenId;
|
1283
|
-
return _context4.abrupt("return", {
|
1284
|
-
nftId: nftId,
|
1285
|
-
receipt: receipt
|
1286
|
-
});
|
1287
|
-
|
1288
|
-
case 9:
|
1289
|
-
case "end":
|
1290
|
-
return _context4.stop();
|
1291
|
-
}
|
1292
|
-
}
|
1293
|
-
}, _callee4);
|
1294
|
-
}));
|
1295
|
-
return _uniswapV3LiquidityPositionMint.apply(this, arguments);
|
1296
|
-
}
|
1297
|
-
|
1298
|
-
function uniswapV3LiquidityPositionPurge(_x5) {
|
1299
|
-
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1300
|
-
}
|
1301
|
-
|
1302
|
-
function _uniswapV3LiquidityPositionPurge() {
|
1303
|
-
_uniswapV3LiquidityPositionPurge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1304
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref5$amount0Min, amount0Min, _ref5$amount1Min, amount1Min, actionArgs, callArgs;
|
1305
|
-
|
1306
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1307
|
-
while (1) {
|
1308
|
-
switch (_context5.prev = _context5.next) {
|
1309
|
-
case 0:
|
1310
|
-
signer = _ref5.signer, comptrollerProxy = _ref5.comptrollerProxy, externalPositionManager = _ref5.externalPositionManager, externalPositionProxy = _ref5.externalPositionProxy, nftId = _ref5.nftId, liquidity = _ref5.liquidity, _ref5$amount0Min = _ref5.amount0Min, amount0Min = _ref5$amount0Min === void 0 ? 0 : _ref5$amount0Min, _ref5$amount1Min = _ref5.amount1Min, amount1Min = _ref5$amount1Min === void 0 ? 0 : _ref5$amount1Min;
|
1311
|
-
actionArgs = protocol.uniswapV3LiquidityPositionPurgeArgs({
|
1312
|
-
amount0Min: amount0Min,
|
1313
|
-
amount1Min: amount1Min,
|
1314
|
-
liquidity: liquidity,
|
1315
|
-
nftId: nftId
|
1316
|
-
});
|
1317
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
1318
|
-
actionArgs: actionArgs,
|
1319
|
-
actionId: protocol.UniswapV3LiquidityPositionActionId.Purge,
|
1320
|
-
externalPositionProxy: externalPositionProxy
|
1321
|
-
});
|
1322
|
-
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1323
|
-
|
1324
|
-
case 4:
|
1325
|
-
case "end":
|
1326
|
-
return _context5.stop();
|
1327
|
-
}
|
1328
|
-
}
|
1329
|
-
}, _callee5);
|
1330
|
-
}));
|
1331
|
-
return _uniswapV3LiquidityPositionPurge.apply(this, arguments);
|
1332
|
-
}
|
1333
|
-
|
1334
|
-
function uniswapV3LiquidityPositionRemoveLiquidity(_x6) {
|
1335
|
-
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1336
|
-
}
|
1337
|
-
|
1338
|
-
function _uniswapV3LiquidityPositionRemoveLiquidity() {
|
1339
|
-
_uniswapV3LiquidityPositionRemoveLiquidity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
1340
|
-
var signer, comptrollerProxy, externalPositionManager, externalPositionProxy, nftId, liquidity, _ref6$amount0Min, amount0Min, _ref6$amount1Min, amount1Min, actionArgs, callArgs;
|
1341
|
-
|
1342
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
1343
|
-
while (1) {
|
1344
|
-
switch (_context6.prev = _context6.next) {
|
1345
|
-
case 0:
|
1346
|
-
signer = _ref6.signer, comptrollerProxy = _ref6.comptrollerProxy, externalPositionManager = _ref6.externalPositionManager, externalPositionProxy = _ref6.externalPositionProxy, nftId = _ref6.nftId, liquidity = _ref6.liquidity, _ref6$amount0Min = _ref6.amount0Min, amount0Min = _ref6$amount0Min === void 0 ? 0 : _ref6$amount0Min, _ref6$amount1Min = _ref6.amount1Min, amount1Min = _ref6$amount1Min === void 0 ? 0 : _ref6$amount1Min;
|
1347
|
-
actionArgs = protocol.uniswapV3LiquidityPositionRemoveLiquidityArgs({
|
1348
|
-
amount0Min: amount0Min,
|
1349
|
-
amount1Min: amount1Min,
|
1350
|
-
liquidity: liquidity,
|
1351
|
-
nftId: nftId
|
1352
|
-
});
|
1353
|
-
callArgs = protocol.callOnExternalPositionArgs({
|
1354
|
-
actionArgs: actionArgs,
|
1355
|
-
actionId: protocol.UniswapV3LiquidityPositionActionId.RemoveLiquidity,
|
1356
|
-
externalPositionProxy: externalPositionProxy
|
1357
|
-
});
|
1358
|
-
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(externalPositionManager, protocol.ExternalPositionManagerActionId.CallOnExternalPosition, callArgs));
|
1359
|
-
|
1360
|
-
case 4:
|
1361
|
-
case "end":
|
1362
|
-
return _context6.stop();
|
1363
|
-
}
|
1364
|
-
}
|
1365
|
-
}, _callee6);
|
1366
|
-
}));
|
1367
|
-
return _uniswapV3LiquidityPositionRemoveLiquidity.apply(this, arguments);
|
1368
|
-
}
|
1369
|
-
|
1370
|
-
function uniswapV3OrderTokenPair(_ref7) {
|
1371
|
-
var tokenA = _ref7.tokenA,
|
1372
|
-
tokenB = _ref7.tokenB;
|
1373
|
-
var tokenAAddress = ethers$1.resolveAddress(tokenA);
|
1374
|
-
var tokenBAddress = ethers$1.resolveAddress(tokenB);
|
1375
|
-
return tokenAAddress < tokenBAddress ? {
|
1376
|
-
token0: tokenAAddress,
|
1377
|
-
token1: tokenBAddress
|
1378
|
-
} : {
|
1379
|
-
token0: tokenBAddress,
|
1380
|
-
token1: tokenAAddress
|
1381
|
-
};
|
1382
|
-
}
|
1383
|
-
|
1384
|
-
function generateFeeManagerConfigWithMockFees(_x) {
|
1385
|
-
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
1386
|
-
}
|
1387
|
-
|
1388
|
-
function _generateFeeManagerConfigWithMockFees() {
|
1389
|
-
_generateFeeManagerConfigWithMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1390
|
-
var deployer, fees, feeManagerSettingsData;
|
1391
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1392
|
-
while (1) {
|
1393
|
-
switch (_context.prev = _context.next) {
|
1394
|
-
case 0:
|
1395
|
-
deployer = _ref.deployer;
|
1396
|
-
_context.next = 3;
|
1397
|
-
return generateMockFees({
|
1398
|
-
deployer: deployer
|
1399
|
-
});
|
1400
|
-
|
1401
|
-
case 3:
|
1402
|
-
fees = _context.sent;
|
1403
|
-
feeManagerSettingsData = [ethers.utils.randomBytes(10), '0x', ethers.utils.randomBytes(2)];
|
1404
|
-
return _context.abrupt("return", protocol.feeManagerConfigArgs({
|
1405
|
-
fees: Object.values(fees),
|
1406
|
-
settings: feeManagerSettingsData
|
1407
|
-
}));
|
1408
|
-
|
1409
|
-
case 6:
|
1410
|
-
case "end":
|
1411
|
-
return _context.stop();
|
1412
|
-
}
|
1413
|
-
}
|
1414
|
-
}, _callee);
|
1415
|
-
}));
|
1416
|
-
return _generateFeeManagerConfigWithMockFees.apply(this, arguments);
|
1417
|
-
}
|
1418
|
-
|
1419
|
-
function generateMockFees(_x2) {
|
1420
|
-
return _generateMockFees.apply(this, arguments);
|
1421
|
-
}
|
1422
|
-
|
1423
|
-
function _generateMockFees() {
|
1424
|
-
_generateMockFees = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1425
|
-
var deployer, mockContinuousFeeSettleOnly, mockContinuousFeeWithGavAndUpdates, mockPostBuySharesFee;
|
1426
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1427
|
-
while (1) {
|
1428
|
-
switch (_context2.prev = _context2.next) {
|
1429
|
-
case 0:
|
1430
|
-
deployer = _ref2.deployer;
|
1431
|
-
_context2.next = 3;
|
1432
|
-
return protocol.IFee.mock(deployer);
|
1433
|
-
|
1434
|
-
case 3:
|
1435
|
-
mockContinuousFeeSettleOnly = _context2.sent;
|
1436
|
-
_context2.next = 6;
|
1437
|
-
return protocol.IFee.mock(deployer);
|
1438
|
-
|
1439
|
-
case 6:
|
1440
|
-
mockContinuousFeeWithGavAndUpdates = _context2.sent;
|
1441
|
-
_context2.next = 9;
|
1442
|
-
return protocol.IFee.mock(deployer);
|
1443
|
-
|
1444
|
-
case 9:
|
1445
|
-
mockPostBuySharesFee = _context2.sent;
|
1446
|
-
_context2.next = 12;
|
1447
|
-
return Promise.all([// Continuous fee the mimics ManagementFee
|
1448
|
-
mockContinuousFeeSettleOnly.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeSettleOnly.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockContinuousFeeSettleOnly.payout.returns(false), mockContinuousFeeSettleOnly.addFundSettings.returns(undefined), mockContinuousFeeSettleOnly.activateForFund.returns(undefined), mockContinuousFeeSettleOnly.update.returns(undefined), mockContinuousFeeSettleOnly.settlesOnHook.returns(false, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.Continuous).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.PreBuyShares).returns(true, false), mockContinuousFeeSettleOnly.settlesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, false), mockContinuousFeeSettleOnly.updatesOnHook.returns(false, false), // Continuous fee the mimics PerformanceFee
|
1449
|
-
mockContinuousFeeWithGavAndUpdates.getRecipientForFund.returns(ethers.constants.AddressZero), mockContinuousFeeWithGavAndUpdates.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockContinuousFeeWithGavAndUpdates.payout.returns(false), mockContinuousFeeWithGavAndUpdates.addFundSettings.returns(undefined), mockContinuousFeeWithGavAndUpdates.activateForFund.returns(undefined), mockContinuousFeeWithGavAndUpdates.update.returns(undefined), mockContinuousFeeWithGavAndUpdates.settlesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.PreBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.settlesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.returns(false, false), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.Continuous).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.PostBuyShares).returns(true, true), mockContinuousFeeWithGavAndUpdates.updatesOnHook.given(protocol.FeeHook.PreRedeemShares).returns(true, true), // PostBuyShares fee
|
1450
|
-
mockPostBuySharesFee.getRecipientForFund.returns(ethers.constants.AddressZero), mockPostBuySharesFee.settle.returns(protocol.FeeSettlementType.None, ethers.constants.AddressZero, 0), mockPostBuySharesFee.payout.returns(false), mockPostBuySharesFee.addFundSettings.returns(undefined), mockPostBuySharesFee.activateForFund.returns(undefined), mockPostBuySharesFee.update.returns(undefined), mockPostBuySharesFee.settlesOnHook.returns(false, false), mockPostBuySharesFee.settlesOnHook.given(protocol.FeeHook.PostBuyShares).returns(true, false), mockPostBuySharesFee.updatesOnHook.returns(false, false)]);
|
1451
|
-
|
1452
|
-
case 12:
|
1453
|
-
return _context2.abrupt("return", {
|
1454
|
-
mockContinuousFeeSettleOnly: mockContinuousFeeSettleOnly,
|
1455
|
-
mockContinuousFeeWithGavAndUpdates: mockContinuousFeeWithGavAndUpdates,
|
1456
|
-
mockPostBuySharesFee: mockPostBuySharesFee
|
1457
|
-
});
|
1458
|
-
|
1459
|
-
case 13:
|
1460
|
-
case "end":
|
1461
|
-
return _context2.stop();
|
1462
|
-
}
|
1463
|
-
}
|
1464
|
-
}, _callee2);
|
1465
|
-
}));
|
1466
|
-
return _generateMockFees.apply(this, arguments);
|
1467
|
-
}
|
1468
|
-
|
1469
|
-
function aaveLend(_x) {
|
1470
|
-
return _aaveLend.apply(this, arguments);
|
1471
|
-
}
|
1472
|
-
|
1473
|
-
function _aaveLend() {
|
1474
|
-
_aaveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1475
|
-
var comptrollerProxy, integrationManager, fundOwner, aaveAdapter, aToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
1476
|
-
|
1477
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1478
|
-
while (1) {
|
1479
|
-
switch (_context.prev = _context.next) {
|
1480
|
-
case 0:
|
1481
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, aaveAdapter = _ref.aaveAdapter, aToken = _ref.aToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? ethers.utils.parseEther('1') : _ref$amount;
|
1482
|
-
lendArgs = protocol.aaveLendArgs({
|
1483
|
-
aToken: aToken,
|
1484
|
-
amount: amount
|
1485
|
-
});
|
1486
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1487
|
-
adapter: aaveAdapter,
|
1488
|
-
encodedCallArgs: lendArgs,
|
1489
|
-
selector: protocol.lendSelector
|
1490
|
-
});
|
1491
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1492
|
-
return _context.abrupt("return", lendTx);
|
1493
|
-
|
1494
|
-
case 5:
|
1495
|
-
case "end":
|
1496
|
-
return _context.stop();
|
1497
|
-
}
|
1498
|
-
}
|
1499
|
-
}, _callee);
|
1500
|
-
}));
|
1501
|
-
return _aaveLend.apply(this, arguments);
|
1502
|
-
}
|
1503
|
-
|
1504
|
-
function aaveRedeem(_x2) {
|
1505
|
-
return _aaveRedeem.apply(this, arguments);
|
1506
|
-
}
|
1507
|
-
|
1508
|
-
function _aaveRedeem() {
|
1509
|
-
_aaveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1510
|
-
var comptrollerProxy, integrationManager, fundOwner, aaveAdapter, aToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
1511
|
-
|
1512
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1513
|
-
while (1) {
|
1514
|
-
switch (_context2.prev = _context2.next) {
|
1515
|
-
case 0:
|
1516
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, aaveAdapter = _ref2.aaveAdapter, aToken = _ref2.aToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? ethers.utils.parseEther('1') : _ref2$amount;
|
1517
|
-
redeemArgs = protocol.aaveRedeemArgs({
|
1518
|
-
aToken: aToken,
|
1519
|
-
amount: amount
|
1520
|
-
});
|
1521
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1522
|
-
adapter: aaveAdapter,
|
1523
|
-
encodedCallArgs: redeemArgs,
|
1524
|
-
selector: protocol.redeemSelector
|
1525
|
-
});
|
1526
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1527
|
-
return _context2.abrupt("return", redeemTx);
|
1528
|
-
|
1529
|
-
case 5:
|
1530
|
-
case "end":
|
1531
|
-
return _context2.stop();
|
1532
|
-
}
|
1533
|
-
}
|
1534
|
-
}, _callee2);
|
1535
|
-
}));
|
1536
|
-
return _aaveRedeem.apply(this, arguments);
|
1537
|
-
}
|
1538
|
-
|
1539
|
-
var _templateObject$2;
|
1540
|
-
var ICompoundComptroller = ethers$1.contract()(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n function claimComp(address)\n"])));
|
1541
|
-
function assertCompoundLend(_x) {
|
1542
|
-
return _assertCompoundLend.apply(this, arguments);
|
1543
|
-
}
|
1544
|
-
|
1545
|
-
function _assertCompoundLend() {
|
1546
|
-
_assertCompoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1547
|
-
var tokenWhale, comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, _ref$tokenAmount, tokenAmount, cToken, compoundPriceFeed, token, rateBefore, minIncomingCTokenAmount, _yield$getAssetBalanc, _yield$getAssetBalanc2, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, lendReceipt, rate, _yield$getAssetBalanc3, _yield$getAssetBalanc4, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, expectedCTokenAmount;
|
1548
|
-
|
1549
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1550
|
-
while (1) {
|
1551
|
-
switch (_context.prev = _context.next) {
|
1552
|
-
case 0:
|
1553
|
-
tokenWhale = _ref.tokenWhale, comptrollerProxy = _ref.comptrollerProxy, vaultProxy = _ref.vaultProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, compoundAdapter = _ref.compoundAdapter, _ref$tokenAmount = _ref.tokenAmount, tokenAmount = _ref$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref$tokenAmount, cToken = _ref.cToken, compoundPriceFeed = _ref.compoundPriceFeed;
|
1554
|
-
_context.t0 = protocol.StandardToken;
|
1555
|
-
_context.next = 4;
|
1556
|
-
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1557
|
-
|
1558
|
-
case 4:
|
1559
|
-
_context.t1 = _context.sent;
|
1560
|
-
_context.t2 = tokenWhale;
|
1561
|
-
token = new _context.t0(_context.t1, _context.t2);
|
1562
|
-
_context.next = 9;
|
1563
|
-
return token.connect(tokenWhale).transfer(vaultProxy, tokenAmount);
|
1564
|
-
|
1565
|
-
case 9:
|
1566
|
-
_context.next = 11;
|
1567
|
-
return cToken.exchangeRateStored.call();
|
1568
|
-
|
1569
|
-
case 11:
|
1570
|
-
rateBefore = _context.sent;
|
1571
|
-
// Exchange rate stored can have a small deviation from exchangeRateStored
|
1572
|
-
minIncomingCTokenAmount = tokenAmount.mul(ethers.utils.parseEther('1')).div(rateBefore).mul(ethers.BigNumber.from('999')).div(ethers.BigNumber.from('1000'));
|
1573
|
-
_context.next = 15;
|
1574
|
-
return getAssetBalances({
|
1575
|
-
account: vaultProxy,
|
1576
|
-
assets: [cToken, token]
|
1577
|
-
});
|
1578
|
-
|
1579
|
-
case 15:
|
1580
|
-
_yield$getAssetBalanc = _context.sent;
|
1581
|
-
_yield$getAssetBalanc2 = _slicedToArray(_yield$getAssetBalanc, 2);
|
1582
|
-
preTxIncomingAssetBalance = _yield$getAssetBalanc2[0];
|
1583
|
-
preTxOutgoingAssetBalance = _yield$getAssetBalanc2[1];
|
1584
|
-
_context.next = 21;
|
1585
|
-
return compoundLend({
|
1586
|
-
cToken: cToken,
|
1587
|
-
cTokenAmount: minIncomingCTokenAmount,
|
1588
|
-
compoundAdapter: compoundAdapter,
|
1589
|
-
comptrollerProxy: comptrollerProxy,
|
1590
|
-
fundOwner: fundOwner,
|
1591
|
-
integrationManager: integrationManager,
|
1592
|
-
tokenAmount: tokenAmount
|
1593
|
-
});
|
1594
|
-
|
1595
|
-
case 21:
|
1596
|
-
lendReceipt = _context.sent;
|
1597
|
-
_context.next = 24;
|
1598
|
-
return cToken.exchangeRateStored();
|
1599
|
-
|
1600
|
-
case 24:
|
1601
|
-
rate = _context.sent;
|
1602
|
-
_context.next = 27;
|
1603
|
-
return getAssetBalances({
|
1604
|
-
account: vaultProxy,
|
1605
|
-
assets: [cToken, token]
|
1606
|
-
});
|
1607
|
-
|
1608
|
-
case 27:
|
1609
|
-
_yield$getAssetBalanc3 = _context.sent;
|
1610
|
-
_yield$getAssetBalanc4 = _slicedToArray(_yield$getAssetBalanc3, 2);
|
1611
|
-
postTxIncomingAssetBalance = _yield$getAssetBalanc4[0];
|
1612
|
-
postTxOutgoingAssetBalance = _yield$getAssetBalanc4[1];
|
1613
|
-
expectedCTokenAmount = tokenAmount.mul(ethers.utils.parseEther('1')).div(rate);
|
1614
|
-
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedCTokenAmount));
|
1615
|
-
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(tokenAmount));
|
1616
|
-
return _context.abrupt("return", lendReceipt);
|
1617
|
-
|
1618
|
-
case 35:
|
1619
|
-
case "end":
|
1620
|
-
return _context.stop();
|
1621
|
-
}
|
1622
|
-
}
|
1623
|
-
}, _callee);
|
1624
|
-
}));
|
1625
|
-
return _assertCompoundLend.apply(this, arguments);
|
1626
|
-
}
|
1627
|
-
|
1628
|
-
function assertCompoundRedeem(_x2) {
|
1629
|
-
return _assertCompoundRedeem.apply(this, arguments);
|
1630
|
-
}
|
1631
|
-
|
1632
|
-
function _assertCompoundRedeem() {
|
1633
|
-
_assertCompoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
1634
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, compoundAdapter, cToken, compoundPriceFeed, cTokenAmount, token, _yield$getAssetBalanc5, _yield$getAssetBalanc6, preTxIncomingAssetBalance, preTxOutgoingAssetBalance, rateBefore, minIncomingTokenAmount, redeemReceipt, _yield$getAssetBalanc7, _yield$getAssetBalanc8, postTxIncomingAssetBalance, postTxOutgoingAssetBalance, rate, expectedTokenAmount;
|
1635
|
-
|
1636
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1637
|
-
while (1) {
|
1638
|
-
switch (_context2.prev = _context2.next) {
|
1639
|
-
case 0:
|
1640
|
-
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, compoundAdapter = _ref2.compoundAdapter, cToken = _ref2.cToken, compoundPriceFeed = _ref2.compoundPriceFeed;
|
1641
|
-
_context2.t0 = ethers.utils;
|
1642
|
-
_context2.next = 4;
|
1643
|
-
return cToken.decimals();
|
1644
|
-
|
1645
|
-
case 4:
|
1646
|
-
_context2.t1 = _context2.sent;
|
1647
|
-
cTokenAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
1648
|
-
_context2.next = 8;
|
1649
|
-
return cToken.transfer(vaultProxy, cTokenAmount);
|
1650
|
-
|
1651
|
-
case 8:
|
1652
|
-
_context2.t2 = protocol.StandardToken;
|
1653
|
-
_context2.next = 11;
|
1654
|
-
return compoundPriceFeed.getTokenFromCToken.args(cToken).call();
|
1655
|
-
|
1656
|
-
case 11:
|
1657
|
-
_context2.t3 = _context2.sent;
|
1658
|
-
_context2.t4 = provider;
|
1659
|
-
token = new _context2.t2(_context2.t3, _context2.t4);
|
1660
|
-
_context2.next = 16;
|
1661
|
-
return getAssetBalances({
|
1662
|
-
account: vaultProxy,
|
1663
|
-
assets: [token, cToken]
|
1664
|
-
});
|
1665
|
-
|
1666
|
-
case 16:
|
1667
|
-
_yield$getAssetBalanc5 = _context2.sent;
|
1668
|
-
_yield$getAssetBalanc6 = _slicedToArray(_yield$getAssetBalanc5, 2);
|
1669
|
-
preTxIncomingAssetBalance = _yield$getAssetBalanc6[0];
|
1670
|
-
preTxOutgoingAssetBalance = _yield$getAssetBalanc6[1];
|
1671
|
-
_context2.next = 22;
|
1672
|
-
return cToken.exchangeRateStored();
|
1673
|
-
|
1674
|
-
case 22:
|
1675
|
-
rateBefore = _context2.sent;
|
1676
|
-
minIncomingTokenAmount = cTokenAmount.mul(rateBefore).div(ethers.utils.parseEther('1'));
|
1677
|
-
_context2.next = 26;
|
1678
|
-
return compoundRedeem({
|
1679
|
-
cToken: cToken,
|
1680
|
-
cTokenAmount: cTokenAmount,
|
1681
|
-
compoundAdapter: compoundAdapter,
|
1682
|
-
comptrollerProxy: comptrollerProxy,
|
1683
|
-
fundOwner: fundOwner,
|
1684
|
-
integrationManager: integrationManager,
|
1685
|
-
tokenAmount: minIncomingTokenAmount,
|
1686
|
-
vaultProxy: vaultProxy
|
1687
|
-
});
|
1688
|
-
|
1689
|
-
case 26:
|
1690
|
-
redeemReceipt = _context2.sent;
|
1691
|
-
_context2.next = 29;
|
1692
|
-
return getAssetBalances({
|
1693
|
-
account: vaultProxy,
|
1694
|
-
assets: [token, cToken]
|
1695
|
-
});
|
1696
|
-
|
1697
|
-
case 29:
|
1698
|
-
_yield$getAssetBalanc7 = _context2.sent;
|
1699
|
-
_yield$getAssetBalanc8 = _slicedToArray(_yield$getAssetBalanc7, 2);
|
1700
|
-
postTxIncomingAssetBalance = _yield$getAssetBalanc8[0];
|
1701
|
-
postTxOutgoingAssetBalance = _yield$getAssetBalanc8[1];
|
1702
|
-
_context2.next = 35;
|
1703
|
-
return cToken.exchangeRateStored();
|
1704
|
-
|
1705
|
-
case 35:
|
1706
|
-
rate = _context2.sent;
|
1707
|
-
expectedTokenAmount = cTokenAmount.mul(rate).div(ethers.utils.parseEther('1'));
|
1708
|
-
expect(postTxIncomingAssetBalance).toEqBigNumber(preTxIncomingAssetBalance.add(expectedTokenAmount));
|
1709
|
-
expect(postTxOutgoingAssetBalance).toEqBigNumber(preTxOutgoingAssetBalance.sub(cTokenAmount));
|
1710
|
-
return _context2.abrupt("return", redeemReceipt);
|
1711
|
-
|
1712
|
-
case 40:
|
1713
|
-
case "end":
|
1714
|
-
return _context2.stop();
|
1715
|
-
}
|
1716
|
-
}
|
1717
|
-
}, _callee2);
|
1718
|
-
}));
|
1719
|
-
return _assertCompoundRedeem.apply(this, arguments);
|
1720
|
-
}
|
1721
|
-
|
1722
|
-
function compoundClaim(_x3) {
|
1723
|
-
return _compoundClaim.apply(this, arguments);
|
1724
|
-
}
|
1725
|
-
|
1726
|
-
function _compoundClaim() {
|
1727
|
-
_compoundClaim = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
1728
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, compoundComptroller, cTokens, claimArgs, callArgs, claimRewardsTx;
|
1729
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1730
|
-
while (1) {
|
1731
|
-
switch (_context3.prev = _context3.next) {
|
1732
|
-
case 0:
|
1733
|
-
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, compoundAdapter = _ref3.compoundAdapter, compoundComptroller = _ref3.compoundComptroller, cTokens = _ref3.cTokens;
|
1734
|
-
claimArgs = protocol.compoundClaimRewardsArgs({
|
1735
|
-
cTokens: cTokens,
|
1736
|
-
compoundComptroller: compoundComptroller
|
1737
|
-
});
|
1738
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1739
|
-
adapter: compoundAdapter,
|
1740
|
-
encodedCallArgs: claimArgs,
|
1741
|
-
selector: protocol.claimRewardsSelector
|
1742
|
-
});
|
1743
|
-
claimRewardsTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1744
|
-
return _context3.abrupt("return", claimRewardsTx);
|
1745
|
-
|
1746
|
-
case 5:
|
1747
|
-
case "end":
|
1748
|
-
return _context3.stop();
|
1749
|
-
}
|
1750
|
-
}
|
1751
|
-
}, _callee3);
|
1752
|
-
}));
|
1753
|
-
return _compoundClaim.apply(this, arguments);
|
1754
|
-
}
|
1755
|
-
|
1756
|
-
function compoundLend(_x4) {
|
1757
|
-
return _compoundLend.apply(this, arguments);
|
1758
|
-
}
|
1759
|
-
|
1760
|
-
function _compoundLend() {
|
1761
|
-
_compoundLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
1762
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref4$tokenAmount, tokenAmount, _ref4$cTokenAmount, cTokenAmount, lendArgs, callArgs, lendTx;
|
1763
|
-
|
1764
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1765
|
-
while (1) {
|
1766
|
-
switch (_context4.prev = _context4.next) {
|
1767
|
-
case 0:
|
1768
|
-
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, fundOwner = _ref4.fundOwner, compoundAdapter = _ref4.compoundAdapter, cToken = _ref4.cToken, _ref4$tokenAmount = _ref4.tokenAmount, tokenAmount = _ref4$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref4$tokenAmount, _ref4$cTokenAmount = _ref4.cTokenAmount, cTokenAmount = _ref4$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref4$cTokenAmount;
|
1769
|
-
lendArgs = protocol.compoundArgs({
|
1770
|
-
cToken: cToken,
|
1771
|
-
minIncomingAssetAmount: cTokenAmount,
|
1772
|
-
outgoingAssetAmount: tokenAmount
|
1773
|
-
});
|
1774
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1775
|
-
adapter: compoundAdapter,
|
1776
|
-
encodedCallArgs: lendArgs,
|
1777
|
-
selector: protocol.lendSelector
|
1778
|
-
});
|
1779
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1780
|
-
return _context4.abrupt("return", lendTx);
|
1781
|
-
|
1782
|
-
case 5:
|
1783
|
-
case "end":
|
1784
|
-
return _context4.stop();
|
1785
|
-
}
|
1786
|
-
}
|
1787
|
-
}, _callee4);
|
1788
|
-
}));
|
1789
|
-
return _compoundLend.apply(this, arguments);
|
1790
|
-
}
|
1791
|
-
|
1792
|
-
function compoundRedeem(_x5) {
|
1793
|
-
return _compoundRedeem.apply(this, arguments);
|
1794
|
-
}
|
1795
|
-
|
1796
|
-
function _compoundRedeem() {
|
1797
|
-
_compoundRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
1798
|
-
var comptrollerProxy, integrationManager, fundOwner, compoundAdapter, cToken, _ref5$tokenAmount, tokenAmount, _ref5$cTokenAmount, cTokenAmount, redeemArgs, callArgs, redeemTx;
|
1799
|
-
|
1800
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
1801
|
-
while (1) {
|
1802
|
-
switch (_context5.prev = _context5.next) {
|
1803
|
-
case 0:
|
1804
|
-
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, fundOwner = _ref5.fundOwner, compoundAdapter = _ref5.compoundAdapter, cToken = _ref5.cToken, _ref5$tokenAmount = _ref5.tokenAmount, tokenAmount = _ref5$tokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref5$tokenAmount, _ref5$cTokenAmount = _ref5.cTokenAmount, cTokenAmount = _ref5$cTokenAmount === void 0 ? ethers.utils.parseEther('1') : _ref5$cTokenAmount;
|
1805
|
-
redeemArgs = protocol.compoundArgs({
|
1806
|
-
cToken: ethers$1.resolveAddress(cToken),
|
1807
|
-
minIncomingAssetAmount: tokenAmount,
|
1808
|
-
outgoingAssetAmount: cTokenAmount
|
1809
|
-
});
|
1810
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1811
|
-
adapter: compoundAdapter,
|
1812
|
-
encodedCallArgs: redeemArgs,
|
1813
|
-
selector: protocol.redeemSelector
|
1814
|
-
});
|
1815
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1816
|
-
return _context5.abrupt("return", redeemTx);
|
1817
|
-
|
1818
|
-
case 5:
|
1819
|
-
case "end":
|
1820
|
-
return _context5.stop();
|
1821
|
-
}
|
1822
|
-
}
|
1823
|
-
}, _callee5);
|
1824
|
-
}));
|
1825
|
-
return _compoundRedeem.apply(this, arguments);
|
1826
|
-
}
|
1827
|
-
|
1828
|
-
var _templateObject$1, _templateObject2, _templateObject3, _templateObject4;
|
1829
|
-
var CurveLiquidityGaugeV2 = ethers$1.contract()(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n function claim_rewards(address)\n function integrate_fraction(address) view returns (uint256)\n"])));
|
1830
|
-
var CurveRegistry = ethers$1.contract()(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n function get_coins(address) view returns (address[8])\n function get_lp_token(address) view returns (address)\n"]))); // prettier-ignore
|
1831
|
-
|
1832
|
-
var CurveSwaps = ethers$1.contract()(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)\n"])));
|
1833
|
-
var CurveMinter = ethers$1.contract()(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n function mint_for(address,address)\n"]))); // exchanges
|
1834
|
-
|
1835
|
-
function curveTakeOrder(_x) {
|
1836
|
-
return _curveTakeOrder.apply(this, arguments);
|
1837
|
-
} // combined liquidity
|
1838
|
-
|
1839
|
-
function _curveTakeOrder() {
|
1840
|
-
_curveTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
1841
|
-
var comptrollerProxy, integrationManager, fundOwner, curveExchangeAdapter, pool, outgoingAsset, _ref$outgoingAssetAmo, outgoingAssetAmount, incomingAsset, _ref$minIncomingAsset, minIncomingAssetAmount, takeOrderArgs, callArgs;
|
1842
|
-
|
1843
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
1844
|
-
while (1) {
|
1845
|
-
switch (_context.prev = _context.next) {
|
1846
|
-
case 0:
|
1847
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, curveExchangeAdapter = _ref.curveExchangeAdapter, pool = _ref.pool, outgoingAsset = _ref.outgoingAsset, _ref$outgoingAssetAmo = _ref.outgoingAssetAmount, outgoingAssetAmount = _ref$outgoingAssetAmo === void 0 ? ethers.utils.parseEther('1') : _ref$outgoingAssetAmo, incomingAsset = _ref.incomingAsset, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? ethers.utils.parseEther('1') : _ref$minIncomingAsset;
|
1848
|
-
takeOrderArgs = protocol.curveTakeOrderArgs({
|
1849
|
-
incomingAsset: incomingAsset,
|
1850
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
1851
|
-
outgoingAsset: outgoingAsset,
|
1852
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
1853
|
-
pool: pool
|
1854
|
-
});
|
1855
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1856
|
-
adapter: curveExchangeAdapter,
|
1857
|
-
encodedCallArgs: takeOrderArgs,
|
1858
|
-
selector: protocol.takeOrderSelector
|
1859
|
-
});
|
1860
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1861
|
-
|
1862
|
-
case 4:
|
1863
|
-
case "end":
|
1864
|
-
return _context.stop();
|
1865
|
-
}
|
1866
|
-
}
|
1867
|
-
}, _callee);
|
1868
|
-
}));
|
1869
|
-
return _curveTakeOrder.apply(this, arguments);
|
1870
|
-
}
|
1871
|
-
|
1872
|
-
function curveClaimRewards(_ref2) {
|
1873
|
-
var comptrollerProxy = _ref2.comptrollerProxy,
|
1874
|
-
integrationManager = _ref2.integrationManager,
|
1875
|
-
fundOwner = _ref2.fundOwner,
|
1876
|
-
curveLiquidityAdapter = _ref2.curveLiquidityAdapter,
|
1877
|
-
stakingToken = _ref2.stakingToken;
|
1878
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
1879
|
-
adapter: curveLiquidityAdapter,
|
1880
|
-
encodedCallArgs: protocol.curveClaimRewardsArgs({
|
1881
|
-
stakingToken: stakingToken
|
1882
|
-
}),
|
1883
|
-
selector: protocol.claimRewardsSelector
|
1884
|
-
});
|
1885
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1886
|
-
}
|
1887
|
-
function curveLend(_x2) {
|
1888
|
-
return _curveLend.apply(this, arguments);
|
1889
|
-
}
|
1890
|
-
|
1891
|
-
function _curveLend() {
|
1892
|
-
_curveLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref3) {
|
1893
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo, minIncomingLpTokenAmount, useUnderlyings, callArgs;
|
1894
|
-
|
1895
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
1896
|
-
while (1) {
|
1897
|
-
switch (_context2.prev = _context2.next) {
|
1898
|
-
case 0:
|
1899
|
-
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, signer = _ref3.signer, curveLiquidityAdapter = _ref3.curveLiquidityAdapter, pool = _ref3.pool, orderedOutgoingAssetAmounts = _ref3.orderedOutgoingAssetAmounts, _ref3$minIncomingLpTo = _ref3.minIncomingLpTokenAmount, minIncomingLpTokenAmount = _ref3$minIncomingLpTo === void 0 ? ethers.BigNumber.from(1) : _ref3$minIncomingLpTo, useUnderlyings = _ref3.useUnderlyings;
|
1900
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1901
|
-
adapter: curveLiquidityAdapter,
|
1902
|
-
encodedCallArgs: protocol.curveLendArgs({
|
1903
|
-
minIncomingLpTokenAmount: minIncomingLpTokenAmount,
|
1904
|
-
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1905
|
-
pool: pool,
|
1906
|
-
useUnderlyings: useUnderlyings
|
1907
|
-
}),
|
1908
|
-
selector: protocol.lendSelector
|
1909
|
-
});
|
1910
|
-
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1911
|
-
|
1912
|
-
case 3:
|
1913
|
-
case "end":
|
1914
|
-
return _context2.stop();
|
1915
|
-
}
|
1916
|
-
}
|
1917
|
-
}, _callee2);
|
1918
|
-
}));
|
1919
|
-
return _curveLend.apply(this, arguments);
|
1920
|
-
}
|
1921
|
-
|
1922
|
-
function curveLendAndStake(_x3) {
|
1923
|
-
return _curveLendAndStake.apply(this, arguments);
|
1924
|
-
}
|
1925
|
-
|
1926
|
-
function _curveLendAndStake() {
|
1927
|
-
_curveLendAndStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref4) {
|
1928
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, orderedOutgoingAssetAmounts, incomingStakingToken, _ref4$minIncomingStak, minIncomingStakingTokenAmount, useUnderlyings, callArgs;
|
1929
|
-
|
1930
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
1931
|
-
while (1) {
|
1932
|
-
switch (_context3.prev = _context3.next) {
|
1933
|
-
case 0:
|
1934
|
-
comptrollerProxy = _ref4.comptrollerProxy, integrationManager = _ref4.integrationManager, signer = _ref4.signer, curveLiquidityAdapter = _ref4.curveLiquidityAdapter, pool = _ref4.pool, orderedOutgoingAssetAmounts = _ref4.orderedOutgoingAssetAmounts, incomingStakingToken = _ref4.incomingStakingToken, _ref4$minIncomingStak = _ref4.minIncomingStakingTokenAmount, minIncomingStakingTokenAmount = _ref4$minIncomingStak === void 0 ? ethers.BigNumber.from(1) : _ref4$minIncomingStak, useUnderlyings = _ref4.useUnderlyings;
|
1935
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1936
|
-
adapter: curveLiquidityAdapter,
|
1937
|
-
encodedCallArgs: protocol.curveLendAndStakeArgs({
|
1938
|
-
incomingStakingToken: incomingStakingToken,
|
1939
|
-
minIncomingStakingTokenAmount: minIncomingStakingTokenAmount,
|
1940
|
-
orderedOutgoingAssetAmounts: orderedOutgoingAssetAmounts,
|
1941
|
-
pool: pool,
|
1942
|
-
useUnderlyings: useUnderlyings
|
1943
|
-
}),
|
1944
|
-
selector: protocol.lendAndStakeSelector
|
1945
|
-
});
|
1946
|
-
return _context3.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1947
|
-
|
1948
|
-
case 3:
|
1949
|
-
case "end":
|
1950
|
-
return _context3.stop();
|
1951
|
-
}
|
1952
|
-
}
|
1953
|
-
}, _callee3);
|
1954
|
-
}));
|
1955
|
-
return _curveLendAndStake.apply(this, arguments);
|
1956
|
-
}
|
1957
|
-
|
1958
|
-
function curveRedeem(_x4) {
|
1959
|
-
return _curveRedeem.apply(this, arguments);
|
1960
|
-
}
|
1961
|
-
|
1962
|
-
function _curveRedeem() {
|
1963
|
-
_curveRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref5) {
|
1964
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingLpTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
1965
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
1966
|
-
while (1) {
|
1967
|
-
switch (_context4.prev = _context4.next) {
|
1968
|
-
case 0:
|
1969
|
-
comptrollerProxy = _ref5.comptrollerProxy, integrationManager = _ref5.integrationManager, signer = _ref5.signer, curveLiquidityAdapter = _ref5.curveLiquidityAdapter, pool = _ref5.pool, outgoingLpTokenAmount = _ref5.outgoingLpTokenAmount, useUnderlyings = _ref5.useUnderlyings, redeemType = _ref5.redeemType, incomingAssetData = _ref5.incomingAssetData;
|
1970
|
-
callArgs = protocol.callOnIntegrationArgs({
|
1971
|
-
adapter: curveLiquidityAdapter,
|
1972
|
-
encodedCallArgs: protocol.curveRedeemArgs({
|
1973
|
-
incomingAssetData: incomingAssetData,
|
1974
|
-
outgoingLpTokenAmount: outgoingLpTokenAmount,
|
1975
|
-
pool: pool,
|
1976
|
-
redeemType: redeemType,
|
1977
|
-
useUnderlyings: useUnderlyings
|
1978
|
-
}),
|
1979
|
-
selector: protocol.redeemSelector
|
1980
|
-
});
|
1981
|
-
return _context4.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
1982
|
-
|
1983
|
-
case 3:
|
1984
|
-
case "end":
|
1985
|
-
return _context4.stop();
|
1986
|
-
}
|
1987
|
-
}
|
1988
|
-
}, _callee4);
|
1989
|
-
}));
|
1990
|
-
return _curveRedeem.apply(this, arguments);
|
1991
|
-
}
|
1992
|
-
|
1993
|
-
function curveStake(_x5) {
|
1994
|
-
return _curveStake.apply(this, arguments);
|
1995
|
-
}
|
1996
|
-
|
1997
|
-
function _curveStake() {
|
1998
|
-
_curveStake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref6) {
|
1999
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, incomingStakingToken, amount, callArgs;
|
2000
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
2001
|
-
while (1) {
|
2002
|
-
switch (_context5.prev = _context5.next) {
|
2003
|
-
case 0:
|
2004
|
-
comptrollerProxy = _ref6.comptrollerProxy, integrationManager = _ref6.integrationManager, signer = _ref6.signer, curveLiquidityAdapter = _ref6.curveLiquidityAdapter, pool = _ref6.pool, incomingStakingToken = _ref6.incomingStakingToken, amount = _ref6.amount;
|
2005
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2006
|
-
adapter: curveLiquidityAdapter,
|
2007
|
-
encodedCallArgs: protocol.curveStakeArgs({
|
2008
|
-
amount: amount,
|
2009
|
-
incomingStakingToken: incomingStakingToken,
|
2010
|
-
pool: pool
|
2011
|
-
}),
|
2012
|
-
selector: protocol.stakeSelector
|
2013
|
-
});
|
2014
|
-
return _context5.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2015
|
-
|
2016
|
-
case 3:
|
2017
|
-
case "end":
|
2018
|
-
return _context5.stop();
|
2019
|
-
}
|
2020
|
-
}
|
2021
|
-
}, _callee5);
|
2022
|
-
}));
|
2023
|
-
return _curveStake.apply(this, arguments);
|
2024
|
-
}
|
2025
|
-
|
2026
|
-
function curveUnstake(_x6) {
|
2027
|
-
return _curveUnstake.apply(this, arguments);
|
2028
|
-
}
|
2029
|
-
|
2030
|
-
function _curveUnstake() {
|
2031
|
-
_curveUnstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref7) {
|
2032
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, amount, callArgs;
|
2033
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
2034
|
-
while (1) {
|
2035
|
-
switch (_context6.prev = _context6.next) {
|
2036
|
-
case 0:
|
2037
|
-
comptrollerProxy = _ref7.comptrollerProxy, integrationManager = _ref7.integrationManager, signer = _ref7.signer, curveLiquidityAdapter = _ref7.curveLiquidityAdapter, pool = _ref7.pool, outgoingStakingToken = _ref7.outgoingStakingToken, amount = _ref7.amount;
|
2038
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2039
|
-
adapter: curveLiquidityAdapter,
|
2040
|
-
encodedCallArgs: protocol.curveUnstakeArgs({
|
2041
|
-
amount: amount,
|
2042
|
-
outgoingStakingToken: outgoingStakingToken,
|
2043
|
-
pool: pool
|
2044
|
-
}),
|
2045
|
-
selector: protocol.unstakeSelector
|
2046
|
-
});
|
2047
|
-
return _context6.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2048
|
-
|
2049
|
-
case 3:
|
2050
|
-
case "end":
|
2051
|
-
return _context6.stop();
|
2052
|
-
}
|
2053
|
-
}
|
2054
|
-
}, _callee6);
|
2055
|
-
}));
|
2056
|
-
return _curveUnstake.apply(this, arguments);
|
2057
|
-
}
|
2058
|
-
|
2059
|
-
function curveUnstakeAndRedeem(_x7) {
|
2060
|
-
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2061
|
-
} // aave pool
|
2062
|
-
|
2063
|
-
function _curveUnstakeAndRedeem() {
|
2064
|
-
_curveUnstakeAndRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(_ref8) {
|
2065
|
-
var comptrollerProxy, integrationManager, signer, curveLiquidityAdapter, pool, outgoingStakingToken, outgoingStakingTokenAmount, useUnderlyings, redeemType, incomingAssetData, callArgs;
|
2066
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
2067
|
-
while (1) {
|
2068
|
-
switch (_context7.prev = _context7.next) {
|
2069
|
-
case 0:
|
2070
|
-
comptrollerProxy = _ref8.comptrollerProxy, integrationManager = _ref8.integrationManager, signer = _ref8.signer, curveLiquidityAdapter = _ref8.curveLiquidityAdapter, pool = _ref8.pool, outgoingStakingToken = _ref8.outgoingStakingToken, outgoingStakingTokenAmount = _ref8.outgoingStakingTokenAmount, useUnderlyings = _ref8.useUnderlyings, redeemType = _ref8.redeemType, incomingAssetData = _ref8.incomingAssetData;
|
2071
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2072
|
-
adapter: curveLiquidityAdapter,
|
2073
|
-
encodedCallArgs: protocol.curveUnstakeAndRedeemArgs({
|
2074
|
-
incomingAssetData: incomingAssetData,
|
2075
|
-
outgoingStakingToken: outgoingStakingToken,
|
2076
|
-
outgoingStakingTokenAmount: outgoingStakingTokenAmount,
|
2077
|
-
pool: pool,
|
2078
|
-
redeemType: redeemType,
|
2079
|
-
useUnderlyings: useUnderlyings
|
2080
|
-
}),
|
2081
|
-
selector: protocol.unstakeAndRedeemSelector
|
2082
|
-
});
|
2083
|
-
return _context7.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2084
|
-
|
2085
|
-
case 3:
|
2086
|
-
case "end":
|
2087
|
-
return _context7.stop();
|
2088
|
-
}
|
2089
|
-
}
|
2090
|
-
}, _callee7);
|
2091
|
-
}));
|
2092
|
-
return _curveUnstakeAndRedeem.apply(this, arguments);
|
2093
|
-
}
|
2094
|
-
|
2095
|
-
function curveAaveClaimRewards(_ref9) {
|
2096
|
-
var comptrollerProxy = _ref9.comptrollerProxy,
|
2097
|
-
integrationManager = _ref9.integrationManager,
|
2098
|
-
fundOwner = _ref9.fundOwner,
|
2099
|
-
curveLiquidityAaveAdapter = _ref9.curveLiquidityAaveAdapter;
|
2100
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2101
|
-
adapter: curveLiquidityAaveAdapter,
|
2102
|
-
encodedCallArgs: ethers.constants.HashZero,
|
2103
|
-
selector: protocol.claimRewardsSelector
|
2104
|
-
});
|
2105
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2106
|
-
}
|
2107
|
-
function curveAaveLend(_ref10) {
|
2108
|
-
var comptrollerProxy = _ref10.comptrollerProxy,
|
2109
|
-
integrationManager = _ref10.integrationManager,
|
2110
|
-
fundOwner = _ref10.fundOwner,
|
2111
|
-
curveLiquidityAaveAdapter = _ref10.curveLiquidityAaveAdapter,
|
2112
|
-
_ref10$outgoingAaveDa = _ref10.outgoingAaveDaiAmount,
|
2113
|
-
outgoingAaveDaiAmount = _ref10$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveDa,
|
2114
|
-
_ref10$outgoingAaveUs = _ref10.outgoingAaveUsdcAmount,
|
2115
|
-
outgoingAaveUsdcAmount = _ref10$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs,
|
2116
|
-
_ref10$outgoingAaveUs2 = _ref10.outgoingAaveUsdtAmount,
|
2117
|
-
outgoingAaveUsdtAmount = _ref10$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref10$outgoingAaveUs2,
|
2118
|
-
_ref10$minIncomingLPT = _ref10.minIncomingLPTokenAmount,
|
2119
|
-
minIncomingLPTokenAmount = _ref10$minIncomingLPT === void 0 ? ethers.BigNumber.from(1) : _ref10$minIncomingLPT,
|
2120
|
-
_ref10$useUnderlyings = _ref10.useUnderlyings,
|
2121
|
-
useUnderlyings = _ref10$useUnderlyings === void 0 ? false : _ref10$useUnderlyings;
|
2122
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2123
|
-
adapter: curveLiquidityAaveAdapter,
|
2124
|
-
encodedCallArgs: protocol.curveAaveLendArgs({
|
2125
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
2126
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
2127
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
2128
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
2129
|
-
useUnderlyings: useUnderlyings
|
2130
|
-
}),
|
2131
|
-
selector: protocol.lendSelector
|
2132
|
-
});
|
2133
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2134
|
-
}
|
2135
|
-
function curveAaveLendAndStake(_ref11) {
|
2136
|
-
var comptrollerProxy = _ref11.comptrollerProxy,
|
2137
|
-
integrationManager = _ref11.integrationManager,
|
2138
|
-
fundOwner = _ref11.fundOwner,
|
2139
|
-
curveLiquidityAaveAdapter = _ref11.curveLiquidityAaveAdapter,
|
2140
|
-
_ref11$outgoingAaveDa = _ref11.outgoingAaveDaiAmount,
|
2141
|
-
outgoingAaveDaiAmount = _ref11$outgoingAaveDa === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveDa,
|
2142
|
-
_ref11$outgoingAaveUs = _ref11.outgoingAaveUsdcAmount,
|
2143
|
-
outgoingAaveUsdcAmount = _ref11$outgoingAaveUs === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs,
|
2144
|
-
_ref11$outgoingAaveUs2 = _ref11.outgoingAaveUsdtAmount,
|
2145
|
-
outgoingAaveUsdtAmount = _ref11$outgoingAaveUs2 === void 0 ? ethers.BigNumber.from(0) : _ref11$outgoingAaveUs2,
|
2146
|
-
_ref11$minIncomingLiq = _ref11.minIncomingLiquidityGaugeTokenAmount,
|
2147
|
-
minIncomingLiquidityGaugeTokenAmount = _ref11$minIncomingLiq === void 0 ? ethers.BigNumber.from(1) : _ref11$minIncomingLiq,
|
2148
|
-
_ref11$useUnderlyings = _ref11.useUnderlyings,
|
2149
|
-
useUnderlyings = _ref11$useUnderlyings === void 0 ? false : _ref11$useUnderlyings;
|
2150
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2151
|
-
adapter: curveLiquidityAaveAdapter,
|
2152
|
-
encodedCallArgs: protocol.curveAaveLendAndStakeArgs({
|
2153
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
2154
|
-
outgoingAaveDaiAmount: outgoingAaveDaiAmount,
|
2155
|
-
outgoingAaveUsdcAmount: outgoingAaveUsdcAmount,
|
2156
|
-
outgoingAaveUsdtAmount: outgoingAaveUsdtAmount,
|
2157
|
-
useUnderlyings: useUnderlyings
|
2158
|
-
}),
|
2159
|
-
selector: protocol.lendAndStakeSelector
|
2160
|
-
});
|
2161
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2162
|
-
}
|
2163
|
-
function curveAaveRedeem(_ref12) {
|
2164
|
-
var comptrollerProxy = _ref12.comptrollerProxy,
|
2165
|
-
integrationManager = _ref12.integrationManager,
|
2166
|
-
fundOwner = _ref12.fundOwner,
|
2167
|
-
curveLiquidityAaveAdapter = _ref12.curveLiquidityAaveAdapter,
|
2168
|
-
outgoingLPTokenAmount = _ref12.outgoingLPTokenAmount,
|
2169
|
-
_ref12$minIncomingAav = _ref12.minIncomingAaveDaiAmount,
|
2170
|
-
minIncomingAaveDaiAmount = _ref12$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav,
|
2171
|
-
_ref12$minIncomingAav2 = _ref12.minIncomingAaveUsdcAmount,
|
2172
|
-
minIncomingAaveUsdcAmount = _ref12$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav2,
|
2173
|
-
_ref12$minIncomingAav3 = _ref12.minIncomingAaveUsdtAmount,
|
2174
|
-
minIncomingAaveUsdtAmount = _ref12$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref12$minIncomingAav3,
|
2175
|
-
_ref12$receiveSingleA = _ref12.receiveSingleAsset,
|
2176
|
-
receiveSingleAsset = _ref12$receiveSingleA === void 0 ? false : _ref12$receiveSingleA,
|
2177
|
-
_ref12$useUnderlyings = _ref12.useUnderlyings,
|
2178
|
-
useUnderlyings = _ref12$useUnderlyings === void 0 ? false : _ref12$useUnderlyings;
|
2179
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2180
|
-
adapter: curveLiquidityAaveAdapter,
|
2181
|
-
encodedCallArgs: protocol.curveAaveRedeemArgs({
|
2182
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
2183
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
2184
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
2185
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
2186
|
-
receiveSingleAsset: receiveSingleAsset,
|
2187
|
-
useUnderlyings: useUnderlyings
|
2188
|
-
}),
|
2189
|
-
selector: protocol.redeemSelector
|
2190
|
-
});
|
2191
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2192
|
-
}
|
2193
|
-
function curveAaveStake(_ref13) {
|
2194
|
-
var comptrollerProxy = _ref13.comptrollerProxy,
|
2195
|
-
integrationManager = _ref13.integrationManager,
|
2196
|
-
fundOwner = _ref13.fundOwner,
|
2197
|
-
curveLiquidityAaveAdapter = _ref13.curveLiquidityAaveAdapter,
|
2198
|
-
outgoingLPTokenAmount = _ref13.outgoingLPTokenAmount;
|
2199
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2200
|
-
adapter: curveLiquidityAaveAdapter,
|
2201
|
-
encodedCallArgs: protocol.curveAaveStakeArgs({
|
2202
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
2203
|
-
}),
|
2204
|
-
selector: protocol.stakeSelector
|
2205
|
-
});
|
2206
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2207
|
-
}
|
2208
|
-
function curveAaveUnstakeAndRedeem(_ref14) {
|
2209
|
-
var comptrollerProxy = _ref14.comptrollerProxy,
|
2210
|
-
integrationManager = _ref14.integrationManager,
|
2211
|
-
fundOwner = _ref14.fundOwner,
|
2212
|
-
curveLiquidityAaveAdapter = _ref14.curveLiquidityAaveAdapter,
|
2213
|
-
outgoingLiquidityGaugeTokenAmount = _ref14.outgoingLiquidityGaugeTokenAmount,
|
2214
|
-
_ref14$minIncomingAav = _ref14.minIncomingAaveDaiAmount,
|
2215
|
-
minIncomingAaveDaiAmount = _ref14$minIncomingAav === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav,
|
2216
|
-
_ref14$minIncomingAav2 = _ref14.minIncomingAaveUsdcAmount,
|
2217
|
-
minIncomingAaveUsdcAmount = _ref14$minIncomingAav2 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav2,
|
2218
|
-
_ref14$minIncomingAav3 = _ref14.minIncomingAaveUsdtAmount,
|
2219
|
-
minIncomingAaveUsdtAmount = _ref14$minIncomingAav3 === void 0 ? ethers.BigNumber.from(1) : _ref14$minIncomingAav3,
|
2220
|
-
_ref14$receiveSingleA = _ref14.receiveSingleAsset,
|
2221
|
-
receiveSingleAsset = _ref14$receiveSingleA === void 0 ? false : _ref14$receiveSingleA,
|
2222
|
-
_ref14$useUnderlyings = _ref14.useUnderlyings,
|
2223
|
-
useUnderlyings = _ref14$useUnderlyings === void 0 ? false : _ref14$useUnderlyings;
|
2224
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2225
|
-
adapter: curveLiquidityAaveAdapter,
|
2226
|
-
encodedCallArgs: protocol.curveAaveUnstakeAndRedeemArgs({
|
2227
|
-
minIncomingAaveDaiAmount: minIncomingAaveDaiAmount,
|
2228
|
-
minIncomingAaveUsdcAmount: minIncomingAaveUsdcAmount,
|
2229
|
-
minIncomingAaveUsdtAmount: minIncomingAaveUsdtAmount,
|
2230
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
2231
|
-
receiveSingleAsset: receiveSingleAsset,
|
2232
|
-
useUnderlyings: useUnderlyings
|
2233
|
-
}),
|
2234
|
-
selector: protocol.unstakeAndRedeemSelector
|
2235
|
-
});
|
2236
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2237
|
-
}
|
2238
|
-
function curveAaveUnstake(_ref15) {
|
2239
|
-
var comptrollerProxy = _ref15.comptrollerProxy,
|
2240
|
-
integrationManager = _ref15.integrationManager,
|
2241
|
-
fundOwner = _ref15.fundOwner,
|
2242
|
-
curveLiquidityAaveAdapter = _ref15.curveLiquidityAaveAdapter,
|
2243
|
-
outgoingLiquidityGaugeTokenAmount = _ref15.outgoingLiquidityGaugeTokenAmount;
|
2244
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2245
|
-
adapter: curveLiquidityAaveAdapter,
|
2246
|
-
encodedCallArgs: protocol.curveAaveUnstakeArgs({
|
2247
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
2248
|
-
}),
|
2249
|
-
selector: protocol.unstakeSelector
|
2250
|
-
});
|
2251
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2252
|
-
} // sETH pool
|
2253
|
-
|
2254
|
-
function curveSethClaimRewards(_ref16) {
|
2255
|
-
var comptrollerProxy = _ref16.comptrollerProxy,
|
2256
|
-
integrationManager = _ref16.integrationManager,
|
2257
|
-
fundOwner = _ref16.fundOwner,
|
2258
|
-
curveLiquiditySethAdapter = _ref16.curveLiquiditySethAdapter;
|
2259
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2260
|
-
adapter: curveLiquiditySethAdapter,
|
2261
|
-
encodedCallArgs: ethers.constants.HashZero,
|
2262
|
-
selector: protocol.claimRewardsSelector
|
2263
|
-
});
|
2264
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2265
|
-
}
|
2266
|
-
function curveSethLend(_ref17) {
|
2267
|
-
var comptrollerProxy = _ref17.comptrollerProxy,
|
2268
|
-
integrationManager = _ref17.integrationManager,
|
2269
|
-
fundOwner = _ref17.fundOwner,
|
2270
|
-
curveLiquiditySethAdapter = _ref17.curveLiquiditySethAdapter,
|
2271
|
-
outgoingWethAmount = _ref17.outgoingWethAmount,
|
2272
|
-
outgoingSethAmount = _ref17.outgoingSethAmount,
|
2273
|
-
minIncomingLPTokenAmount = _ref17.minIncomingLPTokenAmount;
|
2274
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2275
|
-
adapter: curveLiquiditySethAdapter,
|
2276
|
-
encodedCallArgs: protocol.curveSethLendArgs({
|
2277
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
2278
|
-
outgoingSethAmount: outgoingSethAmount,
|
2279
|
-
outgoingWethAmount: outgoingWethAmount
|
2280
|
-
}),
|
2281
|
-
selector: protocol.lendSelector
|
2282
|
-
});
|
2283
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2284
|
-
}
|
2285
|
-
function curveSethLendAndStake(_ref18) {
|
2286
|
-
var comptrollerProxy = _ref18.comptrollerProxy,
|
2287
|
-
integrationManager = _ref18.integrationManager,
|
2288
|
-
fundOwner = _ref18.fundOwner,
|
2289
|
-
curveLiquiditySethAdapter = _ref18.curveLiquiditySethAdapter,
|
2290
|
-
outgoingWethAmount = _ref18.outgoingWethAmount,
|
2291
|
-
outgoingSethAmount = _ref18.outgoingSethAmount,
|
2292
|
-
minIncomingLiquidityGaugeTokenAmount = _ref18.minIncomingLiquidityGaugeTokenAmount;
|
2293
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2294
|
-
adapter: curveLiquiditySethAdapter,
|
2295
|
-
encodedCallArgs: protocol.curveSethLendAndStakeArgs({
|
2296
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
2297
|
-
outgoingSethAmount: outgoingSethAmount,
|
2298
|
-
outgoingWethAmount: outgoingWethAmount
|
2299
|
-
}),
|
2300
|
-
selector: protocol.lendAndStakeSelector
|
2301
|
-
});
|
2302
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2303
|
-
}
|
2304
|
-
function curveSethRedeem(_ref19) {
|
2305
|
-
var comptrollerProxy = _ref19.comptrollerProxy,
|
2306
|
-
integrationManager = _ref19.integrationManager,
|
2307
|
-
fundOwner = _ref19.fundOwner,
|
2308
|
-
curveLiquiditySethAdapter = _ref19.curveLiquiditySethAdapter,
|
2309
|
-
outgoingLPTokenAmount = _ref19.outgoingLPTokenAmount,
|
2310
|
-
minIncomingWethAmount = _ref19.minIncomingWethAmount,
|
2311
|
-
minIncomingSethAmount = _ref19.minIncomingSethAmount,
|
2312
|
-
receiveSingleAsset = _ref19.receiveSingleAsset;
|
2313
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2314
|
-
adapter: curveLiquiditySethAdapter,
|
2315
|
-
encodedCallArgs: protocol.curveSethRedeemArgs({
|
2316
|
-
minIncomingSethAmount: minIncomingSethAmount,
|
2317
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2318
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
2319
|
-
receiveSingleAsset: receiveSingleAsset
|
2320
|
-
}),
|
2321
|
-
selector: protocol.redeemSelector
|
2322
|
-
});
|
2323
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2324
|
-
}
|
2325
|
-
function curveSethStake(_ref20) {
|
2326
|
-
var comptrollerProxy = _ref20.comptrollerProxy,
|
2327
|
-
integrationManager = _ref20.integrationManager,
|
2328
|
-
fundOwner = _ref20.fundOwner,
|
2329
|
-
curveLiquiditySethAdapter = _ref20.curveLiquiditySethAdapter,
|
2330
|
-
outgoingLPTokenAmount = _ref20.outgoingLPTokenAmount;
|
2331
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2332
|
-
adapter: curveLiquiditySethAdapter,
|
2333
|
-
encodedCallArgs: protocol.curveSethStakeArgs({
|
2334
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
2335
|
-
}),
|
2336
|
-
selector: protocol.stakeSelector
|
2337
|
-
});
|
2338
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2339
|
-
}
|
2340
|
-
function curveSethUnstakeAndRedeem(_ref21) {
|
2341
|
-
var comptrollerProxy = _ref21.comptrollerProxy,
|
2342
|
-
integrationManager = _ref21.integrationManager,
|
2343
|
-
fundOwner = _ref21.fundOwner,
|
2344
|
-
curveLiquiditySethAdapter = _ref21.curveLiquiditySethAdapter,
|
2345
|
-
outgoingLiquidityGaugeTokenAmount = _ref21.outgoingLiquidityGaugeTokenAmount,
|
2346
|
-
minIncomingWethAmount = _ref21.minIncomingWethAmount,
|
2347
|
-
minIncomingSethAmount = _ref21.minIncomingSethAmount,
|
2348
|
-
receiveSingleAsset = _ref21.receiveSingleAsset;
|
2349
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2350
|
-
adapter: curveLiquiditySethAdapter,
|
2351
|
-
encodedCallArgs: protocol.curveSethUnstakeAndRedeemArgs({
|
2352
|
-
minIncomingSethAmount: minIncomingSethAmount,
|
2353
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2354
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
2355
|
-
receiveSingleAsset: receiveSingleAsset
|
2356
|
-
}),
|
2357
|
-
selector: protocol.unstakeAndRedeemSelector
|
2358
|
-
});
|
2359
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2360
|
-
}
|
2361
|
-
function curveSethUnstake(_ref22) {
|
2362
|
-
var comptrollerProxy = _ref22.comptrollerProxy,
|
2363
|
-
integrationManager = _ref22.integrationManager,
|
2364
|
-
fundOwner = _ref22.fundOwner,
|
2365
|
-
curveLiquiditySethAdapter = _ref22.curveLiquiditySethAdapter,
|
2366
|
-
outgoingLiquidityGaugeTokenAmount = _ref22.outgoingLiquidityGaugeTokenAmount;
|
2367
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2368
|
-
adapter: curveLiquiditySethAdapter,
|
2369
|
-
encodedCallArgs: protocol.curveSethUnstakeArgs({
|
2370
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
2371
|
-
}),
|
2372
|
-
selector: protocol.unstakeSelector
|
2373
|
-
});
|
2374
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2375
|
-
} // stETH pool
|
2376
|
-
|
2377
|
-
function curveStethClaimRewards(_ref23) {
|
2378
|
-
var comptrollerProxy = _ref23.comptrollerProxy,
|
2379
|
-
integrationManager = _ref23.integrationManager,
|
2380
|
-
fundOwner = _ref23.fundOwner,
|
2381
|
-
curveLiquidityStethAdapter = _ref23.curveLiquidityStethAdapter;
|
2382
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2383
|
-
adapter: curveLiquidityStethAdapter,
|
2384
|
-
encodedCallArgs: ethers.constants.HashZero,
|
2385
|
-
selector: protocol.claimRewardsSelector
|
2386
|
-
});
|
2387
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2388
|
-
}
|
2389
|
-
function curveStethLend(_ref24) {
|
2390
|
-
var comptrollerProxy = _ref24.comptrollerProxy,
|
2391
|
-
integrationManager = _ref24.integrationManager,
|
2392
|
-
fundOwner = _ref24.fundOwner,
|
2393
|
-
curveLiquidityStethAdapter = _ref24.curveLiquidityStethAdapter,
|
2394
|
-
outgoingWethAmount = _ref24.outgoingWethAmount,
|
2395
|
-
outgoingStethAmount = _ref24.outgoingStethAmount,
|
2396
|
-
minIncomingLPTokenAmount = _ref24.minIncomingLPTokenAmount;
|
2397
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2398
|
-
adapter: curveLiquidityStethAdapter,
|
2399
|
-
encodedCallArgs: protocol.curveStethLendArgs({
|
2400
|
-
minIncomingLPTokenAmount: minIncomingLPTokenAmount,
|
2401
|
-
outgoingStethAmount: outgoingStethAmount,
|
2402
|
-
outgoingWethAmount: outgoingWethAmount
|
2403
|
-
}),
|
2404
|
-
selector: protocol.lendSelector
|
2405
|
-
});
|
2406
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2407
|
-
}
|
2408
|
-
function curveStethLendAndStake(_ref25) {
|
2409
|
-
var comptrollerProxy = _ref25.comptrollerProxy,
|
2410
|
-
integrationManager = _ref25.integrationManager,
|
2411
|
-
fundOwner = _ref25.fundOwner,
|
2412
|
-
curveLiquidityStethAdapter = _ref25.curveLiquidityStethAdapter,
|
2413
|
-
outgoingWethAmount = _ref25.outgoingWethAmount,
|
2414
|
-
outgoingStethAmount = _ref25.outgoingStethAmount,
|
2415
|
-
minIncomingLiquidityGaugeTokenAmount = _ref25.minIncomingLiquidityGaugeTokenAmount;
|
2416
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2417
|
-
adapter: curveLiquidityStethAdapter,
|
2418
|
-
encodedCallArgs: protocol.curveStethLendAndStakeArgs({
|
2419
|
-
minIncomingLiquidityGaugeTokenAmount: minIncomingLiquidityGaugeTokenAmount,
|
2420
|
-
outgoingStethAmount: outgoingStethAmount,
|
2421
|
-
outgoingWethAmount: outgoingWethAmount
|
2422
|
-
}),
|
2423
|
-
selector: protocol.lendAndStakeSelector
|
2424
|
-
});
|
2425
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2426
|
-
}
|
2427
|
-
function curveStethRedeem(_ref26) {
|
2428
|
-
var comptrollerProxy = _ref26.comptrollerProxy,
|
2429
|
-
integrationManager = _ref26.integrationManager,
|
2430
|
-
fundOwner = _ref26.fundOwner,
|
2431
|
-
curveLiquidityStethAdapter = _ref26.curveLiquidityStethAdapter,
|
2432
|
-
outgoingLPTokenAmount = _ref26.outgoingLPTokenAmount,
|
2433
|
-
minIncomingWethAmount = _ref26.minIncomingWethAmount,
|
2434
|
-
minIncomingStethAmount = _ref26.minIncomingStethAmount,
|
2435
|
-
receiveSingleAsset = _ref26.receiveSingleAsset;
|
2436
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2437
|
-
adapter: curveLiquidityStethAdapter,
|
2438
|
-
encodedCallArgs: protocol.curveStethRedeemArgs({
|
2439
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
2440
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2441
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount,
|
2442
|
-
receiveSingleAsset: receiveSingleAsset
|
2443
|
-
}),
|
2444
|
-
selector: protocol.redeemSelector
|
2445
|
-
});
|
2446
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2447
|
-
}
|
2448
|
-
function curveStethStake(_ref27) {
|
2449
|
-
var comptrollerProxy = _ref27.comptrollerProxy,
|
2450
|
-
integrationManager = _ref27.integrationManager,
|
2451
|
-
fundOwner = _ref27.fundOwner,
|
2452
|
-
curveLiquidityStethAdapter = _ref27.curveLiquidityStethAdapter,
|
2453
|
-
outgoingLPTokenAmount = _ref27.outgoingLPTokenAmount;
|
2454
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2455
|
-
adapter: curveLiquidityStethAdapter,
|
2456
|
-
encodedCallArgs: protocol.curveStethStakeArgs({
|
2457
|
-
outgoingLPTokenAmount: outgoingLPTokenAmount
|
2458
|
-
}),
|
2459
|
-
selector: protocol.stakeSelector
|
2460
|
-
});
|
2461
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2462
|
-
}
|
2463
|
-
function curveStethUnstakeAndRedeem(_ref28) {
|
2464
|
-
var comptrollerProxy = _ref28.comptrollerProxy,
|
2465
|
-
integrationManager = _ref28.integrationManager,
|
2466
|
-
fundOwner = _ref28.fundOwner,
|
2467
|
-
curveLiquidityStethAdapter = _ref28.curveLiquidityStethAdapter,
|
2468
|
-
outgoingLiquidityGaugeTokenAmount = _ref28.outgoingLiquidityGaugeTokenAmount,
|
2469
|
-
minIncomingWethAmount = _ref28.minIncomingWethAmount,
|
2470
|
-
minIncomingStethAmount = _ref28.minIncomingStethAmount,
|
2471
|
-
receiveSingleAsset = _ref28.receiveSingleAsset;
|
2472
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2473
|
-
adapter: curveLiquidityStethAdapter,
|
2474
|
-
encodedCallArgs: protocol.curveStethUnstakeAndRedeemArgs({
|
2475
|
-
minIncomingStethAmount: minIncomingStethAmount,
|
2476
|
-
minIncomingWethAmount: minIncomingWethAmount,
|
2477
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount,
|
2478
|
-
receiveSingleAsset: receiveSingleAsset
|
2479
|
-
}),
|
2480
|
-
selector: protocol.unstakeAndRedeemSelector
|
2481
|
-
});
|
2482
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2483
|
-
}
|
2484
|
-
function curveStethUnstake(_ref29) {
|
2485
|
-
var comptrollerProxy = _ref29.comptrollerProxy,
|
2486
|
-
integrationManager = _ref29.integrationManager,
|
2487
|
-
fundOwner = _ref29.fundOwner,
|
2488
|
-
curveLiquidityStethAdapter = _ref29.curveLiquidityStethAdapter,
|
2489
|
-
outgoingLiquidityGaugeTokenAmount = _ref29.outgoingLiquidityGaugeTokenAmount;
|
2490
|
-
var callArgs = protocol.callOnIntegrationArgs({
|
2491
|
-
adapter: curveLiquidityStethAdapter,
|
2492
|
-
encodedCallArgs: protocol.curveStethUnstakeArgs({
|
2493
|
-
outgoingLiquidityGaugeTokenAmount: outgoingLiquidityGaugeTokenAmount
|
2494
|
-
}),
|
2495
|
-
selector: protocol.unstakeSelector
|
2496
|
-
});
|
2497
|
-
return comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2498
|
-
}
|
2499
|
-
|
2500
|
-
function idleClaimRewards(_x) {
|
2501
|
-
return _idleClaimRewards.apply(this, arguments);
|
2502
|
-
}
|
2503
|
-
|
2504
|
-
function _idleClaimRewards() {
|
2505
|
-
_idleClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2506
|
-
var comptrollerProxy, integrationManager, fundOwner, idleAdapter, idleToken, callArgs;
|
2507
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2508
|
-
while (1) {
|
2509
|
-
switch (_context.prev = _context.next) {
|
2510
|
-
case 0:
|
2511
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, idleAdapter = _ref.idleAdapter, idleToken = _ref.idleToken;
|
2512
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2513
|
-
adapter: idleAdapter,
|
2514
|
-
encodedCallArgs: protocol.idleClaimRewardsArgs({
|
2515
|
-
idleToken: idleToken
|
2516
|
-
}),
|
2517
|
-
selector: protocol.claimRewardsSelector
|
2518
|
-
});
|
2519
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2520
|
-
|
2521
|
-
case 3:
|
2522
|
-
case "end":
|
2523
|
-
return _context.stop();
|
2524
|
-
}
|
2525
|
-
}
|
2526
|
-
}, _callee);
|
2527
|
-
}));
|
2528
|
-
return _idleClaimRewards.apply(this, arguments);
|
2529
|
-
}
|
2530
|
-
|
2531
|
-
function idleLend(_x2) {
|
2532
|
-
return _idleLend.apply(this, arguments);
|
2533
|
-
}
|
2534
|
-
|
2535
|
-
function _idleLend() {
|
2536
|
-
_idleLend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2537
|
-
var comptrollerProxy, integrationManager, fundOwner, idleAdapter, idleToken, outgoingUnderlyingAmount, _ref2$minIncomingIdle, minIncomingIdleTokenAmount, callArgs;
|
2538
|
-
|
2539
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2540
|
-
while (1) {
|
2541
|
-
switch (_context2.prev = _context2.next) {
|
2542
|
-
case 0:
|
2543
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, idleAdapter = _ref2.idleAdapter, idleToken = _ref2.idleToken, outgoingUnderlyingAmount = _ref2.outgoingUnderlyingAmount, _ref2$minIncomingIdle = _ref2.minIncomingIdleTokenAmount, minIncomingIdleTokenAmount = _ref2$minIncomingIdle === void 0 ? ethers.BigNumber.from(1) : _ref2$minIncomingIdle;
|
2544
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2545
|
-
adapter: idleAdapter,
|
2546
|
-
encodedCallArgs: protocol.idleLendArgs({
|
2547
|
-
idleToken: idleToken,
|
2548
|
-
minIncomingIdleTokenAmount: minIncomingIdleTokenAmount,
|
2549
|
-
outgoingUnderlyingAmount: outgoingUnderlyingAmount
|
2550
|
-
}),
|
2551
|
-
selector: protocol.lendSelector
|
2552
|
-
});
|
2553
|
-
return _context2.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2554
|
-
|
2555
|
-
case 3:
|
2556
|
-
case "end":
|
2557
|
-
return _context2.stop();
|
2558
|
-
}
|
2559
|
-
}
|
2560
|
-
}, _callee2);
|
2561
|
-
}));
|
2562
|
-
return _idleLend.apply(this, arguments);
|
2563
|
-
}
|
2564
|
-
|
2565
|
-
function idleRedeem(_x3) {
|
2566
|
-
return _idleRedeem.apply(this, arguments);
|
2567
|
-
}
|
2568
|
-
|
2569
|
-
function _idleRedeem() {
|
2570
|
-
_idleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2571
|
-
var comptrollerProxy, integrationManager, fundOwner, idleAdapter, idleToken, outgoingIdleTokenAmount, _ref3$minIncomingUnde, minIncomingUnderlyingAmount, callArgs;
|
2572
|
-
|
2573
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2574
|
-
while (1) {
|
2575
|
-
switch (_context3.prev = _context3.next) {
|
2576
|
-
case 0:
|
2577
|
-
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, idleAdapter = _ref3.idleAdapter, idleToken = _ref3.idleToken, outgoingIdleTokenAmount = _ref3.outgoingIdleTokenAmount, _ref3$minIncomingUnde = _ref3.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref3$minIncomingUnde === void 0 ? ethers.BigNumber.from(1) : _ref3$minIncomingUnde;
|
2578
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2579
|
-
adapter: idleAdapter,
|
2580
|
-
encodedCallArgs: protocol.idleRedeemArgs({
|
2581
|
-
idleToken: idleToken,
|
2582
|
-
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
2583
|
-
outgoingIdleTokenAmount: outgoingIdleTokenAmount
|
2584
|
-
}),
|
2585
|
-
selector: protocol.redeemSelector
|
2586
|
-
});
|
2587
|
-
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2588
|
-
|
2589
|
-
case 3:
|
2590
|
-
case "end":
|
2591
|
-
return _context3.stop();
|
2592
|
-
}
|
2593
|
-
}
|
2594
|
-
}, _callee3);
|
2595
|
-
}));
|
2596
|
-
return _idleRedeem.apply(this, arguments);
|
2597
|
-
}
|
2598
|
-
|
2599
|
-
var mockGenericRemoveOnlySelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('removeOnly(address,bytes,bytes)'));
|
2600
|
-
var mockGenericSwapASelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapA(address,bytes,bytes)'));
|
2601
|
-
var mockGenericSwapBSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapB(address,bytes,bytes)'));
|
2602
|
-
var mockGenericSwapDirectFromVaultSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapDirectFromVault(address,bytes,bytes)'));
|
2603
|
-
var mockGenericSwapViaApprovalSelector = protocol.sighash(ethers.utils.FunctionFragment.fromString('swapViaApproval(address,bytes,bytes)'));
|
2604
|
-
function mockGenericSwapArgs(_ref) {
|
2605
|
-
var _ref$spendAssets = _ref.spendAssets,
|
2606
|
-
spendAssets = _ref$spendAssets === void 0 ? [] : _ref$spendAssets,
|
2607
|
-
_ref$actualSpendAsset = _ref.actualSpendAssetAmounts,
|
2608
|
-
actualSpendAssetAmounts = _ref$actualSpendAsset === void 0 ? [] : _ref$actualSpendAsset,
|
2609
|
-
_ref$maxSpendAssetAmo = _ref.maxSpendAssetAmounts,
|
2610
|
-
maxSpendAssetAmounts = _ref$maxSpendAssetAmo === void 0 ? actualSpendAssetAmounts : _ref$maxSpendAssetAmo,
|
2611
|
-
_ref$incomingAssets = _ref.incomingAssets,
|
2612
|
-
incomingAssets = _ref$incomingAssets === void 0 ? [] : _ref$incomingAssets,
|
2613
|
-
_ref$actualIncomingAs = _ref.actualIncomingAssetAmounts,
|
2614
|
-
actualIncomingAssetAmounts = _ref$actualIncomingAs === void 0 ? [] : _ref$actualIncomingAs,
|
2615
|
-
_ref$minIncomingAsset = _ref.minIncomingAssetAmounts,
|
2616
|
-
minIncomingAssetAmounts = _ref$minIncomingAsset === void 0 ? actualIncomingAssetAmounts : _ref$minIncomingAsset;
|
2617
|
-
return protocol.encodeArgs(['address[]', 'uint256[]', 'uint256[]', 'address[]', 'uint256[]', 'uint256[]'], [spendAssets, maxSpendAssetAmounts, actualSpendAssetAmounts, incomingAssets, minIncomingAssetAmounts, actualIncomingAssetAmounts]);
|
2618
|
-
}
|
2619
|
-
function mockGenericSwap(_x) {
|
2620
|
-
return _mockGenericSwap.apply(this, arguments);
|
2621
|
-
}
|
2622
|
-
|
2623
|
-
function _mockGenericSwap() {
|
2624
|
-
_mockGenericSwap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
2625
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, mockGenericAdapter, _ref2$selector, selector, _ref2$spendAssets, spendAssets, _ref2$actualSpendAsse, actualSpendAssetAmounts, _ref2$maxSpendAssetAm, maxSpendAssetAmounts, _ref2$incomingAssets, incomingAssets, _ref2$actualIncomingA, actualIncomingAssetAmounts, _ref2$minIncomingAsse, minIncomingAssetAmounts, _ref2$seedFund, seedFund, key, swapArgs, callArgs, swapTx;
|
2626
|
-
|
2627
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2628
|
-
while (1) {
|
2629
|
-
switch (_context.prev = _context.next) {
|
2630
|
-
case 0:
|
2631
|
-
comptrollerProxy = _ref2.comptrollerProxy, vaultProxy = _ref2.vaultProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, mockGenericAdapter = _ref2.mockGenericAdapter, _ref2$selector = _ref2.selector, selector = _ref2$selector === void 0 ? mockGenericSwapASelector : _ref2$selector, _ref2$spendAssets = _ref2.spendAssets, spendAssets = _ref2$spendAssets === void 0 ? [] : _ref2$spendAssets, _ref2$actualSpendAsse = _ref2.actualSpendAssetAmounts, actualSpendAssetAmounts = _ref2$actualSpendAsse === void 0 ? [] : _ref2$actualSpendAsse, _ref2$maxSpendAssetAm = _ref2.maxSpendAssetAmounts, maxSpendAssetAmounts = _ref2$maxSpendAssetAm === void 0 ? actualSpendAssetAmounts : _ref2$maxSpendAssetAm, _ref2$incomingAssets = _ref2.incomingAssets, incomingAssets = _ref2$incomingAssets === void 0 ? [] : _ref2$incomingAssets, _ref2$actualIncomingA = _ref2.actualIncomingAssetAmounts, actualIncomingAssetAmounts = _ref2$actualIncomingA === void 0 ? [] : _ref2$actualIncomingA, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmounts, minIncomingAssetAmounts = _ref2$minIncomingAsse === void 0 ? actualIncomingAssetAmounts : _ref2$minIncomingAsse, _ref2$seedFund = _ref2.seedFund, seedFund = _ref2$seedFund === void 0 ? false : _ref2$seedFund;
|
2632
|
-
|
2633
|
-
if (!seedFund) {
|
2634
|
-
_context.next = 9;
|
2635
|
-
break;
|
2636
|
-
}
|
2637
|
-
|
2638
|
-
_context.t0 = _regeneratorRuntime__default['default'].keys(spendAssets);
|
2639
|
-
|
2640
|
-
case 3:
|
2641
|
-
if ((_context.t1 = _context.t0()).done) {
|
2642
|
-
_context.next = 9;
|
2643
|
-
break;
|
2644
|
-
}
|
2645
|
-
|
2646
|
-
key = _context.t1.value;
|
2647
|
-
_context.next = 7;
|
2648
|
-
return spendAssets[key].transfer(vaultProxy, maxSpendAssetAmounts[key]);
|
2649
|
-
|
2650
|
-
case 7:
|
2651
|
-
_context.next = 3;
|
2652
|
-
break;
|
2653
|
-
|
2654
|
-
case 9:
|
2655
|
-
swapArgs = mockGenericSwapArgs({
|
2656
|
-
actualIncomingAssetAmounts: actualIncomingAssetAmounts,
|
2657
|
-
actualSpendAssetAmounts: actualSpendAssetAmounts,
|
2658
|
-
incomingAssets: incomingAssets,
|
2659
|
-
maxSpendAssetAmounts: maxSpendAssetAmounts,
|
2660
|
-
minIncomingAssetAmounts: minIncomingAssetAmounts,
|
2661
|
-
spendAssets: spendAssets
|
2662
|
-
});
|
2663
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2664
|
-
adapter: mockGenericAdapter,
|
2665
|
-
encodedCallArgs: swapArgs,
|
2666
|
-
selector: selector
|
2667
|
-
});
|
2668
|
-
swapTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2669
|
-
_context.next = 14;
|
2670
|
-
return expect(swapTx).resolves.toBeReceipt();
|
2671
|
-
|
2672
|
-
case 14:
|
2673
|
-
return _context.abrupt("return", swapTx);
|
2674
|
-
|
2675
|
-
case 15:
|
2676
|
-
case "end":
|
2677
|
-
return _context.stop();
|
2678
|
-
}
|
2679
|
-
}
|
2680
|
-
}, _callee);
|
2681
|
-
}));
|
2682
|
-
return _mockGenericSwap.apply(this, arguments);
|
2683
|
-
}
|
2684
|
-
|
2685
|
-
function olympusV2Stake(_x) {
|
2686
|
-
return _olympusV2Stake.apply(this, arguments);
|
2687
|
-
}
|
2688
|
-
|
2689
|
-
function _olympusV2Stake() {
|
2690
|
-
_olympusV2Stake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2691
|
-
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, stakeArgs, callArgs, stakeTx;
|
2692
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2693
|
-
while (1) {
|
2694
|
-
switch (_context.prev = _context.next) {
|
2695
|
-
case 0:
|
2696
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, signer = _ref.signer, olympusV2Adapter = _ref.olympusV2Adapter, amount = _ref.amount;
|
2697
|
-
stakeArgs = protocol.olympusV2StakeArgs({
|
2698
|
-
amount: amount
|
2699
|
-
});
|
2700
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2701
|
-
adapter: olympusV2Adapter,
|
2702
|
-
encodedCallArgs: stakeArgs,
|
2703
|
-
selector: protocol.stakeSelector
|
2704
|
-
});
|
2705
|
-
stakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2706
|
-
return _context.abrupt("return", stakeTx);
|
2707
|
-
|
2708
|
-
case 5:
|
2709
|
-
case "end":
|
2710
|
-
return _context.stop();
|
2711
|
-
}
|
2712
|
-
}
|
2713
|
-
}, _callee);
|
2714
|
-
}));
|
2715
|
-
return _olympusV2Stake.apply(this, arguments);
|
2716
|
-
}
|
2717
|
-
|
2718
|
-
function olympusV2Unstake(_x2) {
|
2719
|
-
return _olympusV2Unstake.apply(this, arguments);
|
2720
|
-
}
|
2721
|
-
|
2722
|
-
function _olympusV2Unstake() {
|
2723
|
-
_olympusV2Unstake = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2724
|
-
var comptrollerProxy, integrationManager, signer, olympusV2Adapter, amount, unstakeArgs, callArgs, unstakeTx;
|
2725
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2726
|
-
while (1) {
|
2727
|
-
switch (_context2.prev = _context2.next) {
|
2728
|
-
case 0:
|
2729
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, olympusV2Adapter = _ref2.olympusV2Adapter, amount = _ref2.amount;
|
2730
|
-
unstakeArgs = protocol.olympusV2UnstakeArgs({
|
2731
|
-
amount: amount
|
2732
|
-
});
|
2733
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2734
|
-
adapter: olympusV2Adapter,
|
2735
|
-
encodedCallArgs: unstakeArgs,
|
2736
|
-
selector: protocol.unstakeSelector
|
2737
|
-
});
|
2738
|
-
unstakeTx = comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2739
|
-
return _context2.abrupt("return", unstakeTx);
|
2740
|
-
|
2741
|
-
case 5:
|
2742
|
-
case "end":
|
2743
|
-
return _context2.stop();
|
2744
|
-
}
|
2745
|
-
}
|
2746
|
-
}, _callee2);
|
2747
|
-
}));
|
2748
|
-
return _olympusV2Unstake.apply(this, arguments);
|
2749
|
-
}
|
2750
|
-
|
2751
|
-
function paraSwapV4GenerateDummyPaths(_ref) {
|
2752
|
-
var toTokens = _ref.toTokens;
|
2753
|
-
return toTokens.map(function (toToken) {
|
2754
|
-
return {
|
2755
|
-
// Not supported in our protocol
|
2756
|
-
routes: [],
|
2757
|
-
to: toToken,
|
2758
|
-
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2759
|
-
|
2760
|
-
};
|
2761
|
-
});
|
2762
|
-
}
|
2763
|
-
function paraSwapV4TakeOrder(_x) {
|
2764
|
-
return _paraSwapV4TakeOrder.apply(this, arguments);
|
2765
|
-
}
|
2766
|
-
|
2767
|
-
function _paraSwapV4TakeOrder() {
|
2768
|
-
_paraSwapV4TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
2769
|
-
var comptrollerProxy, integrationManager, fundOwner, paraSwapV4Adapter, outgoingAsset, _ref2$outgoingAssetAm, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, paths, takeOrderArgs, callArgs;
|
2770
|
-
|
2771
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2772
|
-
while (1) {
|
2773
|
-
switch (_context.prev = _context.next) {
|
2774
|
-
case 0:
|
2775
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV4Adapter = _ref2.paraSwapV4Adapter, outgoingAsset = _ref2.outgoingAsset, _ref2$outgoingAssetAm = _ref2.outgoingAssetAmount, outgoingAssetAmount = _ref2$outgoingAssetAm === void 0 ? ethers.utils.parseEther('1') : _ref2$outgoingAssetAm, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, paths = _ref2.paths;
|
2776
|
-
takeOrderArgs = protocol.paraSwapV4TakeOrderArgs({
|
2777
|
-
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2778
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2779
|
-
outgoingAsset: outgoingAsset,
|
2780
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
2781
|
-
paths: paths
|
2782
|
-
});
|
2783
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2784
|
-
adapter: paraSwapV4Adapter,
|
2785
|
-
encodedCallArgs: takeOrderArgs,
|
2786
|
-
selector: protocol.takeOrderSelector
|
2787
|
-
});
|
2788
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2789
|
-
|
2790
|
-
case 4:
|
2791
|
-
case "end":
|
2792
|
-
return _context.stop();
|
2793
|
-
}
|
2794
|
-
}
|
2795
|
-
}, _callee);
|
2796
|
-
}));
|
2797
|
-
return _paraSwapV4TakeOrder.apply(this, arguments);
|
2798
|
-
}
|
2799
|
-
|
2800
|
-
function paraSwapV5GenerateDummyPaths(_ref) {
|
2801
|
-
var toTokens = _ref.toTokens;
|
2802
|
-
return toTokens.map(function (toToken) {
|
2803
|
-
return {
|
2804
|
-
// Not supported in our protocol
|
2805
|
-
adapters: [],
|
2806
|
-
to: toToken,
|
2807
|
-
totalNetworkFee: 0 // Can ignore this param in the dummy
|
2808
|
-
|
2809
|
-
};
|
2810
|
-
});
|
2811
|
-
}
|
2812
|
-
function paraSwapV5TakeOrder(_x) {
|
2813
|
-
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2814
|
-
}
|
2815
|
-
|
2816
|
-
function _paraSwapV5TakeOrder() {
|
2817
|
-
_paraSwapV5TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref2) {
|
2818
|
-
var comptrollerProxy, integrationManager, fundOwner, paraSwapV5Adapter, outgoingAsset, outgoingAssetAmount, _ref2$minIncomingAsse, minIncomingAssetAmount, _ref2$expectedIncomin, expectedIncomingAssetAmount, _ref2$uuid, uuid, paths, takeOrderArgs, callArgs;
|
2819
|
-
|
2820
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2821
|
-
while (1) {
|
2822
|
-
switch (_context.prev = _context.next) {
|
2823
|
-
case 0:
|
2824
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, paraSwapV5Adapter = _ref2.paraSwapV5Adapter, outgoingAsset = _ref2.outgoingAsset, outgoingAssetAmount = _ref2.outgoingAssetAmount, _ref2$minIncomingAsse = _ref2.minIncomingAssetAmount, minIncomingAssetAmount = _ref2$minIncomingAsse === void 0 ? 1 : _ref2$minIncomingAsse, _ref2$expectedIncomin = _ref2.expectedIncomingAssetAmount, expectedIncomingAssetAmount = _ref2$expectedIncomin === void 0 ? minIncomingAssetAmount : _ref2$expectedIncomin, _ref2$uuid = _ref2.uuid, uuid = _ref2$uuid === void 0 ? ethers.utils.randomBytes(16) : _ref2$uuid, paths = _ref2.paths;
|
2825
|
-
takeOrderArgs = protocol.paraSwapV5TakeOrderArgs({
|
2826
|
-
expectedIncomingAssetAmount: expectedIncomingAssetAmount,
|
2827
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
2828
|
-
outgoingAsset: outgoingAsset,
|
2829
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
2830
|
-
paths: paths,
|
2831
|
-
uuid: uuid
|
2832
|
-
});
|
2833
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2834
|
-
adapter: paraSwapV5Adapter,
|
2835
|
-
encodedCallArgs: takeOrderArgs,
|
2836
|
-
selector: protocol.takeOrderSelector
|
2837
|
-
});
|
2838
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
2839
|
-
|
2840
|
-
case 4:
|
2841
|
-
case "end":
|
2842
|
-
return _context.stop();
|
2843
|
-
}
|
2844
|
-
}
|
2845
|
-
}, _callee);
|
2846
|
-
}));
|
2847
|
-
return _paraSwapV5TakeOrder.apply(this, arguments);
|
2848
|
-
}
|
2849
|
-
|
2850
|
-
function poolTogetherV4Lend(_x) {
|
2851
|
-
return _poolTogetherV4Lend.apply(this, arguments);
|
2852
|
-
}
|
2853
|
-
|
2854
|
-
function _poolTogetherV4Lend() {
|
2855
|
-
_poolTogetherV4Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2856
|
-
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref$amount, amount, lendArgs, callArgs, lendTx;
|
2857
|
-
|
2858
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2859
|
-
while (1) {
|
2860
|
-
switch (_context.prev = _context.next) {
|
2861
|
-
case 0:
|
2862
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, poolTogetherV4Adapter = _ref.poolTogetherV4Adapter, ptToken = _ref.ptToken, _ref$amount = _ref.amount, amount = _ref$amount === void 0 ? ethers.utils.parseEther('1') : _ref$amount;
|
2863
|
-
lendArgs = protocol.poolTogetherV4LendArgs({
|
2864
|
-
amount: amount,
|
2865
|
-
ptToken: ptToken
|
2866
|
-
});
|
2867
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2868
|
-
adapter: poolTogetherV4Adapter,
|
2869
|
-
encodedCallArgs: lendArgs,
|
2870
|
-
selector: protocol.lendSelector
|
2871
|
-
});
|
2872
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2873
|
-
return _context.abrupt("return", lendTx);
|
2874
|
-
|
2875
|
-
case 5:
|
2876
|
-
case "end":
|
2877
|
-
return _context.stop();
|
2878
|
-
}
|
2879
|
-
}
|
2880
|
-
}, _callee);
|
2881
|
-
}));
|
2882
|
-
return _poolTogetherV4Lend.apply(this, arguments);
|
2883
|
-
}
|
2884
|
-
|
2885
|
-
function poolTogetherV4Redeem(_x2) {
|
2886
|
-
return _poolTogetherV4Redeem.apply(this, arguments);
|
2887
|
-
}
|
2888
|
-
|
2889
|
-
function _poolTogetherV4Redeem() {
|
2890
|
-
_poolTogetherV4Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2891
|
-
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, ptToken, _ref2$amount, amount, redeemArgs, callArgs, redeemTx;
|
2892
|
-
|
2893
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2894
|
-
while (1) {
|
2895
|
-
switch (_context2.prev = _context2.next) {
|
2896
|
-
case 0:
|
2897
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, poolTogetherV4Adapter = _ref2.poolTogetherV4Adapter, ptToken = _ref2.ptToken, _ref2$amount = _ref2.amount, amount = _ref2$amount === void 0 ? ethers.utils.parseEther('1') : _ref2$amount;
|
2898
|
-
redeemArgs = protocol.poolTogetherV4RedeemArgs({
|
2899
|
-
amount: amount,
|
2900
|
-
ptToken: ptToken
|
2901
|
-
});
|
2902
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2903
|
-
adapter: poolTogetherV4Adapter,
|
2904
|
-
encodedCallArgs: redeemArgs,
|
2905
|
-
selector: protocol.redeemSelector
|
2906
|
-
});
|
2907
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2908
|
-
return _context2.abrupt("return", redeemTx);
|
2909
|
-
|
2910
|
-
case 5:
|
2911
|
-
case "end":
|
2912
|
-
return _context2.stop();
|
2913
|
-
}
|
2914
|
-
}
|
2915
|
-
}, _callee2);
|
2916
|
-
}));
|
2917
|
-
return _poolTogetherV4Redeem.apply(this, arguments);
|
2918
|
-
}
|
2919
|
-
|
2920
|
-
function poolTogetherV4ClaimRewards(_x3) {
|
2921
|
-
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2922
|
-
}
|
2923
|
-
|
2924
|
-
function _poolTogetherV4ClaimRewards() {
|
2925
|
-
_poolTogetherV4ClaimRewards = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
2926
|
-
var comptrollerProxy, integrationManager, fundOwner, poolTogetherV4Adapter, prizeDistributor, drawIds, winningPicks, claimRewardsArgs, callArgs, claimTx;
|
2927
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
2928
|
-
while (1) {
|
2929
|
-
switch (_context3.prev = _context3.next) {
|
2930
|
-
case 0:
|
2931
|
-
comptrollerProxy = _ref3.comptrollerProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, poolTogetherV4Adapter = _ref3.poolTogetherV4Adapter, prizeDistributor = _ref3.prizeDistributor, drawIds = _ref3.drawIds, winningPicks = _ref3.winningPicks;
|
2932
|
-
claimRewardsArgs = protocol.poolTogetherV4ClaimRewardsArgs({
|
2933
|
-
drawIds: drawIds,
|
2934
|
-
prizeDistributor: prizeDistributor,
|
2935
|
-
winningPicks: winningPicks
|
2936
|
-
});
|
2937
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2938
|
-
adapter: poolTogetherV4Adapter,
|
2939
|
-
encodedCallArgs: claimRewardsArgs,
|
2940
|
-
selector: protocol.claimRewardsSelector
|
2941
|
-
});
|
2942
|
-
claimTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
2943
|
-
return _context3.abrupt("return", claimTx);
|
2944
|
-
|
2945
|
-
case 5:
|
2946
|
-
case "end":
|
2947
|
-
return _context3.stop();
|
2948
|
-
}
|
2949
|
-
}
|
2950
|
-
}, _callee3);
|
2951
|
-
}));
|
2952
|
-
return _poolTogetherV4ClaimRewards.apply(this, arguments);
|
2953
|
-
}
|
2954
|
-
|
2955
|
-
function synthetixAssignExchangeDelegate(_x) {
|
2956
|
-
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
2957
|
-
}
|
2958
|
-
|
2959
|
-
function _synthetixAssignExchangeDelegate() {
|
2960
|
-
_synthetixAssignExchangeDelegate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
2961
|
-
var comptrollerProxy, synthetixDelegateApprovals, fundOwner, delegate;
|
2962
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
2963
|
-
while (1) {
|
2964
|
-
switch (_context.prev = _context.next) {
|
2965
|
-
case 0:
|
2966
|
-
comptrollerProxy = _ref.comptrollerProxy, synthetixDelegateApprovals = _ref.synthetixDelegateApprovals, fundOwner = _ref.fundOwner, delegate = _ref.delegate;
|
2967
|
-
_context.next = 3;
|
2968
|
-
return comptrollerProxy.connect(fundOwner).vaultCallOnContract(synthetixDelegateApprovals, protocol.synthetixAssignExchangeDelegateSelector, protocol.encodeArgs(['address'], [delegate]));
|
2969
|
-
|
2970
|
-
case 3:
|
2971
|
-
case "end":
|
2972
|
-
return _context.stop();
|
2973
|
-
}
|
2974
|
-
}
|
2975
|
-
}, _callee);
|
2976
|
-
}));
|
2977
|
-
return _synthetixAssignExchangeDelegate.apply(this, arguments);
|
2978
|
-
}
|
2979
|
-
|
2980
|
-
function synthetixRedeem(_x2) {
|
2981
|
-
return _synthetixRedeem.apply(this, arguments);
|
2982
|
-
}
|
2983
|
-
|
2984
|
-
function _synthetixRedeem() {
|
2985
|
-
_synthetixRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
2986
|
-
var comptrollerProxy, integrationManager, signer, synthetixAdapter, synths, redeemArgs, callArgs;
|
2987
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
2988
|
-
while (1) {
|
2989
|
-
switch (_context2.prev = _context2.next) {
|
2990
|
-
case 0:
|
2991
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, signer = _ref2.signer, synthetixAdapter = _ref2.synthetixAdapter, synths = _ref2.synths;
|
2992
|
-
redeemArgs = protocol.synthetixRedeemArgs({
|
2993
|
-
synths: synths
|
2994
|
-
});
|
2995
|
-
callArgs = protocol.callOnIntegrationArgs({
|
2996
|
-
adapter: synthetixAdapter,
|
2997
|
-
encodedCallArgs: redeemArgs,
|
2998
|
-
selector: protocol.redeemSelector
|
2999
|
-
});
|
3000
|
-
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3001
|
-
|
3002
|
-
case 4:
|
3003
|
-
case "end":
|
3004
|
-
return _context2.stop();
|
3005
|
-
}
|
3006
|
-
}
|
3007
|
-
}, _callee2);
|
3008
|
-
}));
|
3009
|
-
return _synthetixRedeem.apply(this, arguments);
|
3010
|
-
}
|
3011
|
-
|
3012
|
-
function synthetixTakeOrder(_x3) {
|
3013
|
-
return _synthetixTakeOrder.apply(this, arguments);
|
3014
|
-
}
|
3015
|
-
|
3016
|
-
function _synthetixTakeOrder() {
|
3017
|
-
_synthetixTakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
3018
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, synthetixAdapter, outgoingAsset, _ref3$outgoingAssetAm, outgoingAssetAmount, _ref3$minIncomingSusd, minIncomingSusdAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
3019
|
-
|
3020
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
3021
|
-
while (1) {
|
3022
|
-
switch (_context3.prev = _context3.next) {
|
3023
|
-
case 0:
|
3024
|
-
comptrollerProxy = _ref3.comptrollerProxy, vaultProxy = _ref3.vaultProxy, integrationManager = _ref3.integrationManager, fundOwner = _ref3.fundOwner, synthetixAdapter = _ref3.synthetixAdapter, outgoingAsset = _ref3.outgoingAsset, _ref3$outgoingAssetAm = _ref3.outgoingAssetAmount, outgoingAssetAmount = _ref3$outgoingAssetAm === void 0 ? ethers.utils.parseEther('1') : _ref3$outgoingAssetAm, _ref3$minIncomingSusd = _ref3.minIncomingSusdAmount, minIncomingSusdAmount = _ref3$minIncomingSusd === void 0 ? ethers.utils.parseEther('1') : _ref3$minIncomingSusd, _ref3$seedFund = _ref3.seedFund, seedFund = _ref3$seedFund === void 0 ? false : _ref3$seedFund;
|
3025
|
-
|
3026
|
-
if (!seedFund) {
|
3027
|
-
_context3.next = 4;
|
3028
|
-
break;
|
3029
|
-
}
|
3030
|
-
|
3031
|
-
_context3.next = 4;
|
3032
|
-
return outgoingAsset.transfer(vaultProxy, outgoingAssetAmount);
|
3033
|
-
|
3034
|
-
case 4:
|
3035
|
-
takeOrderArgs = protocol.synthetixTakeOrderArgs({
|
3036
|
-
minIncomingSusdAmount: minIncomingSusdAmount,
|
3037
|
-
outgoingAsset: outgoingAsset,
|
3038
|
-
outgoingAssetAmount: outgoingAssetAmount
|
3039
|
-
});
|
3040
|
-
_context3.next = 7;
|
3041
|
-
return protocol.callOnIntegrationArgs({
|
3042
|
-
adapter: synthetixAdapter,
|
3043
|
-
encodedCallArgs: takeOrderArgs,
|
3044
|
-
selector: protocol.takeOrderSelector
|
3045
|
-
});
|
3046
|
-
|
3047
|
-
case 7:
|
3048
|
-
callArgs = _context3.sent;
|
3049
|
-
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3050
|
-
|
3051
|
-
case 9:
|
3052
|
-
case "end":
|
3053
|
-
return _context3.stop();
|
3054
|
-
}
|
3055
|
-
}
|
3056
|
-
}, _callee3);
|
3057
|
-
}));
|
3058
|
-
return _synthetixTakeOrder.apply(this, arguments);
|
3059
|
-
}
|
3060
|
-
|
3061
|
-
var _templateObject;
|
3062
|
-
var UniswapV2Factory = ethers$1.contract()(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n function createPair(address,address) returns (address)\n function getPair(address,address) view returns (address)\n"])));
|
3063
|
-
function uniswapV2Lend(_x) {
|
3064
|
-
return _uniswapV2Lend.apply(this, arguments);
|
3065
|
-
}
|
3066
|
-
|
3067
|
-
function _uniswapV2Lend() {
|
3068
|
-
_uniswapV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3069
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin, minPoolTokenAmount, _ref$seedFund, seedFund, lendArgs, callArgs, lendTx;
|
3070
|
-
|
3071
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3072
|
-
while (1) {
|
3073
|
-
switch (_context.prev = _context.next) {
|
3074
|
-
case 0:
|
3075
|
-
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;
|
3076
|
-
|
3077
|
-
if (!seedFund) {
|
3078
|
-
_context.next = 6;
|
3079
|
-
break;
|
3080
|
-
}
|
3081
|
-
|
3082
|
-
_context.next = 4;
|
3083
|
-
return tokenA.transfer(vaultProxy, amountADesired);
|
3084
|
-
|
3085
|
-
case 4:
|
3086
|
-
_context.next = 6;
|
3087
|
-
return tokenB.transfer(vaultProxy, amountBDesired);
|
3088
|
-
|
3089
|
-
case 6:
|
3090
|
-
lendArgs = protocol.uniswapV2LendArgs({
|
3091
|
-
amountADesired: amountADesired,
|
3092
|
-
amountAMin: amountAMin,
|
3093
|
-
amountBDesired: amountBDesired,
|
3094
|
-
amountBMin: amountBMin,
|
3095
|
-
minPoolTokenAmount: minPoolTokenAmount,
|
3096
|
-
tokenA: tokenA,
|
3097
|
-
tokenB: tokenB
|
3098
|
-
});
|
3099
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3100
|
-
adapter: uniswapV2LiquidityAdapter,
|
3101
|
-
encodedCallArgs: lendArgs,
|
3102
|
-
selector: protocol.lendSelector
|
3103
|
-
});
|
3104
|
-
lendTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
3105
|
-
_context.next = 11;
|
3106
|
-
return expect(lendTx).resolves.toBeReceipt();
|
3107
|
-
|
3108
|
-
case 11:
|
3109
|
-
return _context.abrupt("return", lendTx);
|
3110
|
-
|
3111
|
-
case 12:
|
3112
|
-
case "end":
|
3113
|
-
return _context.stop();
|
3114
|
-
}
|
3115
|
-
}
|
3116
|
-
}, _callee);
|
3117
|
-
}));
|
3118
|
-
return _uniswapV2Lend.apply(this, arguments);
|
3119
|
-
}
|
3120
|
-
|
3121
|
-
function uniswapV2Redeem(_x2) {
|
3122
|
-
return _uniswapV2Redeem.apply(this, arguments);
|
3123
|
-
}
|
3124
|
-
|
3125
|
-
function _uniswapV2Redeem() {
|
3126
|
-
_uniswapV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
3127
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV2LiquidityAdapter, poolTokenAmount, tokenA, tokenB, amountAMin, amountBMin, redeemArgs, callArgs, redeemTx;
|
3128
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3129
|
-
while (1) {
|
3130
|
-
switch (_context2.prev = _context2.next) {
|
3131
|
-
case 0:
|
3132
|
-
comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, fundOwner = _ref2.fundOwner, uniswapV2LiquidityAdapter = _ref2.uniswapV2LiquidityAdapter, poolTokenAmount = _ref2.poolTokenAmount, tokenA = _ref2.tokenA, tokenB = _ref2.tokenB, amountAMin = _ref2.amountAMin, amountBMin = _ref2.amountBMin;
|
3133
|
-
redeemArgs = protocol.uniswapV2RedeemArgs({
|
3134
|
-
amountAMin: amountAMin,
|
3135
|
-
amountBMin: amountBMin,
|
3136
|
-
poolTokenAmount: poolTokenAmount,
|
3137
|
-
tokenA: tokenA,
|
3138
|
-
tokenB: tokenB
|
3139
|
-
});
|
3140
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3141
|
-
adapter: uniswapV2LiquidityAdapter,
|
3142
|
-
encodedCallArgs: redeemArgs,
|
3143
|
-
selector: protocol.redeemSelector
|
3144
|
-
});
|
3145
|
-
redeemTx = comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs);
|
3146
|
-
_context2.next = 6;
|
3147
|
-
return expect(redeemTx).resolves.toBeReceipt();
|
3148
|
-
|
3149
|
-
case 6:
|
3150
|
-
return _context2.abrupt("return", redeemTx);
|
3151
|
-
|
3152
|
-
case 7:
|
3153
|
-
case "end":
|
3154
|
-
return _context2.stop();
|
3155
|
-
}
|
3156
|
-
}
|
3157
|
-
}, _callee2);
|
3158
|
-
}));
|
3159
|
-
return _uniswapV2Redeem.apply(this, arguments);
|
3160
|
-
}
|
3161
|
-
|
3162
|
-
function uniswapV2TakeOrder(_x3) {
|
3163
|
-
return _uniswapV2TakeOrder.apply(this, arguments);
|
3164
|
-
}
|
3165
|
-
|
3166
|
-
function _uniswapV2TakeOrder() {
|
3167
|
-
_uniswapV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
3168
|
-
var comptrollerProxy, vaultProxy, integrationManager, fundOwner, uniswapV2ExchangeAdapter, path, outgoingAssetAmount, minIncomingAssetAmount, _ref3$seedFund, seedFund, takeOrderArgs, callArgs;
|
3169
|
-
|
3170
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
3171
|
-
while (1) {
|
3172
|
-
switch (_context3.prev = _context3.next) {
|
3173
|
-
case 0:
|
3174
|
-
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;
|
3175
|
-
|
3176
|
-
if (!seedFund) {
|
3177
|
-
_context3.next = 4;
|
3178
|
-
break;
|
3179
|
-
}
|
3180
|
-
|
3181
|
-
_context3.next = 4;
|
3182
|
-
return path[0].transfer(vaultProxy, outgoingAssetAmount);
|
3183
|
-
|
3184
|
-
case 4:
|
3185
|
-
takeOrderArgs = protocol.uniswapV2TakeOrderArgs({
|
3186
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
3187
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
3188
|
-
path: path
|
3189
|
-
});
|
3190
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3191
|
-
adapter: uniswapV2ExchangeAdapter,
|
3192
|
-
encodedCallArgs: takeOrderArgs,
|
3193
|
-
selector: protocol.takeOrderSelector
|
3194
|
-
});
|
3195
|
-
return _context3.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3196
|
-
|
3197
|
-
case 7:
|
3198
|
-
case "end":
|
3199
|
-
return _context3.stop();
|
3200
|
-
}
|
3201
|
-
}
|
3202
|
-
}, _callee3);
|
3203
|
-
}));
|
3204
|
-
return _uniswapV2TakeOrder.apply(this, arguments);
|
3205
|
-
}
|
3206
|
-
|
3207
|
-
function uniswapV3TakeOrder(_x) {
|
3208
|
-
return _uniswapV3TakeOrder.apply(this, arguments);
|
3209
|
-
}
|
3210
|
-
|
3211
|
-
function _uniswapV3TakeOrder() {
|
3212
|
-
_uniswapV3TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3213
|
-
var comptrollerProxy, integrationManager, fundOwner, uniswapV3Adapter, pathAddresses, pathFees, outgoingAssetAmount, _ref$minIncomingAsset, minIncomingAssetAmount, _ref$seedFund, seedFund, vaultProxy, takeOrderArgs, callArgs;
|
3214
|
-
|
3215
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3216
|
-
while (1) {
|
3217
|
-
switch (_context.prev = _context.next) {
|
3218
|
-
case 0:
|
3219
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, uniswapV3Adapter = _ref.uniswapV3Adapter, pathAddresses = _ref.pathAddresses, pathFees = _ref.pathFees, outgoingAssetAmount = _ref.outgoingAssetAmount, _ref$minIncomingAsset = _ref.minIncomingAssetAmount, minIncomingAssetAmount = _ref$minIncomingAsset === void 0 ? 1 : _ref$minIncomingAsset, _ref$seedFund = _ref.seedFund, seedFund = _ref$seedFund === void 0 ? false : _ref$seedFund;
|
3220
|
-
|
3221
|
-
if (!seedFund) {
|
3222
|
-
_context.next = 7;
|
3223
|
-
break;
|
3224
|
-
}
|
3225
|
-
|
3226
|
-
_context.next = 4;
|
3227
|
-
return comptrollerProxy.getVaultProxy();
|
3228
|
-
|
3229
|
-
case 4:
|
3230
|
-
vaultProxy = _context.sent;
|
3231
|
-
_context.next = 7;
|
3232
|
-
return pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
3233
|
-
|
3234
|
-
case 7:
|
3235
|
-
takeOrderArgs = protocol.uniswapV3TakeOrderArgs({
|
3236
|
-
minIncomingAssetAmount: minIncomingAssetAmount,
|
3237
|
-
outgoingAssetAmount: outgoingAssetAmount,
|
3238
|
-
pathAddresses: pathAddresses,
|
3239
|
-
pathFees: pathFees
|
3240
|
-
});
|
3241
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3242
|
-
adapter: uniswapV3Adapter,
|
3243
|
-
encodedCallArgs: takeOrderArgs,
|
3244
|
-
selector: protocol.takeOrderSelector
|
3245
|
-
});
|
3246
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3247
|
-
|
3248
|
-
case 10:
|
3249
|
-
case "end":
|
3250
|
-
return _context.stop();
|
3251
|
-
}
|
3252
|
-
}
|
3253
|
-
}, _callee);
|
3254
|
-
}));
|
3255
|
-
return _uniswapV3TakeOrder.apply(this, arguments);
|
3256
|
-
}
|
3257
|
-
|
3258
|
-
function yearnVaultV2Lend(_x) {
|
3259
|
-
return _yearnVaultV2Lend.apply(this, arguments);
|
3260
|
-
}
|
3261
|
-
|
3262
|
-
function _yearnVaultV2Lend() {
|
3263
|
-
_yearnVaultV2Lend = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3264
|
-
var signer, comptrollerProxy, integrationManager, yearnVaultV2Adapter, yVault, outgoingUnderlyingAmount, _ref$minIncomingYVaul, minIncomingYVaultSharesAmount, callArgs;
|
3265
|
-
|
3266
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3267
|
-
while (1) {
|
3268
|
-
switch (_context.prev = _context.next) {
|
3269
|
-
case 0:
|
3270
|
-
signer = _ref.signer, comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, yearnVaultV2Adapter = _ref.yearnVaultV2Adapter, yVault = _ref.yVault, outgoingUnderlyingAmount = _ref.outgoingUnderlyingAmount, _ref$minIncomingYVaul = _ref.minIncomingYVaultSharesAmount, minIncomingYVaultSharesAmount = _ref$minIncomingYVaul === void 0 ? ethers.BigNumber.from(1) : _ref$minIncomingYVaul;
|
3271
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3272
|
-
adapter: yearnVaultV2Adapter,
|
3273
|
-
encodedCallArgs: protocol.yearnVaultV2LendArgs({
|
3274
|
-
minIncomingYVaultSharesAmount: minIncomingYVaultSharesAmount,
|
3275
|
-
outgoingUnderlyingAmount: outgoingUnderlyingAmount,
|
3276
|
-
yVault: yVault
|
3277
|
-
}),
|
3278
|
-
selector: protocol.lendSelector
|
3279
|
-
});
|
3280
|
-
return _context.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3281
|
-
|
3282
|
-
case 3:
|
3283
|
-
case "end":
|
3284
|
-
return _context.stop();
|
3285
|
-
}
|
3286
|
-
}
|
3287
|
-
}, _callee);
|
3288
|
-
}));
|
3289
|
-
return _yearnVaultV2Lend.apply(this, arguments);
|
3290
|
-
}
|
3291
|
-
|
3292
|
-
function yearnVaultV2Redeem(_x2) {
|
3293
|
-
return _yearnVaultV2Redeem.apply(this, arguments);
|
3294
|
-
}
|
3295
|
-
|
3296
|
-
function _yearnVaultV2Redeem() {
|
3297
|
-
_yearnVaultV2Redeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
3298
|
-
var signer, comptrollerProxy, integrationManager, yearnVaultV2Adapter, yVault, maxOutgoingYVaultSharesAmount, _ref2$minIncomingUnde, minIncomingUnderlyingAmount, _ref2$slippageToleran, slippageToleranceBps, callArgs;
|
3299
|
-
|
3300
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3301
|
-
while (1) {
|
3302
|
-
switch (_context2.prev = _context2.next) {
|
3303
|
-
case 0:
|
3304
|
-
signer = _ref2.signer, comptrollerProxy = _ref2.comptrollerProxy, integrationManager = _ref2.integrationManager, yearnVaultV2Adapter = _ref2.yearnVaultV2Adapter, yVault = _ref2.yVault, maxOutgoingYVaultSharesAmount = _ref2.maxOutgoingYVaultSharesAmount, _ref2$minIncomingUnde = _ref2.minIncomingUnderlyingAmount, minIncomingUnderlyingAmount = _ref2$minIncomingUnde === void 0 ? ethers.BigNumber.from(1) : _ref2$minIncomingUnde, _ref2$slippageToleran = _ref2.slippageToleranceBps, slippageToleranceBps = _ref2$slippageToleran === void 0 ? 1 : _ref2$slippageToleran;
|
3305
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3306
|
-
adapter: yearnVaultV2Adapter,
|
3307
|
-
encodedCallArgs: protocol.yearnVaultV2RedeemArgs({
|
3308
|
-
maxOutgoingYVaultSharesAmount: maxOutgoingYVaultSharesAmount,
|
3309
|
-
minIncomingUnderlyingAmount: minIncomingUnderlyingAmount,
|
3310
|
-
slippageToleranceBps: slippageToleranceBps,
|
3311
|
-
yVault: yVault
|
3312
|
-
}),
|
3313
|
-
selector: protocol.redeemSelector
|
3314
|
-
});
|
3315
|
-
return _context2.abrupt("return", comptrollerProxy.connect(signer).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3316
|
-
|
3317
|
-
case 3:
|
3318
|
-
case "end":
|
3319
|
-
return _context2.stop();
|
3320
|
-
}
|
3321
|
-
}
|
3322
|
-
}, _callee2);
|
3323
|
-
}));
|
3324
|
-
return _yearnVaultV2Redeem.apply(this, arguments);
|
3325
|
-
}
|
3326
|
-
|
3327
|
-
function zeroExV2TakeOrder(_x) {
|
3328
|
-
return _zeroExV2TakeOrder.apply(this, arguments);
|
3329
|
-
}
|
3330
|
-
|
3331
|
-
function _zeroExV2TakeOrder() {
|
3332
|
-
_zeroExV2TakeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3333
|
-
var comptrollerProxy, integrationManager, fundOwner, zeroExV2Adapter, signedOrder, takerAssetFillAmount, takeOrderArgs, callArgs;
|
3334
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3335
|
-
while (1) {
|
3336
|
-
switch (_context.prev = _context.next) {
|
3337
|
-
case 0:
|
3338
|
-
comptrollerProxy = _ref.comptrollerProxy, integrationManager = _ref.integrationManager, fundOwner = _ref.fundOwner, zeroExV2Adapter = _ref.zeroExV2Adapter, signedOrder = _ref.signedOrder, takerAssetFillAmount = _ref.takerAssetFillAmount;
|
3339
|
-
takeOrderArgs = protocol.zeroExV2TakeOrderArgs({
|
3340
|
-
signedOrder: signedOrder,
|
3341
|
-
takerAssetFillAmount: takerAssetFillAmount
|
3342
|
-
});
|
3343
|
-
callArgs = protocol.callOnIntegrationArgs({
|
3344
|
-
adapter: zeroExV2Adapter,
|
3345
|
-
encodedCallArgs: takeOrderArgs,
|
3346
|
-
selector: protocol.takeOrderSelector
|
3347
|
-
});
|
3348
|
-
return _context.abrupt("return", comptrollerProxy.connect(fundOwner).callOnExtension(integrationManager, protocol.IntegrationManagerActionId.CallOnIntegration, callArgs));
|
3349
|
-
|
3350
|
-
case 4:
|
3351
|
-
case "end":
|
3352
|
-
return _context.stop();
|
3353
|
-
}
|
3354
|
-
}
|
3355
|
-
}, _callee);
|
3356
|
-
}));
|
3357
|
-
return _zeroExV2TakeOrder.apply(this, arguments);
|
3358
|
-
}
|
3359
|
-
|
3360
|
-
function generatePolicyManagerConfigWithMockPolicies(_x) {
|
3361
|
-
return _generatePolicyManagerConfigWithMockPolicies.apply(this, arguments);
|
3362
|
-
}
|
3363
|
-
|
3364
|
-
function _generatePolicyManagerConfigWithMockPolicies() {
|
3365
|
-
_generatePolicyManagerConfigWithMockPolicies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3366
|
-
var deployer, policies, policiesSettingsData;
|
3367
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3368
|
-
while (1) {
|
3369
|
-
switch (_context.prev = _context.next) {
|
3370
|
-
case 0:
|
3371
|
-
deployer = _ref.deployer;
|
3372
|
-
_context.t0 = Object;
|
3373
|
-
_context.next = 4;
|
3374
|
-
return generateMockPolicies({
|
3375
|
-
deployer: deployer
|
3376
|
-
});
|
3377
|
-
|
3378
|
-
case 4:
|
3379
|
-
_context.t1 = _context.sent;
|
3380
|
-
policies = _context.t0.values.call(_context.t0, _context.t1);
|
3381
|
-
// Guarantees one policy has settings data
|
3382
|
-
policiesSettingsData = [].concat(_toConsumableArray(new Array(policies.length - 1).fill(ethers.constants.HashZero)), [ethers.utils.randomBytes(10)]);
|
3383
|
-
return _context.abrupt("return", protocol.policyManagerConfigArgs({
|
3384
|
-
policies: policies,
|
3385
|
-
settings: policiesSettingsData
|
3386
|
-
}));
|
3387
|
-
|
3388
|
-
case 8:
|
3389
|
-
case "end":
|
3390
|
-
return _context.stop();
|
3391
|
-
}
|
3392
|
-
}
|
3393
|
-
}, _callee);
|
3394
|
-
}));
|
3395
|
-
return _generatePolicyManagerConfigWithMockPolicies.apply(this, arguments);
|
3396
|
-
}
|
3397
|
-
|
3398
|
-
function generateMockPolicies(_x2) {
|
3399
|
-
return _generateMockPolicies.apply(this, arguments);
|
3400
|
-
}
|
3401
|
-
|
3402
|
-
function _generateMockPolicies() {
|
3403
|
-
_generateMockPolicies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
3404
|
-
var deployer, mockAddTrackedAssetsPolicy, mockCreateExternalPositionPolicy, mockPostBuySharesPolicy, mockPostCallOnExternalPositionPolicy, mockPostCoIPolicy, mockRedeemSharesForSpecificAssetsPolicy, mockPreTransferSharesPolicy, mockRemoveExternalPositionPolicy;
|
3405
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3406
|
-
while (1) {
|
3407
|
-
switch (_context2.prev = _context2.next) {
|
3408
|
-
case 0:
|
3409
|
-
deployer = _ref2.deployer;
|
3410
|
-
_context2.next = 3;
|
3411
|
-
return protocol.IPolicy.mock(deployer);
|
3412
|
-
|
3413
|
-
case 3:
|
3414
|
-
mockAddTrackedAssetsPolicy = _context2.sent;
|
3415
|
-
_context2.next = 6;
|
3416
|
-
return protocol.IPolicy.mock(deployer);
|
3417
|
-
|
3418
|
-
case 6:
|
3419
|
-
mockCreateExternalPositionPolicy = _context2.sent;
|
3420
|
-
_context2.next = 9;
|
3421
|
-
return protocol.IPolicy.mock(deployer);
|
3422
|
-
|
3423
|
-
case 9:
|
3424
|
-
mockPostBuySharesPolicy = _context2.sent;
|
3425
|
-
_context2.next = 12;
|
3426
|
-
return protocol.IPolicy.mock(deployer);
|
3427
|
-
|
3428
|
-
case 12:
|
3429
|
-
mockPostCallOnExternalPositionPolicy = _context2.sent;
|
3430
|
-
_context2.next = 15;
|
3431
|
-
return protocol.IPolicy.mock(deployer);
|
3432
|
-
|
3433
|
-
case 15:
|
3434
|
-
mockPostCoIPolicy = _context2.sent;
|
3435
|
-
_context2.next = 18;
|
3436
|
-
return protocol.IPolicy.mock(deployer);
|
3437
|
-
|
3438
|
-
case 18:
|
3439
|
-
mockRedeemSharesForSpecificAssetsPolicy = _context2.sent;
|
3440
|
-
_context2.next = 21;
|
3441
|
-
return protocol.IPolicy.mock(deployer);
|
3442
|
-
|
3443
|
-
case 21:
|
3444
|
-
mockPreTransferSharesPolicy = _context2.sent;
|
3445
|
-
_context2.next = 24;
|
3446
|
-
return protocol.IPolicy.mock(deployer);
|
3447
|
-
|
3448
|
-
case 24:
|
3449
|
-
mockRemoveExternalPositionPolicy = _context2.sent;
|
3450
|
-
_context2.next = 27;
|
3451
|
-
return Promise.all([// AddTrackedAssets
|
3452
|
-
mockAddTrackedAssetsPolicy.identifier.returns("MOCK_ADD_TRACKED_ASSETS"), mockAddTrackedAssetsPolicy.addFundSettings.returns(undefined), mockAddTrackedAssetsPolicy.activateForFund.returns(undefined), mockAddTrackedAssetsPolicy.canDisable.returns(false), mockAddTrackedAssetsPolicy.validateRule.returns(true), mockAddTrackedAssetsPolicy.implementedHooks.returns([protocol.PolicyHook.AddTrackedAssets]), mockAddTrackedAssetsPolicy.updateFundSettings.returns(undefined), // CreateExternalPosition
|
3453
|
-
mockCreateExternalPositionPolicy.identifier.returns("MOCK_CREATE_EXTERNAL_POSITION"), mockCreateExternalPositionPolicy.addFundSettings.returns(undefined), mockCreateExternalPositionPolicy.activateForFund.returns(undefined), mockCreateExternalPositionPolicy.canDisable.returns(false), mockCreateExternalPositionPolicy.validateRule.returns(true), mockCreateExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.CreateExternalPosition]), mockCreateExternalPositionPolicy.updateFundSettings.returns(undefined), // PostBuyShares
|
3454
|
-
mockPostBuySharesPolicy.identifier.returns("MOCK_POST_BUY_SHARES"), mockPostBuySharesPolicy.addFundSettings.returns(undefined), mockPostBuySharesPolicy.activateForFund.returns(undefined), mockPostBuySharesPolicy.canDisable.returns(false), mockPostBuySharesPolicy.validateRule.returns(true), mockPostBuySharesPolicy.implementedHooks.returns([protocol.PolicyHook.PostBuyShares]), mockPostBuySharesPolicy.updateFundSettings.returns(undefined), // PostCallOnExternalPosition
|
3455
|
-
mockPostCallOnExternalPositionPolicy.identifier.returns("MOCK_POST_CALL_ON_EXTERNAL_POSITION"), mockPostCallOnExternalPositionPolicy.addFundSettings.returns(undefined), mockPostCallOnExternalPositionPolicy.activateForFund.returns(undefined), mockPostCallOnExternalPositionPolicy.canDisable.returns(false), mockPostCallOnExternalPositionPolicy.validateRule.returns(true), mockPostCallOnExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.PostCallOnExternalPosition]), mockPostCallOnExternalPositionPolicy.updateFundSettings.returns(undefined), // PostCallOnIntegration
|
3456
|
-
mockPostCoIPolicy.identifier.returns("MOCK_POST_CALL_ON_INTEGRATION"), mockPostCoIPolicy.addFundSettings.returns(undefined), mockPostCoIPolicy.activateForFund.returns(undefined), mockPostCoIPolicy.canDisable.returns(false), mockPostCoIPolicy.validateRule.returns(true), mockPostCoIPolicy.implementedHooks.returns([protocol.PolicyHook.PostCallOnIntegration]), mockPostCoIPolicy.updateFundSettings.returns(undefined), // PreTransferSharesPolicy
|
3457
|
-
mockPreTransferSharesPolicy.identifier.returns("MOCK_PRE_TRANSFER_SHARES"), mockPreTransferSharesPolicy.addFundSettings.returns(undefined), mockPreTransferSharesPolicy.activateForFund.returns(undefined), mockPreTransferSharesPolicy.canDisable.returns(false), mockPreTransferSharesPolicy.validateRule.returns(true), mockPreTransferSharesPolicy.implementedHooks.returns([protocol.PolicyHook.PreTransferShares]), mockPreTransferSharesPolicy.updateFundSettings.returns(undefined), // RedeemSharesForSpecificAssets
|
3458
|
-
mockRedeemSharesForSpecificAssetsPolicy.identifier.returns("MOCK_REDEEM_SHARES_FOR_SPECIFIC_ASSETS"), mockRedeemSharesForSpecificAssetsPolicy.addFundSettings.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.activateForFund.returns(undefined), mockRedeemSharesForSpecificAssetsPolicy.canDisable.returns(false), mockRedeemSharesForSpecificAssetsPolicy.validateRule.returns(true), mockRedeemSharesForSpecificAssetsPolicy.implementedHooks.returns([protocol.PolicyHook.RedeemSharesForSpecificAssets]), mockRedeemSharesForSpecificAssetsPolicy.updateFundSettings.returns(undefined), // RemoveExternalPosition
|
3459
|
-
mockRemoveExternalPositionPolicy.identifier.returns("MOCK_REMOVE_EXTERNAL_POSITION"), mockRemoveExternalPositionPolicy.addFundSettings.returns(undefined), mockRemoveExternalPositionPolicy.activateForFund.returns(undefined), mockRemoveExternalPositionPolicy.canDisable.returns(false), mockRemoveExternalPositionPolicy.validateRule.returns(true), mockRemoveExternalPositionPolicy.implementedHooks.returns([protocol.PolicyHook.RedeemSharesForSpecificAssets]), mockRemoveExternalPositionPolicy.updateFundSettings.returns(undefined)]);
|
3460
|
-
|
3461
|
-
case 27:
|
3462
|
-
return _context2.abrupt("return", {
|
3463
|
-
mockAddTrackedAssetsPolicy: mockAddTrackedAssetsPolicy,
|
3464
|
-
mockCreateExternalPositionPolicy: mockCreateExternalPositionPolicy,
|
3465
|
-
mockPostBuySharesPolicy: mockPostBuySharesPolicy,
|
3466
|
-
mockPostCallOnExternalPositionPolicy: mockPostCallOnExternalPositionPolicy,
|
3467
|
-
mockPostCoIPolicy: mockPostCoIPolicy,
|
3468
|
-
mockPreTransferSharesPolicy: mockPreTransferSharesPolicy,
|
3469
|
-
mockRedeemSharesForSpecificAssetsPolicy: mockRedeemSharesForSpecificAssetsPolicy,
|
3470
|
-
mockRemoveExternalPositionPolicy: mockRemoveExternalPositionPolicy
|
3471
|
-
});
|
3472
|
-
|
3473
|
-
case 28:
|
3474
|
-
case "end":
|
3475
|
-
return _context2.stop();
|
3476
|
-
}
|
3477
|
-
}
|
3478
|
-
}, _callee2);
|
3479
|
-
}));
|
3480
|
-
return _generateMockPolicies.apply(this, arguments);
|
3481
|
-
}
|
3482
|
-
|
3483
|
-
function assertEvent(receipt, event, match) {
|
3484
|
-
var _events$shift;
|
3485
|
-
|
3486
|
-
var events = ethers$1.extractEvent(receipt, event);
|
3487
|
-
expect(events.length).toBe(1);
|
3488
|
-
expect(receipt).toHaveEmittedWith(event, match);
|
3489
|
-
var args = (_events$shift = events.shift()) === null || _events$shift === void 0 ? void 0 : _events$shift.args; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
3490
|
-
|
3491
|
-
return args;
|
3492
|
-
}
|
3493
|
-
function assertNoEvent(receipt, event) {
|
3494
|
-
var events = ethers$1.extractEvent(receipt, event);
|
3495
|
-
expect(events.length).toBe(0);
|
3496
|
-
}
|
3497
|
-
|
3498
|
-
function buyShares(_x) {
|
3499
|
-
return _buyShares.apply(this, arguments);
|
3500
|
-
}
|
3501
|
-
|
3502
|
-
function _buyShares() {
|
3503
|
-
_buyShares = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(options) {
|
3504
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3505
|
-
while (1) {
|
3506
|
-
switch (_context.prev = _context.next) {
|
3507
|
-
case 0:
|
3508
|
-
_context.next = 2;
|
3509
|
-
return buySharesFunction(options);
|
3510
|
-
|
3511
|
-
case 2:
|
3512
|
-
return _context.abrupt("return", _context.sent.send());
|
3513
|
-
|
3514
|
-
case 3:
|
3515
|
-
case "end":
|
3516
|
-
return _context.stop();
|
3517
|
-
}
|
3518
|
-
}
|
3519
|
-
}, _callee);
|
3520
|
-
}));
|
3521
|
-
return _buyShares.apply(this, arguments);
|
3522
|
-
}
|
3523
|
-
|
3524
|
-
function buySharesFunction(_x2) {
|
3525
|
-
return _buySharesFunction.apply(this, arguments);
|
3526
|
-
}
|
3527
|
-
|
3528
|
-
function _buySharesFunction() {
|
3529
|
-
_buySharesFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref) {
|
3530
|
-
var comptrollerProxy, denominationAsset, buyer, investmentAmount, _ref$minSharesQuantit, minSharesQuantity, _ref$seedBuyer, seedBuyer;
|
3531
|
-
|
3532
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3533
|
-
while (1) {
|
3534
|
-
switch (_context2.prev = _context2.next) {
|
3535
|
-
case 0:
|
3536
|
-
comptrollerProxy = _ref.comptrollerProxy, denominationAsset = _ref.denominationAsset, buyer = _ref.buyer, investmentAmount = _ref.investmentAmount, _ref$minSharesQuantit = _ref.minSharesQuantity, minSharesQuantity = _ref$minSharesQuantit === void 0 ? 1 : _ref$minSharesQuantit, _ref$seedBuyer = _ref.seedBuyer, seedBuyer = _ref$seedBuyer === void 0 ? false : _ref$seedBuyer;
|
3537
|
-
|
3538
|
-
if (!(investmentAmount == undefined)) {
|
3539
|
-
_context2.next = 7;
|
3540
|
-
break;
|
3541
|
-
}
|
3542
|
-
|
3543
|
-
_context2.t0 = ethers.utils;
|
3544
|
-
_context2.next = 5;
|
3545
|
-
return denominationAsset.decimals();
|
3546
|
-
|
3547
|
-
case 5:
|
3548
|
-
_context2.t1 = _context2.sent;
|
3549
|
-
investmentAmount = _context2.t0.parseUnits.call(_context2.t0, '1', _context2.t1);
|
3550
|
-
|
3551
|
-
case 7:
|
3552
|
-
if (!seedBuyer) {
|
3553
|
-
_context2.next = 10;
|
3554
|
-
break;
|
3555
|
-
}
|
3556
|
-
|
3557
|
-
_context2.next = 10;
|
3558
|
-
return denominationAsset.transfer(buyer, investmentAmount);
|
3559
|
-
|
3560
|
-
case 10:
|
3561
|
-
_context2.next = 12;
|
3562
|
-
return denominationAsset.connect(buyer).approve(comptrollerProxy, investmentAmount);
|
3563
|
-
|
3564
|
-
case 12:
|
3565
|
-
return _context2.abrupt("return", comptrollerProxy.connect(buyer).buyShares.args(investmentAmount, minSharesQuantity).ref);
|
3566
|
-
|
3567
|
-
case 13:
|
3568
|
-
case "end":
|
3569
|
-
return _context2.stop();
|
3570
|
-
}
|
3571
|
-
}
|
3572
|
-
}, _callee2);
|
3573
|
-
}));
|
3574
|
-
return _buySharesFunction.apply(this, arguments);
|
3575
|
-
}
|
3576
|
-
|
3577
|
-
function redeemSharesForSpecificAssets(_x3) {
|
3578
|
-
return _redeemSharesForSpecificAssets.apply(this, arguments);
|
3579
|
-
}
|
3580
|
-
|
3581
|
-
function _redeemSharesForSpecificAssets() {
|
3582
|
-
_redeemSharesForSpecificAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref2) {
|
3583
|
-
var comptrollerProxy, signer, _ref2$recipient, recipient, _ref2$quantity, quantity, payoutAssets, payoutAssetPercentages;
|
3584
|
-
|
3585
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
3586
|
-
while (1) {
|
3587
|
-
switch (_context3.prev = _context3.next) {
|
3588
|
-
case 0:
|
3589
|
-
comptrollerProxy = _ref2.comptrollerProxy, signer = _ref2.signer, _ref2$recipient = _ref2.recipient, recipient = _ref2$recipient === void 0 ? signer : _ref2$recipient, _ref2$quantity = _ref2.quantity, quantity = _ref2$quantity === void 0 ? ethers.constants.MaxUint256 : _ref2$quantity, payoutAssets = _ref2.payoutAssets, payoutAssetPercentages = _ref2.payoutAssetPercentages;
|
3590
|
-
return _context3.abrupt("return", comptrollerProxy.connect(signer).redeemSharesForSpecificAssets(recipient, quantity, payoutAssets, payoutAssetPercentages));
|
3591
|
-
|
3592
|
-
case 2:
|
3593
|
-
case "end":
|
3594
|
-
return _context3.stop();
|
3595
|
-
}
|
3596
|
-
}
|
3597
|
-
}, _callee3);
|
3598
|
-
}));
|
3599
|
-
return _redeemSharesForSpecificAssets.apply(this, arguments);
|
3600
|
-
}
|
3601
|
-
|
3602
|
-
function redeemSharesInKind(_x4) {
|
3603
|
-
return _redeemSharesInKind.apply(this, arguments);
|
3604
|
-
}
|
3605
|
-
|
3606
|
-
function _redeemSharesInKind() {
|
3607
|
-
_redeemSharesInKind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref3) {
|
3608
|
-
var comptrollerProxy, signer, _ref3$recipient, recipient, _ref3$quantity, quantity, _ref3$additionalAsset, additionalAssets, _ref3$assetsToSkip, assetsToSkip;
|
3609
|
-
|
3610
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
3611
|
-
while (1) {
|
3612
|
-
switch (_context4.prev = _context4.next) {
|
3613
|
-
case 0:
|
3614
|
-
comptrollerProxy = _ref3.comptrollerProxy, signer = _ref3.signer, _ref3$recipient = _ref3.recipient, recipient = _ref3$recipient === void 0 ? signer : _ref3$recipient, _ref3$quantity = _ref3.quantity, quantity = _ref3$quantity === void 0 ? ethers.constants.MaxUint256 : _ref3$quantity, _ref3$additionalAsset = _ref3.additionalAssets, additionalAssets = _ref3$additionalAsset === void 0 ? [] : _ref3$additionalAsset, _ref3$assetsToSkip = _ref3.assetsToSkip, assetsToSkip = _ref3$assetsToSkip === void 0 ? [] : _ref3$assetsToSkip;
|
3615
|
-
return _context4.abrupt("return", comptrollerProxy.connect(signer).redeemSharesInKind(recipient, quantity, additionalAssets, assetsToSkip));
|
3616
|
-
|
3617
|
-
case 2:
|
3618
|
-
case "end":
|
3619
|
-
return _context4.stop();
|
3620
|
-
}
|
3621
|
-
}
|
3622
|
-
}, _callee4);
|
3623
|
-
}));
|
3624
|
-
return _redeemSharesInKind.apply(this, arguments);
|
3625
|
-
}
|
3626
|
-
|
3627
|
-
function ownKeys$1(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; }
|
3628
|
-
|
3629
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
3630
|
-
function createComptrollerProxy(_x) {
|
3631
|
-
return _createComptrollerProxy.apply(this, arguments);
|
3632
|
-
}
|
3633
|
-
|
3634
|
-
function _createComptrollerProxy() {
|
3635
|
-
_createComptrollerProxy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3636
|
-
var signer, comptrollerLib, denominationAsset, _ref$sharesActionTime, sharesActionTimelock, constructData, comptrollerProxyContract;
|
3637
|
-
|
3638
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3639
|
-
while (1) {
|
3640
|
-
switch (_context.prev = _context.next) {
|
3641
|
-
case 0:
|
3642
|
-
signer = _ref.signer, comptrollerLib = _ref.comptrollerLib, denominationAsset = _ref.denominationAsset, _ref$sharesActionTime = _ref.sharesActionTimelock, sharesActionTimelock = _ref$sharesActionTime === void 0 ? 0 : _ref$sharesActionTime;
|
3643
|
-
constructData = protocol.encodeFunctionData(comptrollerLib.init.fragment, [denominationAsset, sharesActionTimelock]);
|
3644
|
-
_context.next = 4;
|
3645
|
-
return protocol.ComptrollerProxy.deploy(signer, constructData, comptrollerLib);
|
3646
|
-
|
3647
|
-
case 4:
|
3648
|
-
comptrollerProxyContract = _context.sent;
|
3649
|
-
return _context.abrupt("return", {
|
3650
|
-
comptrollerProxy: new protocol.ComptrollerLib(comptrollerProxyContract, signer),
|
3651
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
3652
|
-
receipt: comptrollerProxyContract.deployment
|
3653
|
-
});
|
3654
|
-
|
3655
|
-
case 6:
|
3656
|
-
case "end":
|
3657
|
-
return _context.stop();
|
3658
|
-
}
|
3659
|
-
}
|
3660
|
-
}, _callee);
|
3661
|
-
}));
|
3662
|
-
return _createComptrollerProxy.apply(this, arguments);
|
3663
|
-
}
|
3664
|
-
|
3665
|
-
function createMigrationRequest(_x2) {
|
3666
|
-
return _createMigrationRequest.apply(this, arguments);
|
3667
|
-
} // TODO: should we pass in the fundOwner as a signer also so we can connect comptroller proxy and vault proxy to that acct instead?
|
3668
|
-
|
3669
|
-
function _createMigrationRequest() {
|
3670
|
-
_createMigrationRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref2) {
|
3671
|
-
var signer, fundDeployer, vaultProxy, denominationAsset, _ref2$sharesActionTim, sharesActionTimelock, _ref2$feeManagerConfi, feeManagerConfigData, _ref2$policyManagerCo, policyManagerConfigData, _ref2$bypassPrevRelea, bypassPrevReleaseFailure, receipt, comptrollerDeployedArgs;
|
3672
|
-
|
3673
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3674
|
-
while (1) {
|
3675
|
-
switch (_context2.prev = _context2.next) {
|
3676
|
-
case 0:
|
3677
|
-
signer = _ref2.signer, fundDeployer = _ref2.fundDeployer, vaultProxy = _ref2.vaultProxy, denominationAsset = _ref2.denominationAsset, _ref2$sharesActionTim = _ref2.sharesActionTimelock, sharesActionTimelock = _ref2$sharesActionTim === void 0 ? 0 : _ref2$sharesActionTim, _ref2$feeManagerConfi = _ref2.feeManagerConfigData, feeManagerConfigData = _ref2$feeManagerConfi === void 0 ? '0x' : _ref2$feeManagerConfi, _ref2$policyManagerCo = _ref2.policyManagerConfigData, policyManagerConfigData = _ref2$policyManagerCo === void 0 ? '0x' : _ref2$policyManagerCo, _ref2$bypassPrevRelea = _ref2.bypassPrevReleaseFailure, bypassPrevReleaseFailure = _ref2$bypassPrevRelea === void 0 ? false : _ref2$bypassPrevRelea;
|
3678
|
-
_context2.next = 3;
|
3679
|
-
return fundDeployer.connect(signer).createMigrationRequest(vaultProxy, denominationAsset, sharesActionTimelock, feeManagerConfigData, policyManagerConfigData, bypassPrevReleaseFailure);
|
3680
|
-
|
3681
|
-
case 3:
|
3682
|
-
receipt = _context2.sent;
|
3683
|
-
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
3684
|
-
comptrollerProxy: expect.any(String),
|
3685
|
-
creator: signer,
|
3686
|
-
denominationAsset: denominationAsset,
|
3687
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
3688
|
-
});
|
3689
|
-
return _context2.abrupt("return", {
|
3690
|
-
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3691
|
-
receipt: receipt
|
3692
|
-
});
|
3693
|
-
|
3694
|
-
case 6:
|
3695
|
-
case "end":
|
3696
|
-
return _context2.stop();
|
3697
|
-
}
|
3698
|
-
}
|
3699
|
-
}, _callee2);
|
3700
|
-
}));
|
3701
|
-
return _createMigrationRequest.apply(this, arguments);
|
3702
|
-
}
|
3703
|
-
|
3704
|
-
function createNewFund(_x3) {
|
3705
|
-
return _createNewFund.apply(this, arguments);
|
3706
|
-
}
|
3707
|
-
|
3708
|
-
function _createNewFund() {
|
3709
|
-
_createNewFund = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
3710
|
-
var signer, fundDeployer, denominationAsset, _ref3$sharesActionTim, sharesActionTimelock, _ref3$fundOwner, fundOwner, _ref3$fundName, fundName, _ref3$fundSymbol, fundSymbol, _ref3$feeManagerConfi, feeManagerConfig, _ref3$policyManagerCo, policyManagerConfig, investment, receipt, comptrollerDeployedArgs, comptrollerProxy, newFundDeployedArgs, vaultProxy;
|
3711
|
-
|
3712
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
3713
|
-
while (1) {
|
3714
|
-
switch (_context3.prev = _context3.next) {
|
3715
|
-
case 0:
|
3716
|
-
signer = _ref3.signer, fundDeployer = _ref3.fundDeployer, denominationAsset = _ref3.denominationAsset, _ref3$sharesActionTim = _ref3.sharesActionTimelock, sharesActionTimelock = _ref3$sharesActionTim === void 0 ? 0 : _ref3$sharesActionTim, _ref3$fundOwner = _ref3.fundOwner, fundOwner = _ref3$fundOwner === void 0 ? ethers$1.randomAddress() : _ref3$fundOwner, _ref3$fundName = _ref3.fundName, fundName = _ref3$fundName === void 0 ? 'My Fund' : _ref3$fundName, _ref3$fundSymbol = _ref3.fundSymbol, fundSymbol = _ref3$fundSymbol === void 0 ? '' : _ref3$fundSymbol, _ref3$feeManagerConfi = _ref3.feeManagerConfig, feeManagerConfig = _ref3$feeManagerConfi === void 0 ? '0x' : _ref3$feeManagerConfi, _ref3$policyManagerCo = _ref3.policyManagerConfig, policyManagerConfig = _ref3$policyManagerCo === void 0 ? '0x' : _ref3$policyManagerCo, investment = _ref3.investment;
|
3717
|
-
_context3.next = 3;
|
3718
|
-
return fundDeployer.connect(signer).createNewFund(fundOwner, fundName, fundSymbol, denominationAsset, sharesActionTimelock, feeManagerConfig, policyManagerConfig);
|
3719
|
-
|
3720
|
-
case 3:
|
3721
|
-
receipt = _context3.sent;
|
3722
|
-
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
3723
|
-
comptrollerProxy: expect.any(String),
|
3724
|
-
creator: signer,
|
3725
|
-
denominationAsset: denominationAsset,
|
3726
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
3727
|
-
});
|
3728
|
-
comptrollerProxy = new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
3729
|
-
newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
3730
|
-
comptrollerProxy: comptrollerProxy,
|
3731
|
-
creator: signer,
|
3732
|
-
vaultProxy: expect.any(String)
|
3733
|
-
});
|
3734
|
-
vaultProxy = new protocol.VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
3735
|
-
|
3736
|
-
if (!(investment != null)) {
|
3737
|
-
_context3.next = 11;
|
3738
|
-
break;
|
3739
|
-
}
|
3740
|
-
|
3741
|
-
_context3.next = 11;
|
3742
|
-
return buyShares(_objectSpread$1({
|
3743
|
-
comptrollerProxy: comptrollerProxy,
|
3744
|
-
denominationAsset: denominationAsset
|
3745
|
-
}, investment));
|
3746
|
-
|
3747
|
-
case 11:
|
3748
|
-
return _context3.abrupt("return", {
|
3749
|
-
comptrollerProxy: comptrollerProxy,
|
3750
|
-
receipt: receipt,
|
3751
|
-
vaultProxy: vaultProxy
|
3752
|
-
});
|
3753
|
-
|
3754
|
-
case 12:
|
3755
|
-
case "end":
|
3756
|
-
return _context3.stop();
|
3757
|
-
}
|
3758
|
-
}
|
3759
|
-
}, _callee3);
|
3760
|
-
}));
|
3761
|
-
return _createNewFund.apply(this, arguments);
|
3762
|
-
}
|
3763
|
-
|
3764
|
-
function createReconfigurationRequest(_x4) {
|
3765
|
-
return _createReconfigurationRequest.apply(this, arguments);
|
3766
|
-
}
|
3767
|
-
|
3768
|
-
function _createReconfigurationRequest() {
|
3769
|
-
_createReconfigurationRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(_ref4) {
|
3770
|
-
var signer, fundDeployer, vaultProxy, denominationAsset, _ref4$sharesActionTim, sharesActionTimelock, _ref4$feeManagerConfi, feeManagerConfigData, _ref4$policyManagerCo, policyManagerConfigData, receipt, comptrollerDeployedArgs;
|
3771
|
-
|
3772
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
3773
|
-
while (1) {
|
3774
|
-
switch (_context4.prev = _context4.next) {
|
3775
|
-
case 0:
|
3776
|
-
signer = _ref4.signer, fundDeployer = _ref4.fundDeployer, vaultProxy = _ref4.vaultProxy, denominationAsset = _ref4.denominationAsset, _ref4$sharesActionTim = _ref4.sharesActionTimelock, sharesActionTimelock = _ref4$sharesActionTim === void 0 ? 0 : _ref4$sharesActionTim, _ref4$feeManagerConfi = _ref4.feeManagerConfigData, feeManagerConfigData = _ref4$feeManagerConfi === void 0 ? '0x' : _ref4$feeManagerConfi, _ref4$policyManagerCo = _ref4.policyManagerConfigData, policyManagerConfigData = _ref4$policyManagerCo === void 0 ? '0x' : _ref4$policyManagerCo;
|
3777
|
-
_context4.next = 3;
|
3778
|
-
return fundDeployer.connect(signer).createReconfigurationRequest(vaultProxy, denominationAsset, sharesActionTimelock, feeManagerConfigData, policyManagerConfigData);
|
3779
|
-
|
3780
|
-
case 3:
|
3781
|
-
receipt = _context4.sent;
|
3782
|
-
comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
3783
|
-
comptrollerProxy: expect.any(String),
|
3784
|
-
creator: signer,
|
3785
|
-
denominationAsset: denominationAsset,
|
3786
|
-
sharesActionTimelock: ethers.BigNumber.from(sharesActionTimelock)
|
3787
|
-
});
|
3788
|
-
return _context4.abrupt("return", {
|
3789
|
-
comptrollerProxy: new protocol.ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
3790
|
-
receipt: receipt
|
3791
|
-
});
|
3792
|
-
|
3793
|
-
case 6:
|
3794
|
-
case "end":
|
3795
|
-
return _context4.stop();
|
3796
|
-
}
|
3797
|
-
}
|
3798
|
-
}, _callee4);
|
3799
|
-
}));
|
3800
|
-
return _createReconfigurationRequest.apply(this, arguments);
|
3801
|
-
}
|
3802
|
-
|
3803
|
-
function createVaultProxy(_x5) {
|
3804
|
-
return _createVaultProxy.apply(this, arguments);
|
3805
|
-
}
|
3806
|
-
|
3807
|
-
function _createVaultProxy() {
|
3808
|
-
_createVaultProxy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(_ref5) {
|
3809
|
-
var signer, vaultLib, fundOwner, fundAccessor, _ref5$fundName, fundName, constructData, vaultProxyContract;
|
3810
|
-
|
3811
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
3812
|
-
while (1) {
|
3813
|
-
switch (_context5.prev = _context5.next) {
|
3814
|
-
case 0:
|
3815
|
-
signer = _ref5.signer, vaultLib = _ref5.vaultLib, fundOwner = _ref5.fundOwner, fundAccessor = _ref5.fundAccessor, _ref5$fundName = _ref5.fundName, fundName = _ref5$fundName === void 0 ? 'My Fund' : _ref5$fundName;
|
3816
|
-
constructData = protocol.encodeFunctionData(vaultLib.init.fragment, [fundOwner, fundAccessor, fundName]);
|
3817
|
-
_context5.next = 4;
|
3818
|
-
return protocol.VaultProxy.deploy(signer, constructData, vaultLib);
|
3819
|
-
|
3820
|
-
case 4:
|
3821
|
-
vaultProxyContract = _context5.sent;
|
3822
|
-
return _context5.abrupt("return", new protocol.VaultLib(vaultProxyContract, fundAccessor));
|
3823
|
-
|
3824
|
-
case 6:
|
3825
|
-
case "end":
|
3826
|
-
return _context5.stop();
|
3827
|
-
}
|
3828
|
-
}
|
3829
|
-
}, _callee5);
|
3830
|
-
}));
|
3831
|
-
return _createVaultProxy.apply(this, arguments);
|
3832
|
-
}
|
3833
|
-
|
3834
|
-
function setupGasRelayerPaymaster(_x6) {
|
3835
|
-
return _setupGasRelayerPaymaster.apply(this, arguments);
|
3836
|
-
}
|
3837
|
-
|
3838
|
-
function _setupGasRelayerPaymaster() {
|
3839
|
-
_setupGasRelayerPaymaster = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(_ref6) {
|
3840
|
-
var signer, vaultProxy, fundAccessor, weth, _ref6$startingBalance, startingBalance, comptrollerProxy, receipt, eventArgs;
|
3841
|
-
|
3842
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
3843
|
-
while (1) {
|
3844
|
-
switch (_context6.prev = _context6.next) {
|
3845
|
-
case 0:
|
3846
|
-
signer = _ref6.signer, vaultProxy = _ref6.vaultProxy, fundAccessor = _ref6.fundAccessor, weth = _ref6.weth, _ref6$startingBalance = _ref6.startingBalance, startingBalance = _ref6$startingBalance === void 0 ? ethers.utils.parseUnits('10', 18) : _ref6$startingBalance;
|
3847
|
-
_context6.next = 3;
|
3848
|
-
return weth.transfer(vaultProxy, startingBalance);
|
3849
|
-
|
3850
|
-
case 3:
|
3851
|
-
comptrollerProxy = new protocol.ComptrollerLib(fundAccessor, signer);
|
3852
|
-
_context6.next = 6;
|
3853
|
-
return comptrollerProxy.deployGasRelayPaymaster();
|
3854
|
-
|
3855
|
-
case 6:
|
3856
|
-
receipt = _context6.sent;
|
3857
|
-
eventArgs = assertEvent(receipt, 'GasRelayPaymasterSet', {
|
3858
|
-
gasRelayPaymaster: expect.any(String)
|
3859
|
-
});
|
3860
|
-
return _context6.abrupt("return", new protocol.GasRelayPaymasterLib(eventArgs.gasRelayPaymaster, signer));
|
3861
|
-
|
3862
|
-
case 9:
|
3863
|
-
case "end":
|
3864
|
-
return _context6.stop();
|
3865
|
-
}
|
3866
|
-
}
|
3867
|
-
}, _callee6);
|
3868
|
-
}));
|
3869
|
-
return _setupGasRelayerPaymaster.apply(this, arguments);
|
3870
|
-
}
|
3871
|
-
|
3872
|
-
function vaultCallCreateNewList(_x) {
|
3873
|
-
return _vaultCallCreateNewList.apply(this, arguments);
|
3874
|
-
}
|
3875
|
-
|
3876
|
-
function _vaultCallCreateNewList() {
|
3877
|
-
_vaultCallCreateNewList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(_ref) {
|
3878
|
-
var addressListRegistry, comptrollerProxy, items, owner, signer, updateType, listCount;
|
3879
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3880
|
-
while (1) {
|
3881
|
-
switch (_context.prev = _context.next) {
|
3882
|
-
case 0:
|
3883
|
-
addressListRegistry = _ref.addressListRegistry, comptrollerProxy = _ref.comptrollerProxy, items = _ref.items, owner = _ref.owner, signer = _ref.signer, updateType = _ref.updateType;
|
3884
|
-
_context.next = 3;
|
3885
|
-
return comptrollerProxy.connect(signer).vaultCallOnContract(addressListRegistry.address, protocol.addressListRegistryCreateListSelector, protocol.encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]));
|
3886
|
-
|
3887
|
-
case 3:
|
3888
|
-
_context.next = 5;
|
3889
|
-
return addressListRegistry.getListCount();
|
3890
|
-
|
3891
|
-
case 5:
|
3892
|
-
listCount = _context.sent;
|
3893
|
-
return _context.abrupt("return", listCount.sub(1));
|
3894
|
-
|
3895
|
-
case 7:
|
3896
|
-
case "end":
|
3897
|
-
return _context.stop();
|
3898
|
-
}
|
3899
|
-
}
|
3900
|
-
}, _callee);
|
3901
|
-
}));
|
3902
|
-
return _vaultCallCreateNewList.apply(this, arguments);
|
3903
|
-
}
|
3904
|
-
|
3905
|
-
function vaultCallCurveMinterMint(_ref2) {
|
3906
|
-
var comptrollerProxy = _ref2.comptrollerProxy,
|
3907
|
-
minter = _ref2.minter,
|
3908
|
-
gauge = _ref2.gauge;
|
3909
|
-
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintSelector, protocol.encodeArgs(['address'], [gauge]));
|
3910
|
-
}
|
3911
|
-
function vaultCallCurveMinterMintMany(_ref3) {
|
3912
|
-
var comptrollerProxy = _ref3.comptrollerProxy,
|
3913
|
-
minter = _ref3.minter,
|
3914
|
-
gauges = _ref3.gauges;
|
3915
|
-
var gaugesFormatted = new Array(8).fill(ethers.constants.AddressZero);
|
3916
|
-
|
3917
|
-
for (var i in gauges) {
|
3918
|
-
gaugesFormatted[i] = gauges[i];
|
3919
|
-
}
|
3920
|
-
|
3921
|
-
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterMintManySelector, protocol.encodeArgs(['address[8]'], [gaugesFormatted]));
|
3922
|
-
}
|
3923
|
-
function vaultCallCurveMinterToggleApproveMint(_ref4) {
|
3924
|
-
var comptrollerProxy = _ref4.comptrollerProxy,
|
3925
|
-
minter = _ref4.minter,
|
3926
|
-
account = _ref4.account;
|
3927
|
-
return comptrollerProxy.vaultCallOnContract(minter, protocol.curveMinterToggleApproveMintSelector, protocol.encodeArgs(['address'], [account]));
|
3928
|
-
}
|
3929
|
-
function vaultCallStartAssetBypassTimelock(_ref5) {
|
3930
|
-
var comptrollerProxy = _ref5.comptrollerProxy,
|
3931
|
-
contract = _ref5.contract,
|
3932
|
-
asset = _ref5.asset;
|
3933
|
-
return comptrollerProxy.vaultCallOnContract(contract, protocol.sighash(ethers.utils.FunctionFragment.fromString('startAssetBypassTimelock(address)')), protocol.encodeArgs(['address'], [asset]));
|
3934
|
-
}
|
3935
|
-
|
3936
|
-
function transactionTimestamp(_x) {
|
3937
|
-
return _transactionTimestamp.apply(this, arguments);
|
3938
|
-
}
|
3939
|
-
|
3940
|
-
function _transactionTimestamp() {
|
3941
|
-
_transactionTimestamp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(receipt) {
|
3942
|
-
var block;
|
3943
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
3944
|
-
while (1) {
|
3945
|
-
switch (_context.prev = _context.next) {
|
3946
|
-
case 0:
|
3947
|
-
_context.next = 2;
|
3948
|
-
return provider.getBlock(receipt.blockNumber);
|
3949
|
-
|
3950
|
-
case 2:
|
3951
|
-
block = _context.sent;
|
3952
|
-
return _context.abrupt("return", block.timestamp);
|
3953
|
-
|
3954
|
-
case 4:
|
3955
|
-
case "end":
|
3956
|
-
return _context.stop();
|
3957
|
-
}
|
3958
|
-
}
|
3959
|
-
}, _callee);
|
3960
|
-
}));
|
3961
|
-
return _transactionTimestamp.apply(this, arguments);
|
3962
|
-
}
|
3963
|
-
|
3964
|
-
function calcMlnValueAndBurnAmountForSharesBuyback(_x2) {
|
3965
|
-
return _calcMlnValueAndBurnAmountForSharesBuyback.apply(this, arguments);
|
3966
|
-
}
|
3967
|
-
|
3968
|
-
function _calcMlnValueAndBurnAmountForSharesBuyback() {
|
3969
|
-
_calcMlnValueAndBurnAmountForSharesBuyback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(_ref) {
|
3970
|
-
var valueInterpreter, mln, denominationAsset, sharesSupply, gav, buybackSharesAmount, grossShareValue, denominationAssetValueOfBuyback, mlnValueOfBuyback, mlnAmountToBurn;
|
3971
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
3972
|
-
while (1) {
|
3973
|
-
switch (_context2.prev = _context2.next) {
|
3974
|
-
case 0:
|
3975
|
-
valueInterpreter = _ref.valueInterpreter, mln = _ref.mln, denominationAsset = _ref.denominationAsset, sharesSupply = _ref.sharesSupply, gav = _ref.gav, buybackSharesAmount = _ref.buybackSharesAmount;
|
3976
|
-
// Calculate expected mlnValue of shares to buyback
|
3977
|
-
// TODO: calcGrossShareValue can also be a helper util
|
3978
|
-
grossShareValue = ethers.BigNumber.from(gav).mul(ethers.utils.parseEther('1')).div(sharesSupply);
|
3979
|
-
denominationAssetValueOfBuyback = grossShareValue.mul(buybackSharesAmount).div(ethers.utils.parseEther('1'));
|
3980
|
-
_context2.next = 5;
|
3981
|
-
return valueInterpreter.calcCanonicalAssetValue.args(denominationAsset, denominationAssetValueOfBuyback, mln).call();
|
3982
|
-
|
3983
|
-
case 5:
|
3984
|
-
mlnValueOfBuyback = _context2.sent;
|
3985
|
-
// 50% discount
|
3986
|
-
mlnAmountToBurn = mlnValueOfBuyback.div(2);
|
3987
|
-
return _context2.abrupt("return", {
|
3988
|
-
mlnAmountToBurn: mlnAmountToBurn,
|
3989
|
-
mlnValue: mlnValueOfBuyback
|
3990
|
-
});
|
3991
|
-
|
3992
|
-
case 8:
|
3993
|
-
case "end":
|
3994
|
-
return _context2.stop();
|
3995
|
-
}
|
3996
|
-
}
|
3997
|
-
}, _callee2);
|
3998
|
-
}));
|
3999
|
-
return _calcMlnValueAndBurnAmountForSharesBuyback.apply(this, arguments);
|
4000
|
-
}
|
4001
|
-
|
4002
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4003
|
-
|
4004
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4005
|
-
|
4006
|
-
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
4007
|
-
var whales = {
|
4008
|
-
// primitives
|
4009
|
-
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
4010
|
-
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
4011
|
-
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
4012
|
-
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
4013
|
-
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
4014
|
-
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
4015
|
-
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
4016
|
-
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
4017
|
-
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
4018
|
-
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
4019
|
-
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
4020
|
-
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
4021
|
-
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
4022
|
-
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
4023
|
-
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
4024
|
-
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
4025
|
-
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
4026
|
-
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
4027
|
-
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
4028
|
-
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
4029
|
-
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
4030
|
-
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
4031
|
-
// aTokens
|
4032
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
4033
|
-
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
4034
|
-
// cTokens
|
4035
|
-
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
4036
|
-
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
4037
|
-
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
4038
|
-
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
4039
|
-
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
4040
|
-
// fTokens
|
4041
|
-
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
4042
|
-
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
4043
|
-
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
4044
|
-
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
4045
|
-
// ptTokens
|
4046
|
-
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
4047
|
-
// synths (unsupported)
|
4048
|
-
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
4049
|
-
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
4050
|
-
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
4051
|
-
// misc
|
4052
|
-
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
4053
|
-
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
4054
|
-
// Curve steth pool related
|
4055
|
-
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663'
|
4056
|
-
};
|
4057
|
-
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
4058
|
-
|
4059
|
-
function unlockWhale(_x) {
|
4060
|
-
return _unlockWhale.apply(this, arguments);
|
4061
|
-
}
|
4062
|
-
|
4063
|
-
function _unlockWhale() {
|
4064
|
-
_unlockWhale = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(token) {
|
4065
|
-
var address;
|
4066
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
4067
|
-
while (1) {
|
4068
|
-
switch (_context.prev = _context.next) {
|
4069
|
-
case 0:
|
4070
|
-
address = ethers$1.resolveAddress(whales[token]);
|
4071
|
-
_context.next = 3;
|
4072
|
-
return provider.send('hardhat_impersonateAccount', [address]);
|
4073
|
-
|
4074
|
-
case 3:
|
4075
|
-
return _context.abrupt("return", provider.getSignerWithAddress(address));
|
4076
|
-
|
4077
|
-
case 4:
|
4078
|
-
case "end":
|
4079
|
-
return _context.stop();
|
4080
|
-
}
|
4081
|
-
}
|
4082
|
-
}, _callee);
|
4083
|
-
}));
|
4084
|
-
return _unlockWhale.apply(this, arguments);
|
4085
|
-
}
|
4086
|
-
|
4087
|
-
function unlockAllWhales() {
|
4088
|
-
return _unlockAllWhales.apply(this, arguments);
|
4089
|
-
}
|
4090
|
-
|
4091
|
-
function _unlockAllWhales() {
|
4092
|
-
_unlockAllWhales = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
4093
|
-
var keys, signers;
|
4094
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
4095
|
-
while (1) {
|
4096
|
-
switch (_context3.prev = _context3.next) {
|
4097
|
-
case 0:
|
4098
|
-
keys = Object.keys(whales);
|
4099
|
-
_context3.next = 3;
|
4100
|
-
return Promise.all(keys.map( /*#__PURE__*/function () {
|
4101
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(token) {
|
4102
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
4103
|
-
while (1) {
|
4104
|
-
switch (_context2.prev = _context2.next) {
|
4105
|
-
case 0:
|
4106
|
-
return _context2.abrupt("return", unlockWhale(token));
|
4107
|
-
|
4108
|
-
case 1:
|
4109
|
-
case "end":
|
4110
|
-
return _context2.stop();
|
4111
|
-
}
|
4112
|
-
}
|
4113
|
-
}, _callee2);
|
4114
|
-
}));
|
4115
|
-
|
4116
|
-
return function (_x2) {
|
4117
|
-
return _ref.apply(this, arguments);
|
4118
|
-
};
|
4119
|
-
}()));
|
4120
|
-
|
4121
|
-
case 3:
|
4122
|
-
signers = _context3.sent;
|
4123
|
-
return _context3.abrupt("return", keys.reduce(function (carry, key, index) {
|
4124
|
-
return _objectSpread(_objectSpread({}, carry), {}, _defineProperty({}, key, signers[index]));
|
4125
|
-
}, {}));
|
4126
|
-
|
4127
|
-
case 5:
|
4128
|
-
case "end":
|
4129
|
-
return _context3.stop();
|
4130
|
-
}
|
4131
|
-
}
|
4132
|
-
}, _callee3);
|
4133
|
-
}));
|
4134
|
-
return _unlockAllWhales.apply(this, arguments);
|
4135
|
-
}
|
4136
|
-
|
4137
|
-
function unlockWhales() {
|
4138
|
-
return _unlockWhales.apply(this, arguments);
|
4139
|
-
}
|
4140
|
-
|
4141
|
-
function _unlockWhales() {
|
4142
|
-
_unlockWhales = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5() {
|
4143
|
-
var _len,
|
4144
|
-
tokens,
|
4145
|
-
_key,
|
4146
|
-
signers,
|
4147
|
-
_args5 = arguments;
|
4148
|
-
|
4149
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
4150
|
-
while (1) {
|
4151
|
-
switch (_context5.prev = _context5.next) {
|
4152
|
-
case 0:
|
4153
|
-
for (_len = _args5.length, tokens = new Array(_len), _key = 0; _key < _len; _key++) {
|
4154
|
-
tokens[_key] = _args5[_key];
|
4155
|
-
}
|
4156
|
-
|
4157
|
-
_context5.next = 3;
|
4158
|
-
return Promise.all(tokens.map( /*#__PURE__*/function () {
|
4159
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(token) {
|
4160
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
4161
|
-
while (1) {
|
4162
|
-
switch (_context4.prev = _context4.next) {
|
4163
|
-
case 0:
|
4164
|
-
return _context4.abrupt("return", unlockWhale(token));
|
4165
|
-
|
4166
|
-
case 1:
|
4167
|
-
case "end":
|
4168
|
-
return _context4.stop();
|
4169
|
-
}
|
4170
|
-
}
|
4171
|
-
}, _callee4);
|
4172
|
-
}));
|
4173
|
-
|
4174
|
-
return function (_x3) {
|
4175
|
-
return _ref2.apply(this, arguments);
|
4176
|
-
};
|
4177
|
-
}()));
|
4178
|
-
|
4179
|
-
case 3:
|
4180
|
-
signers = _context5.sent;
|
4181
|
-
return _context5.abrupt("return", tokens.reduce(function (carry, key, index) {
|
4182
|
-
return _objectSpread(_objectSpread({}, carry), {}, _defineProperty({}, key, signers[index]));
|
4183
|
-
}, {}));
|
4184
|
-
|
4185
|
-
case 5:
|
4186
|
-
case "end":
|
4187
|
-
return _context5.stop();
|
4188
|
-
}
|
4189
|
-
}
|
4190
|
-
}, _callee5);
|
4191
|
-
}));
|
4192
|
-
return _unlockWhales.apply(this, arguments);
|
4193
|
-
}
|
4194
|
-
|
4195
|
-
function relayTransaction(_x) {
|
4196
|
-
return _relayTransaction.apply(this, arguments);
|
4197
|
-
}
|
4198
|
-
|
4199
|
-
function _relayTransaction() {
|
4200
|
-
_relayTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(options) {
|
4201
|
-
var signer, _yield$createSignedRe, relayData, relayRequest, signedRelayRequest, defaultGasLimit, defaultMaxAcceptance, mergedRelayRequest, relayHub;
|
4202
|
-
|
4203
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
4204
|
-
while (1) {
|
4205
|
-
switch (_context.prev = _context.next) {
|
4206
|
-
case 0:
|
4207
|
-
signer = options.sendFunction.contract.signer;
|
4208
|
-
|
4209
|
-
if (signer && protocol.isTypedDataSigner(signer)) {
|
4210
|
-
_context.next = 3;
|
4211
|
-
break;
|
4212
|
-
}
|
4213
|
-
|
4214
|
-
throw new Error('Missing or invalid signer');
|
4215
|
-
|
4216
|
-
case 3:
|
4217
|
-
_context.next = 5;
|
4218
|
-
return protocol.createSignedRelayRequest(options);
|
4219
|
-
|
4220
|
-
case 5:
|
4221
|
-
_yield$createSignedRe = _context.sent;
|
4222
|
-
relayData = _yield$createSignedRe.relayData;
|
4223
|
-
relayRequest = _yield$createSignedRe.relayRequest;
|
4224
|
-
signedRelayRequest = _yield$createSignedRe.signedRelayRequest;
|
4225
|
-
// NOTE: In the real implementation, we fetch these from the relayer.
|
4226
|
-
defaultGasLimit = 12450000;
|
4227
|
-
defaultMaxAcceptance = ethers.BigNumber.from(150000); // NOTE: There is an inconsistency between how the typed data object shape and the relayCall argument.
|
4228
|
-
|
4229
|
-
mergedRelayRequest = {
|
4230
|
-
relayData: relayData,
|
4231
|
-
request: relayRequest
|
4232
|
-
};
|
4233
|
-
relayHub = new protocol.IGsnRelayHub(options.relayHub, provider.getSigner(options.relayWorker));
|
4234
|
-
return _context.abrupt("return", relayHub.relayCall.args(defaultMaxAcceptance, mergedRelayRequest, signedRelayRequest, '0x', defaultGasLimit).gas(defaultGasLimit, relayData.gasPrice).send());
|
4235
|
-
|
4236
|
-
case 14:
|
4237
|
-
case "end":
|
4238
|
-
return _context.stop();
|
4239
|
-
}
|
4240
|
-
}
|
4241
|
-
}, _callee);
|
4242
|
-
}));
|
4243
|
-
return _relayTransaction.apply(this, arguments);
|
4244
|
-
}
|
4245
|
-
|
4246
|
-
var relayed = ethers.utils.EventFragment.fromString('TransactionRelayed(address indexed relayManager, address indexed relayWorker, address indexed from, address to, address paymaster, bytes4 selector, uint8 status, uint256 charge)');
|
4247
|
-
var rejected = ethers.utils.EventFragment.fromString('TransactionRejectedByPaymaster(address indexed relayManager, address indexed paymaster, address indexed from, address to, address relayWorker, bytes4 selector, uint256 innerGasUsed, bytes reason)');
|
4248
|
-
function assertDidRelay(receipt) {
|
4249
|
-
return assertEvent(receipt, relayed, {
|
4250
|
-
charge: expect.anything(),
|
4251
|
-
from: expect.any(String),
|
4252
|
-
paymaster: expect.any(String),
|
4253
|
-
relayManager: expect.any(String),
|
4254
|
-
relayWorker: expect.any(String),
|
4255
|
-
selector: expect.any(String),
|
4256
|
-
status: expect.anything(),
|
4257
|
-
to: expect.any(String)
|
4258
|
-
});
|
4259
|
-
}
|
4260
|
-
function assertDidRelaySuccessfully(receipt) {
|
4261
|
-
var result = assertDidRelay(receipt);
|
4262
|
-
expect(result.status).toEqBigNumber(0);
|
4263
|
-
}
|
4264
|
-
function assertDidRelayWithError(receipt) {
|
4265
|
-
var result = assertDidRelay(receipt);
|
4266
|
-
expect(result.status).toEqBigNumber(1);
|
4267
|
-
}
|
4268
|
-
function assertDidRelayWithCharge(receipt, amount, tolerance) {
|
4269
|
-
var result = assertDidRelay(receipt);
|
4270
|
-
expect(result.charge).toBeAroundBigNumber(amount, tolerance);
|
4271
|
-
}
|
4272
|
-
function assertPaymasterDidReject(receipt) {
|
4273
|
-
return assertEvent(receipt, rejected, {
|
4274
|
-
from: expect.any(String),
|
4275
|
-
innerGasUsed: expect.anything(),
|
4276
|
-
paymaster: expect.any(String),
|
4277
|
-
reason: expect.any(String),
|
4278
|
-
relayManager: expect.any(String),
|
4279
|
-
relayWorker: expect.any(String),
|
4280
|
-
selector: expect.any(String),
|
4281
|
-
to: expect.any(String)
|
4282
|
-
});
|
4283
|
-
}
|
4284
|
-
function assertPaymasterDidRejectForReason(receipt, reason) {
|
4285
|
-
var params = assertPaymasterDidReject(receipt);
|
4286
|
-
expect(ethers.utils.toUtf8String('0x' + params.reason.substr(138))).toMatch(reason);
|
4287
|
-
}
|
4288
|
-
|
4289
|
-
exports.CurveLiquidityGaugeV2 = CurveLiquidityGaugeV2;
|
4290
|
-
exports.CurveMinter = CurveMinter;
|
4291
|
-
exports.CurveRegistry = CurveRegistry;
|
4292
|
-
exports.CurveSwaps = CurveSwaps;
|
4293
|
-
exports.ICompoundComptroller = ICompoundComptroller;
|
4294
|
-
exports.IUniswapV3NonFungibleTokenManager = IUniswapV3NonFungibleTokenManager;
|
4295
|
-
exports.UniswapV2Factory = UniswapV2Factory;
|
4296
|
-
exports.aaveLend = aaveLend;
|
4297
|
-
exports.aaveRedeem = aaveRedeem;
|
4298
|
-
exports.addNewAssetsToFund = addNewAssetsToFund;
|
4299
|
-
exports.addTrackedAssetsToVault = addTrackedAssetsToVault;
|
4300
|
-
exports.assertCompoundLend = assertCompoundLend;
|
4301
|
-
exports.assertCompoundRedeem = assertCompoundRedeem;
|
4302
|
-
exports.assertDidRelay = assertDidRelay;
|
4303
|
-
exports.assertDidRelaySuccessfully = assertDidRelaySuccessfully;
|
4304
|
-
exports.assertDidRelayWithCharge = assertDidRelayWithCharge;
|
4305
|
-
exports.assertDidRelayWithError = assertDidRelayWithError;
|
4306
|
-
exports.assertEvent = assertEvent;
|
4307
|
-
exports.assertNoEvent = assertNoEvent;
|
4308
|
-
exports.assertPaymasterDidReject = assertPaymasterDidReject;
|
4309
|
-
exports.assertPaymasterDidRejectForReason = assertPaymasterDidRejectForReason;
|
4310
|
-
exports.buyShares = buyShares;
|
4311
|
-
exports.buySharesFunction = buySharesFunction;
|
4312
|
-
exports.calcMlnValueAndBurnAmountForSharesBuyback = calcMlnValueAndBurnAmountForSharesBuyback;
|
4313
|
-
exports.callOnExtension = callOnExtension;
|
4314
|
-
exports.callOnExternalPosition = callOnExternalPosition;
|
4315
|
-
exports.compoundClaim = compoundClaim;
|
4316
|
-
exports.compoundDebtPositionAddCollateral = compoundDebtPositionAddCollateral;
|
4317
|
-
exports.compoundDebtPositionBorrow = compoundDebtPositionBorrow;
|
4318
|
-
exports.compoundDebtPositionClaimComp = compoundDebtPositionClaimComp;
|
4319
|
-
exports.compoundDebtPositionRemoveCollateral = compoundDebtPositionRemoveCollateral;
|
4320
|
-
exports.compoundDebtPositionRepayBorrow = compoundDebtPositionRepayBorrow;
|
4321
|
-
exports.compoundLend = compoundLend;
|
4322
|
-
exports.compoundRedeem = compoundRedeem;
|
4323
|
-
exports.createCompoundDebtPosition = createCompoundDebtPosition;
|
4324
|
-
exports.createComptrollerProxy = createComptrollerProxy;
|
4325
|
-
exports.createExternalPosition = createExternalPosition;
|
4326
|
-
exports.createFundDeployer = createFundDeployer;
|
4327
|
-
exports.createMigrationRequest = createMigrationRequest;
|
4328
|
-
exports.createMockExternalPosition = createMockExternalPosition;
|
4329
|
-
exports.createNewFund = createNewFund;
|
4330
|
-
exports.createReconfigurationRequest = createReconfigurationRequest;
|
4331
|
-
exports.createUniswapV3LiquidityPosition = createUniswapV3LiquidityPosition;
|
4332
|
-
exports.createVaultProxy = createVaultProxy;
|
4333
|
-
exports.curveAaveClaimRewards = curveAaveClaimRewards;
|
4334
|
-
exports.curveAaveLend = curveAaveLend;
|
4335
|
-
exports.curveAaveLendAndStake = curveAaveLendAndStake;
|
4336
|
-
exports.curveAaveRedeem = curveAaveRedeem;
|
4337
|
-
exports.curveAaveStake = curveAaveStake;
|
4338
|
-
exports.curveAaveUnstake = curveAaveUnstake;
|
4339
|
-
exports.curveAaveUnstakeAndRedeem = curveAaveUnstakeAndRedeem;
|
4340
|
-
exports.curveClaimRewards = curveClaimRewards;
|
4341
|
-
exports.curveLend = curveLend;
|
4342
|
-
exports.curveLendAndStake = curveLendAndStake;
|
4343
|
-
exports.curveRedeem = curveRedeem;
|
4344
|
-
exports.curveSethClaimRewards = curveSethClaimRewards;
|
4345
|
-
exports.curveSethLend = curveSethLend;
|
4346
|
-
exports.curveSethLendAndStake = curveSethLendAndStake;
|
4347
|
-
exports.curveSethRedeem = curveSethRedeem;
|
4348
|
-
exports.curveSethStake = curveSethStake;
|
4349
|
-
exports.curveSethUnstake = curveSethUnstake;
|
4350
|
-
exports.curveSethUnstakeAndRedeem = curveSethUnstakeAndRedeem;
|
4351
|
-
exports.curveStake = curveStake;
|
4352
|
-
exports.curveStethClaimRewards = curveStethClaimRewards;
|
4353
|
-
exports.curveStethLend = curveStethLend;
|
4354
|
-
exports.curveStethLendAndStake = curveStethLendAndStake;
|
4355
|
-
exports.curveStethRedeem = curveStethRedeem;
|
4356
|
-
exports.curveStethStake = curveStethStake;
|
4357
|
-
exports.curveStethUnstake = curveStethUnstake;
|
4358
|
-
exports.curveStethUnstakeAndRedeem = curveStethUnstakeAndRedeem;
|
4359
|
-
exports.curveTakeOrder = curveTakeOrder;
|
4360
|
-
exports.curveUnstake = curveUnstake;
|
4361
|
-
exports.curveUnstakeAndRedeem = curveUnstakeAndRedeem;
|
4362
|
-
exports.deployProtocolFixture = deployProtocolFixture;
|
4363
|
-
exports.generateFeeManagerConfigWithMockFees = generateFeeManagerConfigWithMockFees;
|
4364
|
-
exports.generateMockFees = generateMockFees;
|
4365
|
-
exports.generateMockPolicies = generateMockPolicies;
|
4366
|
-
exports.generatePolicyManagerConfigWithMockPolicies = generatePolicyManagerConfigWithMockPolicies;
|
4367
|
-
exports.getAssetBalances = getAssetBalances;
|
4368
|
-
exports.getAssetUnit = getAssetUnit;
|
4369
|
-
exports.getNamedSigner = getNamedSigner;
|
4370
|
-
exports.getUnnamedSigners = getUnnamedSigners;
|
4371
|
-
exports.idleClaimRewards = idleClaimRewards;
|
4372
|
-
exports.idleLend = idleLend;
|
4373
|
-
exports.idleRedeem = idleRedeem;
|
4374
|
-
exports.mockExternalPositionAddDebtAssets = mockExternalPositionAddDebtAssets;
|
4375
|
-
exports.mockExternalPositionAddManagedAssets = mockExternalPositionAddManagedAssets;
|
4376
|
-
exports.mockExternalPositionRemoveDebtAssets = mockExternalPositionRemoveDebtAssets;
|
4377
|
-
exports.mockExternalPositionRemoveManagedAssets = mockExternalPositionRemoveManagedAssets;
|
4378
|
-
exports.mockGenericRemoveOnlySelector = mockGenericRemoveOnlySelector;
|
4379
|
-
exports.mockGenericSwap = mockGenericSwap;
|
4380
|
-
exports.mockGenericSwapASelector = mockGenericSwapASelector;
|
4381
|
-
exports.mockGenericSwapArgs = mockGenericSwapArgs;
|
4382
|
-
exports.mockGenericSwapBSelector = mockGenericSwapBSelector;
|
4383
|
-
exports.mockGenericSwapDirectFromVaultSelector = mockGenericSwapDirectFromVaultSelector;
|
4384
|
-
exports.mockGenericSwapViaApprovalSelector = mockGenericSwapViaApprovalSelector;
|
4385
|
-
exports.olympusV2Stake = olympusV2Stake;
|
4386
|
-
exports.olympusV2Unstake = olympusV2Unstake;
|
4387
|
-
exports.paraSwapV4GenerateDummyPaths = paraSwapV4GenerateDummyPaths;
|
4388
|
-
exports.paraSwapV4TakeOrder = paraSwapV4TakeOrder;
|
4389
|
-
exports.paraSwapV5GenerateDummyPaths = paraSwapV5GenerateDummyPaths;
|
4390
|
-
exports.paraSwapV5TakeOrder = paraSwapV5TakeOrder;
|
4391
|
-
exports.poolTogetherV4ClaimRewards = poolTogetherV4ClaimRewards;
|
4392
|
-
exports.poolTogetherV4Lend = poolTogetherV4Lend;
|
4393
|
-
exports.poolTogetherV4Redeem = poolTogetherV4Redeem;
|
4394
|
-
exports.reactivateExternalPosition = reactivateExternalPosition;
|
4395
|
-
exports.redeemSharesForSpecificAssets = redeemSharesForSpecificAssets;
|
4396
|
-
exports.redeemSharesInKind = redeemSharesInKind;
|
4397
|
-
exports.relayTransaction = relayTransaction;
|
4398
|
-
exports.removeExternalPosition = removeExternalPosition;
|
4399
|
-
exports.removeTrackedAssetsFromVault = removeTrackedAssetsFromVault;
|
4400
|
-
exports.setupGasRelayerPaymaster = setupGasRelayerPaymaster;
|
4401
|
-
exports.synthetixAssignExchangeDelegate = synthetixAssignExchangeDelegate;
|
4402
|
-
exports.synthetixRedeem = synthetixRedeem;
|
4403
|
-
exports.synthetixTakeOrder = synthetixTakeOrder;
|
4404
|
-
exports.transactionTimestamp = transactionTimestamp;
|
4405
|
-
exports.uniswapV2Lend = uniswapV2Lend;
|
4406
|
-
exports.uniswapV2Redeem = uniswapV2Redeem;
|
4407
|
-
exports.uniswapV2TakeOrder = uniswapV2TakeOrder;
|
4408
|
-
exports.uniswapV3LiquidityPositionAddLiquidity = uniswapV3LiquidityPositionAddLiquidity;
|
4409
|
-
exports.uniswapV3LiquidityPositionCollect = uniswapV3LiquidityPositionCollect;
|
4410
|
-
exports.uniswapV3LiquidityPositionGetMaxTick = uniswapV3LiquidityPositionGetMaxTick;
|
4411
|
-
exports.uniswapV3LiquidityPositionGetMinTick = uniswapV3LiquidityPositionGetMinTick;
|
4412
|
-
exports.uniswapV3LiquidityPositionMint = uniswapV3LiquidityPositionMint;
|
4413
|
-
exports.uniswapV3LiquidityPositionPurge = uniswapV3LiquidityPositionPurge;
|
4414
|
-
exports.uniswapV3LiquidityPositionRemoveLiquidity = uniswapV3LiquidityPositionRemoveLiquidity;
|
4415
|
-
exports.uniswapV3OrderTokenPair = uniswapV3OrderTokenPair;
|
4416
|
-
exports.uniswapV3TakeOrder = uniswapV3TakeOrder;
|
4417
|
-
exports.unlockAllWhales = unlockAllWhales;
|
4418
|
-
exports.unlockWhale = unlockWhale;
|
4419
|
-
exports.unlockWhales = unlockWhales;
|
4420
|
-
exports.updateChainlinkAggregator = updateChainlinkAggregator;
|
4421
|
-
exports.vaultCallCreateNewList = vaultCallCreateNewList;
|
4422
|
-
exports.vaultCallCurveMinterMint = vaultCallCurveMinterMint;
|
4423
|
-
exports.vaultCallCurveMinterMintMany = vaultCallCurveMinterMintMany;
|
4424
|
-
exports.vaultCallCurveMinterToggleApproveMint = vaultCallCurveMinterToggleApproveMint;
|
4425
|
-
exports.vaultCallStartAssetBypassTimelock = vaultCallStartAssetBypassTimelock;
|
4426
|
-
exports.yearnVaultV2Lend = yearnVaultV2Lend;
|
4427
|
-
exports.yearnVaultV2Redeem = yearnVaultV2Redeem;
|
4428
|
-
exports.zeroExV2TakeOrder = zeroExV2TakeOrder;
|