@gearbox-protocol/periphery-v3 1.2.8 → 1.2.12
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.
|
@@ -7,7 +7,7 @@ pragma experimental ABIEncoderV2;
|
|
|
7
7
|
import "@gearbox-protocol/core-v3/contracts/interfaces/IAddressProviderV3.sol";
|
|
8
8
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
9
9
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
10
|
-
|
|
10
|
+
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
|
|
11
11
|
import {PERCENTAGE_FACTOR, RAY} from "@gearbox-protocol/core-v2/contracts/libraries/Constants.sol";
|
|
12
12
|
|
|
13
13
|
import {ContractsRegisterTrait} from "@gearbox-protocol/core-v3/contracts/traits/ContractsRegisterTrait.sol";
|
|
@@ -195,7 +195,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
195
195
|
result.creditManager = _cm;
|
|
196
196
|
result.addr = _creditAccount;
|
|
197
197
|
|
|
198
|
-
result.underlying = creditManager
|
|
198
|
+
result.underlying = _getUnderlying(creditManager);
|
|
199
199
|
|
|
200
200
|
address pool = _getPool(_cm);
|
|
201
201
|
result.baseBorrowRate = _getBaseInterestRate(pool);
|
|
@@ -262,7 +262,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
262
262
|
result.totalValue = collateralDebtData.totalValue;
|
|
263
263
|
result.isSuccessful = true;
|
|
264
264
|
} catch {
|
|
265
|
-
_getPriceFeedFailedList(
|
|
265
|
+
result.priceFeedsNeeded = _getPriceFeedFailedList(_pool, result.balances);
|
|
266
266
|
result.isSuccessful = false;
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -347,7 +347,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
347
347
|
result.name = _getName(_cm);
|
|
348
348
|
result.cfVersion = _getVersion(address(creditFacade));
|
|
349
349
|
|
|
350
|
-
result.underlying = creditManager
|
|
350
|
+
result.underlying = _getUnderlying(creditManager);
|
|
351
351
|
|
|
352
352
|
{
|
|
353
353
|
result.pool = _getPool(_cm);
|
|
@@ -406,7 +406,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
406
406
|
|
|
407
407
|
result.quotas = _getQuotas(result.pool);
|
|
408
408
|
|
|
409
|
-
result.isPaused =
|
|
409
|
+
result.isPaused = _getPaused(address(creditFacade));
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/// @dev Returns PoolData for a particular pool
|
|
@@ -452,29 +452,29 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
452
452
|
|
|
453
453
|
result.totalSupply = pool.totalSupply();
|
|
454
454
|
result.totalAssets = pool.totalAssets();
|
|
455
|
-
|
|
456
455
|
result.supplyRate = pool.supplyRate();
|
|
457
456
|
|
|
458
457
|
result.version = _getVersion(address(pool));
|
|
459
458
|
|
|
460
459
|
result.quotas = _getQuotas(_pool);
|
|
461
460
|
result.lirm = _getInterestRateModel(_pool);
|
|
461
|
+
result.isPaused = _getPaused(_pool);
|
|
462
462
|
|
|
463
|
-
|
|
464
|
-
|
|
463
|
+
// Adding zappers
|
|
465
464
|
address[] memory zappers = zapperRegister.zappers(address(pool));
|
|
466
465
|
len = zappers.length;
|
|
467
466
|
result.zappers = new ZapperInfo[](len);
|
|
468
467
|
|
|
469
468
|
unchecked {
|
|
470
469
|
for (uint256 i; i < len; ++i) {
|
|
471
|
-
address
|
|
472
|
-
|
|
470
|
+
address tokenIn = IZapper(zappers[i]).unwrappedToken();
|
|
471
|
+
address tokenOut = IZapper(zappers[i]).tokenOut();
|
|
472
|
+
result.zappers[i] = ZapperInfo({tokenIn: tokenIn, tokenOut: tokenOut, zapper: zappers[i]});
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
result.poolQuotaKeeper = address(_getPoolQuotaKeeper(_pool));
|
|
477
|
-
result.gauge = IPoolQuotaKeeperV3(result.poolQuotaKeeper)
|
|
477
|
+
result.gauge = _getGauge(IPoolQuotaKeeperV3(result.poolQuotaKeeper));
|
|
478
478
|
|
|
479
479
|
return result;
|
|
480
480
|
}
|
|
@@ -614,6 +614,18 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
614
614
|
return ICreditManagerV3(_cm).collateralTokensCount();
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
+
function _getGauge(IPoolQuotaKeeperV3 pqk) internal view returns (address) {
|
|
618
|
+
return pqk.gauge();
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
function _getPaused(address pausableContract) internal view returns (bool) {
|
|
622
|
+
return Pausable(pausableContract).paused();
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function _getUnderlying(ICreditManagerV3 cm) internal view returns (address) {
|
|
626
|
+
return cm.underlying();
|
|
627
|
+
}
|
|
628
|
+
|
|
617
629
|
function _getQuotas(address _pool) internal view returns (QuotaInfo[] memory quotas) {
|
|
618
630
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(_pool);
|
|
619
631
|
|
|
@@ -644,7 +656,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
644
656
|
for (uint256 i; i < len; ++i) {
|
|
645
657
|
GaugeInfo memory gaugeInfo = result[i];
|
|
646
658
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(poolsV3[i]);
|
|
647
|
-
address gauge = pqk
|
|
659
|
+
address gauge = _getGauge(pqk);
|
|
648
660
|
gaugeInfo.addr = gauge;
|
|
649
661
|
gaugeInfo.pool = _getPool(gauge);
|
|
650
662
|
(gaugeInfo.symbol, gaugeInfo.name) = _getSymbolAndName(gaugeInfo.pool);
|
|
@@ -696,26 +708,32 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
696
708
|
address gauge;
|
|
697
709
|
{
|
|
698
710
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(poolsV3[i]);
|
|
699
|
-
gauge = pqk
|
|
711
|
+
gauge = _getGauge(pqk);
|
|
700
712
|
|
|
701
713
|
quotaTokens = _getQuotedTokens(pqk);
|
|
702
714
|
}
|
|
703
715
|
uint256 quotaTokensLen = quotaTokens.length;
|
|
704
716
|
|
|
705
717
|
for (uint256 j; j < quotaTokensLen; ++j) {
|
|
706
|
-
|
|
718
|
+
if (op == QUERY) {
|
|
719
|
+
address token = quotaTokens[j];
|
|
720
|
+
GaugeVote memory gaugeVote = gaugeVotes[index];
|
|
707
721
|
|
|
708
|
-
|
|
722
|
+
(gaugeVote.stakerVotesLpSide, gaugeVote.stakerVotesCaSide) =
|
|
723
|
+
IGaugeV3(gauge).userTokenVotes(staker, token);
|
|
709
724
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
725
|
+
(
|
|
726
|
+
gaugeVote.minRate,
|
|
727
|
+
gaugeVote.maxRate,
|
|
728
|
+
gaugeVote.totalVotesLpSide,
|
|
729
|
+
gaugeVote.totalVotesCaSide
|
|
730
|
+
) = IGaugeV3(gauge).quotaRateParams(token);
|
|
731
|
+
|
|
732
|
+
gaugeVote.currentEpoch = IGaugeV3(gauge).epochLastUpdate();
|
|
733
|
+
gaugeVote.epochFrozen = IGaugeV3(gauge).epochFrozen();
|
|
734
|
+
|
|
735
|
+
gaugeVote.gauge = gauge;
|
|
736
|
+
gaugeVote.token = token;
|
|
719
737
|
}
|
|
720
738
|
++index;
|
|
721
739
|
}
|
package/contracts/data/Types.sol
CHANGED
|
@@ -33,8 +33,9 @@ struct ContractAdapter {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
struct ZapperInfo {
|
|
36
|
-
address tokenFrom;
|
|
37
36
|
address zapper;
|
|
37
|
+
address tokenIn;
|
|
38
|
+
address tokenOut;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
struct CreditAccountData {
|
|
@@ -179,8 +180,12 @@ struct GaugeInfo {
|
|
|
179
180
|
struct GaugeVote {
|
|
180
181
|
address gauge;
|
|
181
182
|
address token;
|
|
183
|
+
uint16 minRate;
|
|
184
|
+
uint16 maxRate;
|
|
182
185
|
uint16 currentEpoch;
|
|
183
186
|
bool epochFrozen;
|
|
184
187
|
uint96 totalVotesLpSide;
|
|
185
188
|
uint96 totalVotesCaSide;
|
|
189
|
+
uint96 stakerVotesLpSide;
|
|
190
|
+
uint96 stakerVotesCaSide;
|
|
186
191
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/periphery-v3",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": "git@github.com:Gearbox-protocol/periphery-v3.git",
|
|
6
6
|
"author": "Mikael <26343374+0xmikko@users.noreply.github.com>",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"@1inch/solidity-utils": "^2.2.27",
|
|
18
18
|
"@commitlint/cli": "^17.6.3",
|
|
19
19
|
"@commitlint/config-conventional": "17.6.0",
|
|
20
|
-
"@gearbox-protocol/core-v2": "1.19.0-base.
|
|
21
|
-
"@gearbox-protocol/core-v3": "^1.40.
|
|
22
|
-
"@gearbox-protocol/integrations-v3": "^1.
|
|
23
|
-
"@gearbox-protocol/oracles-v3": "^1.7.
|
|
20
|
+
"@gearbox-protocol/core-v2": "1.19.0-base.16",
|
|
21
|
+
"@gearbox-protocol/core-v3": "^1.40.2",
|
|
22
|
+
"@gearbox-protocol/integrations-v3": "^1.17.0",
|
|
23
|
+
"@gearbox-protocol/oracles-v3": "^1.7.6",
|
|
24
24
|
"@gearbox-protocol/sdk-gov": "^1.5.10",
|
|
25
25
|
"@openzeppelin/contracts": "^4.9.3"
|
|
26
26
|
},
|