@venusprotocol/protocol-reserve 1.0.0-dev.3 → 1.0.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +1 -1
  2. package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
  3. package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
  4. package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
  5. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  6. package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +1 -1
  7. package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  8. package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  9. package/artifacts/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol/ReentrancyGuardUpgradeable.dbg.json +4 -0
  10. package/artifacts/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol/ReentrancyGuardUpgradeable.json +24 -0
  11. package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
  12. package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable.dbg.json +1 -1
  13. package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol/SafeERC20Upgradeable.dbg.json +1 -1
  14. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  15. package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  16. package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +1 -1
  17. package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +1 -1
  18. package/artifacts/@venusprotocol/isolated-pools/contracts/MaxLoopsLimitHelper.sol/MaxLoopsLimitHelper.dbg.json +4 -0
  19. package/artifacts/@venusprotocol/isolated-pools/contracts/MaxLoopsLimitHelper.sol/MaxLoopsLimitHelper.json +59 -0
  20. package/artifacts/build-info/5cf1d710d672d6156aed4b51f9ea6217.json +1 -0
  21. package/artifacts/contracts/Interfaces/ComptrollerInterface.sol/ComptrollerInterface.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces/IIncomeDestination.sol/IIncomeDestination.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces/IPrime.sol/IPrime.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces/IPrime.sol/IPrime.json +1 -1
  25. package/artifacts/contracts/Interfaces/IProtocolShareReserve.sol/IProtocolShareReserve.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces/IVToken.sol/IVToken.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces/PoolRegistryInterface.sol/PoolRegistryInterface.dbg.json +1 -1
  28. package/artifacts/contracts/ProtocolReserve/ProtocolShareReserve.sol/ProtocolShareReserve.dbg.json +1 -1
  29. package/artifacts/contracts/ProtocolReserve/ProtocolShareReserve.sol/ProtocolShareReserve.json +55 -2
  30. package/artifacts/contracts/Test/Mocks/MockToken.sol/MockToken.dbg.json +1 -1
  31. package/contracts/Interfaces/IPrime.sol +1 -1
  32. package/contracts/ProtocolReserve/ProtocolShareReserve.sol +107 -39
  33. package/package.json +4 -1
  34. package/typechain/@openzeppelin/contracts-upgradeable/index.ts +3 -0
  35. package/typechain/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.ts +72 -0
  36. package/typechain/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
  37. package/typechain/@venusprotocol/index.ts +3 -0
  38. package/typechain/@venusprotocol/isolated-pools/contracts/MaxLoopsLimitHelper.ts +119 -0
  39. package/typechain/@venusprotocol/isolated-pools/contracts/index.ts +4 -0
  40. package/typechain/@venusprotocol/isolated-pools/index.ts +8 -0
  41. package/typechain/contracts/Interfaces/IPrime.ts +12 -9
  42. package/typechain/contracts/ProtocolReserve/ProtocolShareReserve.ts +50 -2
  43. package/typechain/factories/@openzeppelin/contracts-upgradeable/index.ts +1 -0
  44. package/typechain/factories/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable__factory.ts +44 -0
  45. package/typechain/factories/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
  46. package/typechain/factories/@venusprotocol/index.ts +1 -0
  47. package/typechain/factories/@venusprotocol/isolated-pools/contracts/MaxLoopsLimitHelper__factory.ts +75 -0
  48. package/typechain/factories/@venusprotocol/isolated-pools/contracts/index.ts +4 -0
  49. package/typechain/factories/@venusprotocol/isolated-pools/index.ts +4 -0
  50. package/typechain/factories/contracts/Interfaces/IPrime__factory.ts +1 -1
  51. package/typechain/factories/contracts/ProtocolReserve/ProtocolShareReserve__factory.ts +54 -1
  52. package/typechain/hardhat.d.ts +18 -0
  53. package/typechain/index.ts +4 -0
  54. package/artifacts/build-info/3320cd7a54f60491d1bcaf9577bfbaa8.json +0 -1
@@ -3,6 +3,8 @@ pragma solidity 0.8.13;
3
3
 
4
4
  import { SafeERC20Upgradeable, IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
5
5
  import { AccessControlledV8 } from "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol";
6
+ import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
7
+ import { MaxLoopsLimitHelper } from "@venusprotocol/isolated-pools/contracts/MaxLoopsLimitHelper.sol";
6
8
 
7
9
  import { IProtocolShareReserve } from "../Interfaces/IProtocolShareReserve.sol";
8
10
  import { ComptrollerInterface } from "../Interfaces/ComptrollerInterface.sol";
@@ -14,13 +16,19 @@ import { IIncomeDestination } from "../Interfaces/IIncomeDestination.sol";
14
16
  error InvalidAddress();
15
17
  error UnsupportedAsset();
16
18
  error InvalidTotalPercentage();
17
-
18
- contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
19
+ error InvalidMaxLoopsLimit();
20
+
21
+ contract ProtocolShareReserve is
22
+ AccessControlledV8,
23
+ ReentrancyGuardUpgradeable,
24
+ MaxLoopsLimitHelper,
25
+ IProtocolShareReserve
26
+ {
19
27
  using SafeERC20Upgradeable for IERC20Upgradeable;
20
28
 
21
29
  /// @notice protocol income is categorized into two schemas.
22
- /// The first schema is for spread income from prime markets in core protocol
23
- /// The second schema is for all other sources and types of income
30
+ /// The first schema is the default one
31
+ /// The second schema is for spread income from prime markets in core protocol
24
32
  enum Schema {
25
33
  DEFAULT,
26
34
  SPREAD_PRIME_CORE
@@ -124,85 +132,98 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
124
132
  /**
125
133
  * @dev Initializes the deployer to owner.
126
134
  * @param _accessControlManager The address of ACM contract
135
+ * @param _loopsLimit Limit for the loops in the contract to avoid DOS
127
136
  */
128
- function initialize(address _accessControlManager) external initializer {
137
+ function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {
129
138
  __AccessControlled_init(_accessControlManager);
139
+ __ReentrancyGuard_init();
140
+ _setMaxLoopsLimit(_loopsLimit);
130
141
  }
131
142
 
132
143
  /**
133
144
  * @dev Pool registry setter.
134
145
  * @param _poolRegistry Address of the pool registry
135
146
  */
136
- function setPoolRegistry(address _poolRegistry) external {
137
- _checkAccessAllowed("setPoolRegistry(address)");
147
+ function setPoolRegistry(address _poolRegistry) external onlyOwner {
138
148
  if (_poolRegistry == address(0)) revert InvalidAddress();
139
- address oldPoolRegistry = poolRegistry;
149
+ emit PoolRegistryUpdated(poolRegistry, _poolRegistry);
140
150
  poolRegistry = _poolRegistry;
141
- emit PoolRegistryUpdated(oldPoolRegistry, poolRegistry);
142
151
  }
143
152
 
144
153
  /**
145
154
  * @dev Prime contract address setter.
146
155
  * @param _prime Address of the prime contract
147
156
  */
148
- function setPrime(address _prime) external {
149
- _checkAccessAllowed("setPrime(address)");
157
+ function setPrime(address _prime) external onlyOwner {
150
158
  if (_prime == address(0)) revert InvalidAddress();
151
- address oldPrime = prime;
159
+ emit PrimeUpdated(prime, _prime);
152
160
  prime = _prime;
153
- emit PrimeUpdated(oldPrime, prime);
154
161
  }
155
162
 
156
163
  /**
157
164
  * @dev Add or update destination targets based on destination address
158
165
  * @param configs configurations of the destinations.
159
166
  */
160
- function addOrUpdateDistributionConfigs(DistributionConfig[] memory configs) external {
161
- _checkAccessAllowed("addOrUpdateDistributionConfigs(DistributionConfig)");
167
+ function addOrUpdateDistributionConfigs(DistributionConfig[] memory configs) external nonReentrant {
168
+ _checkAccessAllowed("addOrUpdateDistributionConfigs(DistributionConfig[])");
162
169
 
163
170
  //we need to accrue and release funds to prime before updating the distribution configuration
164
171
  //because prime relies on getUnreleasedFunds and its return value may change after config update
165
172
  _accrueAndReleaseFundsToPrime();
166
173
 
167
- for (uint i = 0; i < configs.length; ++i) {
174
+ for (uint256 i = 0; i < configs.length; ) {
168
175
  DistributionConfig memory _config = configs[i];
169
176
  require(_config.destination != address(0), "ProtocolShareReserve: Destination address invalid");
170
177
 
171
178
  bool updated = false;
172
- for (uint j = 0; j < distributionTargets.length; ++j) {
179
+ for (uint256 j = 0; j < distributionTargets.length; ) {
173
180
  DistributionConfig storage config = distributionTargets[j];
174
181
 
175
182
  if (_config.schema == config.schema && config.destination == _config.destination) {
176
183
  emit DistributionConfigUpdated(
177
- config.destination,
184
+ _config.destination,
178
185
  config.percentage,
179
186
  _config.percentage,
180
- config.schema
187
+ _config.schema
181
188
  );
182
189
  config.percentage = _config.percentage;
183
190
  updated = true;
184
191
  break;
185
192
  }
193
+
194
+ unchecked {
195
+ ++j;
196
+ }
186
197
  }
187
198
 
188
199
  if (!updated) {
189
200
  distributionTargets.push(_config);
190
201
  emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);
191
202
  }
203
+
204
+ unchecked {
205
+ ++i;
206
+ }
192
207
  }
193
208
 
194
209
  _ensurePercentages();
210
+ _ensureMaxLoops(distributionTargets.length);
195
211
  }
196
212
 
197
213
  /**
198
214
  * @dev Release funds
215
+ * @param comptroller the comptroller address of the pool
199
216
  * @param assets assets to be released to distribution targets
200
217
  */
201
- function releaseFunds(address comptroller, address[] memory assets) external {
218
+ function releaseFunds(address comptroller, address[] memory assets) external nonReentrant {
202
219
  _accruePrimeInterest();
203
220
 
204
- for (uint i = 0; i < assets.length; ++i) {
221
+ for (uint256 i = 0; i < assets.length; ) {
205
222
  _releaseFund(comptroller, assets[i]);
223
+
224
+ unchecked {
225
+ ++i;
226
+ }
206
227
  }
207
228
  }
208
229
 
@@ -219,12 +240,16 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
219
240
  address destination,
220
241
  address asset
221
242
  ) external view returns (uint256) {
222
- for (uint i = 0; i < distributionTargets.length; ++i) {
243
+ for (uint256 i = 0; i < distributionTargets.length; ) {
223
244
  DistributionConfig storage _config = distributionTargets[i];
224
245
  if (_config.schema == schema && _config.destination == destination) {
225
246
  uint256 total = assetsReserves[comptroller][asset][schema];
226
247
  return (total * _config.percentage) / MAX_PERCENT;
227
248
  }
249
+
250
+ unchecked {
251
+ ++i;
252
+ }
228
253
  }
229
254
  }
230
255
 
@@ -239,12 +264,13 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
239
264
  * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.
240
265
  * @param comptroller Comptroller address(pool)
241
266
  * @param asset Asset address.
267
+ * @param incomeType type of income
242
268
  */
243
269
  function updateAssetsState(
244
270
  address comptroller,
245
271
  address asset,
246
272
  IncomeType incomeType
247
- ) public override(IProtocolShareReserve) {
273
+ ) public override(IProtocolShareReserve) nonReentrant {
248
274
  if (!ComptrollerInterface(comptroller).isComptroller()) revert InvalidAddress();
249
275
  if (asset == address(0)) revert InvalidAddress();
250
276
  if (
@@ -273,11 +299,15 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
273
299
  * releases the funds to prime for each market
274
300
  */
275
301
  function _accrueAndReleaseFundsToPrime() internal {
276
- address[] memory markets = IPrime(prime).allMarkets();
277
- for (uint i = 0; i < markets.length; ++i) {
302
+ address[] memory markets = IPrime(prime).getAllMarkets();
303
+ for (uint256 i = 0; i < markets.length; ) {
278
304
  address market = markets[i];
279
305
  IPrime(prime).accrueInterest(market);
280
306
  _releaseFund(CORE_POOL_COMPTROLLER, _getUnderlying(market));
307
+
308
+ unchecked {
309
+ ++i;
310
+ }
281
311
  }
282
312
  }
283
313
 
@@ -286,30 +316,41 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
286
316
  * to prime for each market
287
317
  */
288
318
  function _accruePrimeInterest() internal {
289
- address[] memory markets = IPrime(prime).allMarkets();
290
- for (uint i = 0; i < markets.length; ++i) {
319
+ address[] memory markets = IPrime(prime).getAllMarkets();
320
+ for (uint256 i = 0; i < markets.length; ) {
291
321
  address market = markets[i];
292
322
  IPrime(prime).accrueInterest(market);
323
+
324
+ unchecked {
325
+ ++i;
326
+ }
293
327
  }
294
328
  }
295
329
 
330
+ /**
331
+ * @dev asset from a particular pool to be release to distribution targets
332
+ * @param comptroller Comptroller address(pool)
333
+ * @param asset Asset address.
334
+ */
296
335
  function _releaseFund(address comptroller, address asset) internal {
297
336
  uint256 totalSchemas = uint256(type(Schema).max) + 1;
298
- uint[] memory schemaBalances = new uint[](totalSchemas);
337
+ uint256[] memory schemaBalances = new uint256[](totalSchemas);
299
338
  uint256 totalBalance;
300
-
301
- for (uint schemaValue; schemaValue < totalSchemas; ++schemaValue) {
339
+ for (uint256 schemaValue; schemaValue < totalSchemas; ) {
302
340
  schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];
303
341
  totalBalance += schemaBalances[schemaValue];
342
+
343
+ unchecked {
344
+ ++schemaValue;
345
+ }
304
346
  }
305
347
 
306
348
  if (totalBalance == 0) {
307
349
  return;
308
350
  }
309
351
 
310
- uint[] memory totalTransferAmounts = new uint[](totalSchemas);
311
-
312
- for (uint i = 0; i < distributionTargets.length; ++i) {
352
+ uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);
353
+ for (uint256 i = 0; i < distributionTargets.length; ) {
313
354
  DistributionConfig memory _config = distributionTargets[i];
314
355
 
315
356
  uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;
@@ -319,10 +360,14 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
319
360
  IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);
320
361
 
321
362
  emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);
363
+
364
+ unchecked {
365
+ ++i;
366
+ }
322
367
  }
323
368
 
324
- uint[] memory newSchemaBalances = new uint[](totalSchemas);
325
- for (uint schemaValue = 0; schemaValue < totalSchemas; ++schemaValue) {
369
+ uint256[] memory newSchemaBalances = new uint256[](totalSchemas);
370
+ for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {
326
371
  newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];
327
372
  assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];
328
373
  totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];
@@ -334,9 +379,20 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
334
379
  schemaBalances[schemaValue],
335
380
  newSchemaBalances[schemaValue]
336
381
  );
382
+
383
+ unchecked {
384
+ ++schemaValue;
385
+ }
337
386
  }
338
387
  }
339
388
 
389
+ /**
390
+ * @dev Returns the schema based on comptroller, asset and income type
391
+ * @param comptroller Comptroller address(pool)
392
+ * @param asset Asset address.
393
+ * @param incomeType type of income
394
+ * @return schema schema for distribution
395
+ */
340
396
  function getSchema(
341
397
  address comptroller,
342
398
  address asset,
@@ -352,19 +408,31 @@ contract ProtocolShareReserve is AccessControlledV8, IProtocolShareReserve {
352
408
 
353
409
  function _ensurePercentages() internal view {
354
410
  uint256 totalSchemas = uint256(type(Schema).max) + 1;
355
- uint[] memory totalPercentages = new uint[](totalSchemas);
411
+ uint256[] memory totalPercentages = new uint256[](totalSchemas);
356
412
 
357
- for (uint i = 0; i < distributionTargets.length; ++i) {
413
+ for (uint256 i = 0; i < distributionTargets.length; ) {
358
414
  DistributionConfig memory config = distributionTargets[i];
359
415
  totalPercentages[uint256(config.schema)] += config.percentage;
360
- }
361
416
 
362
- for (uint schemaValue = 0; schemaValue <= totalSchemas - 1; ++schemaValue) {
417
+ unchecked {
418
+ ++i;
419
+ }
420
+ }
421
+ for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {
363
422
  if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)
364
423
  revert InvalidTotalPercentage();
424
+
425
+ unchecked {
426
+ ++schemaValue;
427
+ }
365
428
  }
366
429
  }
367
430
 
431
+ /**
432
+ * @dev Returns the underlying asset address for the vToken
433
+ * @param vToken vToken address
434
+ * @return asset address of asset
435
+ */
368
436
  function _getUnderlying(address vToken) internal view returns (address) {
369
437
  if (vToken == vBNB) {
370
438
  return WBNB;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@venusprotocol/protocol-reserve",
3
3
  "description": "",
4
- "version": "1.0.0-dev.3",
4
+ "version": "1.0.0-dev.5",
5
5
  "author": "",
6
6
  "engines": {
7
7
  "node": ">=18.0.0"
@@ -109,5 +109,8 @@
109
109
  "tsconfig-paths": "^4.1.2",
110
110
  "typechain": "^8.1.1",
111
111
  "typescript": "^4.9.3"
112
+ },
113
+ "dependencies": {
114
+ "@venusprotocol/isolated-pools": "^1.3.0"
112
115
  }
113
116
  }
@@ -5,6 +5,7 @@
5
5
  /* eslint-disable */
6
6
  import type * as access from "./access";
7
7
  import type * as proxy from "./proxy";
8
+ import type * as security from "./security";
8
9
  import type * as token from "./token";
9
10
  import type * as utils from "./utils";
10
11
 
@@ -12,6 +13,8 @@ export type { access };
12
13
 
13
14
  export type { proxy };
14
15
 
16
+ export type { security };
17
+
15
18
  export type { token };
16
19
 
17
20
  export type { utils };
@@ -0,0 +1,72 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+
3
+ /* tslint:disable */
4
+
5
+ /* eslint-disable */
6
+ import type {
7
+ TypedEventFilter,
8
+ TypedEvent,
9
+ TypedListener,
10
+ OnEvent,
11
+ PromiseOrValue,
12
+ } from "../../../common";
13
+ import type { EventFragment } from "@ethersproject/abi";
14
+ import type { Listener, Provider } from "@ethersproject/providers";
15
+ import type { BaseContract, Signer, utils } from "ethers";
16
+
17
+ export interface ReentrancyGuardUpgradeableInterface extends utils.Interface {
18
+ functions: {};
19
+
20
+ events: {
21
+ "Initialized(uint8)": EventFragment;
22
+ };
23
+
24
+ getEvent(nameOrSignatureOrTopic: "Initialized"): EventFragment;
25
+ }
26
+
27
+ export interface InitializedEventObject {
28
+ version: number;
29
+ }
30
+ export type InitializedEvent = TypedEvent<[number], InitializedEventObject>;
31
+
32
+ export type InitializedEventFilter = TypedEventFilter<InitializedEvent>;
33
+
34
+ export interface ReentrancyGuardUpgradeable extends BaseContract {
35
+ connect(signerOrProvider: Signer | Provider | string): this;
36
+ attach(addressOrName: string): this;
37
+ deployed(): Promise<this>;
38
+
39
+ interface: ReentrancyGuardUpgradeableInterface;
40
+
41
+ queryFilter<TEvent extends TypedEvent>(
42
+ event: TypedEventFilter<TEvent>,
43
+ fromBlockOrBlockhash?: string | number | undefined,
44
+ toBlock?: string | number | undefined
45
+ ): Promise<Array<TEvent>>;
46
+
47
+ listeners<TEvent extends TypedEvent>(
48
+ eventFilter?: TypedEventFilter<TEvent>
49
+ ): Array<TypedListener<TEvent>>;
50
+ listeners(eventName?: string): Array<Listener>;
51
+ removeAllListeners<TEvent extends TypedEvent>(
52
+ eventFilter: TypedEventFilter<TEvent>
53
+ ): this;
54
+ removeAllListeners(eventName?: string): this;
55
+ off: OnEvent<this>;
56
+ on: OnEvent<this>;
57
+ once: OnEvent<this>;
58
+ removeListener: OnEvent<this>;
59
+
60
+ functions: {};
61
+
62
+ callStatic: {};
63
+
64
+ filters: {
65
+ "Initialized(uint8)"(version?: null): InitializedEventFilter;
66
+ Initialized(version?: null): InitializedEventFilter;
67
+ };
68
+
69
+ estimateGas: {};
70
+
71
+ populateTransaction: {};
72
+ }
@@ -0,0 +1,4 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export type { ReentrancyGuardUpgradeable } from "./ReentrancyGuardUpgradeable";
@@ -4,5 +4,8 @@
4
4
 
5
5
  /* eslint-disable */
6
6
  import type * as governanceContracts from "./governance-contracts";
7
+ import type * as isolatedPools from "./isolated-pools";
7
8
 
8
9
  export type { governanceContracts };
10
+
11
+ export type { isolatedPools };
@@ -0,0 +1,119 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+
3
+ /* tslint:disable */
4
+
5
+ /* eslint-disable */
6
+ import type {
7
+ TypedEventFilter,
8
+ TypedEvent,
9
+ TypedListener,
10
+ OnEvent,
11
+ PromiseOrValue,
12
+ } from "../../../common";
13
+ import type {
14
+ FunctionFragment,
15
+ Result,
16
+ EventFragment,
17
+ } from "@ethersproject/abi";
18
+ import type { Listener, Provider } from "@ethersproject/providers";
19
+ import type {
20
+ BaseContract,
21
+ BigNumber,
22
+ BytesLike,
23
+ CallOverrides,
24
+ PopulatedTransaction,
25
+ Signer,
26
+ utils,
27
+ } from "ethers";
28
+
29
+ export interface MaxLoopsLimitHelperInterface extends utils.Interface {
30
+ functions: {
31
+ "maxLoopsLimit()": FunctionFragment;
32
+ };
33
+
34
+ getFunction(nameOrSignatureOrTopic: "maxLoopsLimit"): FunctionFragment;
35
+
36
+ encodeFunctionData(
37
+ functionFragment: "maxLoopsLimit",
38
+ values?: undefined
39
+ ): string;
40
+
41
+ decodeFunctionResult(
42
+ functionFragment: "maxLoopsLimit",
43
+ data: BytesLike
44
+ ): Result;
45
+
46
+ events: {
47
+ "MaxLoopsLimitUpdated(uint256,uint256)": EventFragment;
48
+ };
49
+
50
+ getEvent(nameOrSignatureOrTopic: "MaxLoopsLimitUpdated"): EventFragment;
51
+ }
52
+
53
+ export interface MaxLoopsLimitUpdatedEventObject {
54
+ oldMaxLoopsLimit: BigNumber;
55
+ newmaxLoopsLimit: BigNumber;
56
+ }
57
+ export type MaxLoopsLimitUpdatedEvent = TypedEvent<
58
+ [BigNumber, BigNumber],
59
+ MaxLoopsLimitUpdatedEventObject
60
+ >;
61
+
62
+ export type MaxLoopsLimitUpdatedEventFilter =
63
+ TypedEventFilter<MaxLoopsLimitUpdatedEvent>;
64
+
65
+ export interface MaxLoopsLimitHelper extends BaseContract {
66
+ connect(signerOrProvider: Signer | Provider | string): this;
67
+ attach(addressOrName: string): this;
68
+ deployed(): Promise<this>;
69
+
70
+ interface: MaxLoopsLimitHelperInterface;
71
+
72
+ queryFilter<TEvent extends TypedEvent>(
73
+ event: TypedEventFilter<TEvent>,
74
+ fromBlockOrBlockhash?: string | number | undefined,
75
+ toBlock?: string | number | undefined
76
+ ): Promise<Array<TEvent>>;
77
+
78
+ listeners<TEvent extends TypedEvent>(
79
+ eventFilter?: TypedEventFilter<TEvent>
80
+ ): Array<TypedListener<TEvent>>;
81
+ listeners(eventName?: string): Array<Listener>;
82
+ removeAllListeners<TEvent extends TypedEvent>(
83
+ eventFilter: TypedEventFilter<TEvent>
84
+ ): this;
85
+ removeAllListeners(eventName?: string): this;
86
+ off: OnEvent<this>;
87
+ on: OnEvent<this>;
88
+ once: OnEvent<this>;
89
+ removeListener: OnEvent<this>;
90
+
91
+ functions: {
92
+ maxLoopsLimit(overrides?: CallOverrides): Promise<[BigNumber]>;
93
+ };
94
+
95
+ maxLoopsLimit(overrides?: CallOverrides): Promise<BigNumber>;
96
+
97
+ callStatic: {
98
+ maxLoopsLimit(overrides?: CallOverrides): Promise<BigNumber>;
99
+ };
100
+
101
+ filters: {
102
+ "MaxLoopsLimitUpdated(uint256,uint256)"(
103
+ oldMaxLoopsLimit?: null,
104
+ newmaxLoopsLimit?: null
105
+ ): MaxLoopsLimitUpdatedEventFilter;
106
+ MaxLoopsLimitUpdated(
107
+ oldMaxLoopsLimit?: null,
108
+ newmaxLoopsLimit?: null
109
+ ): MaxLoopsLimitUpdatedEventFilter;
110
+ };
111
+
112
+ estimateGas: {
113
+ maxLoopsLimit(overrides?: CallOverrides): Promise<BigNumber>;
114
+ };
115
+
116
+ populateTransaction: {
117
+ maxLoopsLimit(overrides?: CallOverrides): Promise<PopulatedTransaction>;
118
+ };
119
+ }
@@ -0,0 +1,4 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export type { MaxLoopsLimitHelper } from "./MaxLoopsLimitHelper";
@@ -0,0 +1,8 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+
3
+ /* tslint:disable */
4
+
5
+ /* eslint-disable */
6
+ import type * as contracts from "./contracts";
7
+
8
+ export type { contracts };
@@ -27,7 +27,7 @@ import type {
27
27
  export interface IPrimeInterface extends utils.Interface {
28
28
  functions: {
29
29
  "accrueInterest(address)": FunctionFragment;
30
- "allMarkets()": FunctionFragment;
30
+ "getAllMarkets()": FunctionFragment;
31
31
  "updateAssetsState(address,address)": FunctionFragment;
32
32
  "vTokenForAsset(address)": FunctionFragment;
33
33
  };
@@ -35,7 +35,7 @@ export interface IPrimeInterface extends utils.Interface {
35
35
  getFunction(
36
36
  nameOrSignatureOrTopic:
37
37
  | "accrueInterest"
38
- | "allMarkets"
38
+ | "getAllMarkets"
39
39
  | "updateAssetsState"
40
40
  | "vTokenForAsset"
41
41
  ): FunctionFragment;
@@ -45,7 +45,7 @@ export interface IPrimeInterface extends utils.Interface {
45
45
  values: [PromiseOrValue<string>]
46
46
  ): string;
47
47
  encodeFunctionData(
48
- functionFragment: "allMarkets",
48
+ functionFragment: "getAllMarkets",
49
49
  values?: undefined
50
50
  ): string;
51
51
  encodeFunctionData(
@@ -61,7 +61,10 @@ export interface IPrimeInterface extends utils.Interface {
61
61
  functionFragment: "accrueInterest",
62
62
  data: BytesLike
63
63
  ): Result;
64
- decodeFunctionResult(functionFragment: "allMarkets", data: BytesLike): Result;
64
+ decodeFunctionResult(
65
+ functionFragment: "getAllMarkets",
66
+ data: BytesLike
67
+ ): Result;
65
68
  decodeFunctionResult(
66
69
  functionFragment: "updateAssetsState",
67
70
  data: BytesLike
@@ -106,7 +109,7 @@ export interface IPrime extends BaseContract {
106
109
  overrides?: Overrides & { from?: PromiseOrValue<string> }
107
110
  ): Promise<ContractTransaction>;
108
111
 
109
- allMarkets(overrides?: CallOverrides): Promise<[string[]]>;
112
+ getAllMarkets(overrides?: CallOverrides): Promise<[string[]]>;
110
113
 
111
114
  updateAssetsState(
112
115
  comptroller: PromiseOrValue<string>,
@@ -125,7 +128,7 @@ export interface IPrime extends BaseContract {
125
128
  overrides?: Overrides & { from?: PromiseOrValue<string> }
126
129
  ): Promise<ContractTransaction>;
127
130
 
128
- allMarkets(overrides?: CallOverrides): Promise<string[]>;
131
+ getAllMarkets(overrides?: CallOverrides): Promise<string[]>;
129
132
 
130
133
  updateAssetsState(
131
134
  comptroller: PromiseOrValue<string>,
@@ -144,7 +147,7 @@ export interface IPrime extends BaseContract {
144
147
  overrides?: CallOverrides
145
148
  ): Promise<void>;
146
149
 
147
- allMarkets(overrides?: CallOverrides): Promise<string[]>;
150
+ getAllMarkets(overrides?: CallOverrides): Promise<string[]>;
148
151
 
149
152
  updateAssetsState(
150
153
  comptroller: PromiseOrValue<string>,
@@ -166,7 +169,7 @@ export interface IPrime extends BaseContract {
166
169
  overrides?: Overrides & { from?: PromiseOrValue<string> }
167
170
  ): Promise<BigNumber>;
168
171
 
169
- allMarkets(overrides?: CallOverrides): Promise<BigNumber>;
172
+ getAllMarkets(overrides?: CallOverrides): Promise<BigNumber>;
170
173
 
171
174
  updateAssetsState(
172
175
  comptroller: PromiseOrValue<string>,
@@ -186,7 +189,7 @@ export interface IPrime extends BaseContract {
186
189
  overrides?: Overrides & { from?: PromiseOrValue<string> }
187
190
  ): Promise<PopulatedTransaction>;
188
191
 
189
- allMarkets(overrides?: CallOverrides): Promise<PopulatedTransaction>;
192
+ getAllMarkets(overrides?: CallOverrides): Promise<PopulatedTransaction>;
190
193
 
191
194
  updateAssetsState(
192
195
  comptroller: PromiseOrValue<string>,