@gearbox-protocol/periphery-v3 1.2.8 → 1.2.11
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);
|
|
@@ -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
|
|
@@ -459,22 +459,23 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
459
459
|
|
|
460
460
|
result.quotas = _getQuotas(_pool);
|
|
461
461
|
result.lirm = _getInterestRateModel(_pool);
|
|
462
|
+
result.isPaused = _getPaused(_pool);
|
|
462
463
|
|
|
463
|
-
|
|
464
|
-
|
|
464
|
+
// Adding zappers
|
|
465
465
|
address[] memory zappers = zapperRegister.zappers(address(pool));
|
|
466
466
|
len = zappers.length;
|
|
467
467
|
result.zappers = new ZapperInfo[](len);
|
|
468
468
|
|
|
469
469
|
unchecked {
|
|
470
470
|
for (uint256 i; i < len; ++i) {
|
|
471
|
-
address
|
|
472
|
-
|
|
471
|
+
address tokenIn = IZapper(zappers[i]).unwrappedToken();
|
|
472
|
+
address tokenOut = IZapper(zappers[i]).tokenOut();
|
|
473
|
+
result.zappers[i] = ZapperInfo({tokenIn: tokenIn, tokenOut: tokenOut, zapper: zappers[i]});
|
|
473
474
|
}
|
|
474
475
|
}
|
|
475
476
|
|
|
476
477
|
result.poolQuotaKeeper = address(_getPoolQuotaKeeper(_pool));
|
|
477
|
-
result.gauge = IPoolQuotaKeeperV3(result.poolQuotaKeeper)
|
|
478
|
+
result.gauge = _getGauge(IPoolQuotaKeeperV3(result.poolQuotaKeeper));
|
|
478
479
|
|
|
479
480
|
return result;
|
|
480
481
|
}
|
|
@@ -614,6 +615,18 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
614
615
|
return ICreditManagerV3(_cm).collateralTokensCount();
|
|
615
616
|
}
|
|
616
617
|
|
|
618
|
+
function _getGauge(IPoolQuotaKeeperV3 pqk) internal view returns (address) {
|
|
619
|
+
return pqk.gauge();
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function _getPaused(address pausableContract) internal view returns (bool) {
|
|
623
|
+
return Pausable(pausableContract).paused();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function _getUnderlying(ICreditManagerV3 cm) internal view returns (address) {
|
|
627
|
+
return cm.underlying();
|
|
628
|
+
}
|
|
629
|
+
|
|
617
630
|
function _getQuotas(address _pool) internal view returns (QuotaInfo[] memory quotas) {
|
|
618
631
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(_pool);
|
|
619
632
|
|
|
@@ -644,7 +657,7 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
644
657
|
for (uint256 i; i < len; ++i) {
|
|
645
658
|
GaugeInfo memory gaugeInfo = result[i];
|
|
646
659
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(poolsV3[i]);
|
|
647
|
-
address gauge = pqk
|
|
660
|
+
address gauge = _getGauge(pqk);
|
|
648
661
|
gaugeInfo.addr = gauge;
|
|
649
662
|
gaugeInfo.pool = _getPool(gauge);
|
|
650
663
|
(gaugeInfo.symbol, gaugeInfo.name) = _getSymbolAndName(gaugeInfo.pool);
|
|
@@ -696,26 +709,32 @@ contract DataCompressorV3_00 is IDataCompressorV3_00, ContractsRegisterTrait, Li
|
|
|
696
709
|
address gauge;
|
|
697
710
|
{
|
|
698
711
|
IPoolQuotaKeeperV3 pqk = _getPoolQuotaKeeper(poolsV3[i]);
|
|
699
|
-
gauge = pqk
|
|
712
|
+
gauge = _getGauge(pqk);
|
|
700
713
|
|
|
701
714
|
quotaTokens = _getQuotedTokens(pqk);
|
|
702
715
|
}
|
|
703
716
|
uint256 quotaTokensLen = quotaTokens.length;
|
|
704
717
|
|
|
705
718
|
for (uint256 j; j < quotaTokensLen; ++j) {
|
|
706
|
-
|
|
719
|
+
if (op == QUERY) {
|
|
720
|
+
address token = quotaTokens[j];
|
|
721
|
+
GaugeVote memory gaugeVote = gaugeVotes[index];
|
|
707
722
|
|
|
708
|
-
|
|
723
|
+
(gaugeVote.stakerVotesLpSide, gaugeVote.stakerVotesCaSide) =
|
|
724
|
+
IGaugeV3(gauge).userTokenVotes(staker, token);
|
|
709
725
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
726
|
+
(
|
|
727
|
+
gaugeVote.minRate,
|
|
728
|
+
gaugeVote.maxRate,
|
|
729
|
+
gaugeVote.totalVotesLpSide,
|
|
730
|
+
gaugeVote.totalVotesCaSide
|
|
731
|
+
) = IGaugeV3(gauge).quotaRateParams(token);
|
|
732
|
+
|
|
733
|
+
gaugeVote.currentEpoch = IGaugeV3(gauge).epochLastUpdate();
|
|
734
|
+
gaugeVote.epochFrozen = IGaugeV3(gauge).epochFrozen();
|
|
735
|
+
|
|
736
|
+
gaugeVote.gauge = gauge;
|
|
737
|
+
gaugeVote.token = token;
|
|
719
738
|
}
|
|
720
739
|
++index;
|
|
721
740
|
}
|
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.11",
|
|
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
|
},
|