@gearbox-protocol/sdk 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/PriceFeedDataLive.sol +17 -17
- package/contracts/TokensData.sol +5 -11
- package/package.json +1 -1
|
@@ -54,23 +54,23 @@ struct RedStonePriceFeedData {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
contract PriceFeedDataLive {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
mapping(
|
|
60
|
-
mapping(
|
|
61
|
-
mapping(
|
|
62
|
-
mapping(
|
|
63
|
-
mapping(
|
|
64
|
-
mapping(
|
|
65
|
-
mapping(
|
|
66
|
-
mapping(
|
|
67
|
-
mapping(
|
|
68
|
-
mapping(
|
|
69
|
-
mapping(
|
|
70
|
-
mapping(
|
|
71
|
-
mapping(
|
|
72
|
-
|
|
73
|
-
constructor(
|
|
57
|
+
uint256 networkId;
|
|
58
|
+
|
|
59
|
+
mapping(uint256 => ChainlinkPriceFeedData[]) chainlinkPriceFeedsByNetwork;
|
|
60
|
+
mapping(uint256 => SingeTokenPriceFeedData[]) zeroPriceFeedsByNetwork;
|
|
61
|
+
mapping(uint256 => CurvePriceFeedData[]) curvePriceFeedsByNetwork;
|
|
62
|
+
mapping(uint256 => CurvePriceFeedData[]) curveCryptoPriceFeedsByNetwork;
|
|
63
|
+
mapping(uint256 => TheSamePriceFeedData[]) theSamePriceFeedsByNetwork;
|
|
64
|
+
mapping(uint256 => SingeTokenPriceFeedData[]) yearnPriceFeedsByNetwork;
|
|
65
|
+
mapping(uint256 => BoundedPriceFeedData[]) boundedPriceFeedsByNetwork;
|
|
66
|
+
mapping(uint256 => CompositePriceFeedData[]) compositePriceFeedsByNetwork;
|
|
67
|
+
mapping(uint256 => SingeTokenPriceFeedData) wstethPriceFeedByNetwork;
|
|
68
|
+
mapping(uint256 => GenericLPPriceFeedData[]) wrappedAaveV2PriceFeedsByNetwork;
|
|
69
|
+
mapping(uint256 => GenericLPPriceFeedData[]) compoundV2PriceFeedsByNetwork;
|
|
70
|
+
mapping(uint256 => GenericLPPriceFeedData[]) erc4626PriceFeedsByNetwork;
|
|
71
|
+
mapping(uint256 => RedStonePriceFeedData[]) redStonePriceFeedsByNetwork;
|
|
72
|
+
|
|
73
|
+
constructor(uint256 _networkId) {
|
|
74
74
|
networkId = _networkId;
|
|
75
75
|
// ------------------------ 1INCH ------------------------
|
|
76
76
|
chainlinkPriceFeedsByNetwork[1].push(
|
package/contracts/TokensData.sol
CHANGED
|
@@ -17,9 +17,8 @@ struct TokenData {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
contract TokensDataLive {
|
|
20
|
-
|
|
21
|
-
mapping(
|
|
22
|
-
mapping(uint16 => address) usdcByNetwork;
|
|
20
|
+
mapping(uint256 => TokenData[]) tokenDataByNetwork;
|
|
21
|
+
mapping(uint256 => address) usdcByNetwork;
|
|
23
22
|
|
|
24
23
|
uint16[] public connectedNetworks;
|
|
25
24
|
|
|
@@ -1015,15 +1014,13 @@ contract TokensDataLive {
|
|
|
1015
1014
|
tokenType: TokenType.AAVE_V2_A_TOKEN
|
|
1016
1015
|
})
|
|
1017
1016
|
);
|
|
1018
|
-
|
|
1019
|
-
networkId = getNetworkId();
|
|
1020
1017
|
}
|
|
1021
1018
|
|
|
1022
1019
|
function getTokenData() external view returns (TokenData[] memory) {
|
|
1023
|
-
return tokenDataByNetwork[
|
|
1020
|
+
return tokenDataByNetwork[block.chainid];
|
|
1024
1021
|
}
|
|
1025
1022
|
|
|
1026
|
-
function getNetworkId() internal view returns (
|
|
1023
|
+
function getNetworkId() internal view returns (uint256) {
|
|
1027
1024
|
if (block.chainid == 1337 || block.chainid == 31337) {
|
|
1028
1025
|
uint256 len = connectedNetworks.length;
|
|
1029
1026
|
for (uint256 i = 0; i < len; i++) {
|
|
@@ -1031,11 +1028,8 @@ contract TokensDataLive {
|
|
|
1031
1028
|
return connectedNetworks[i];
|
|
1032
1029
|
}
|
|
1033
1030
|
}
|
|
1034
|
-
|
|
1035
|
-
revert("No network found");
|
|
1036
|
-
} else {
|
|
1037
|
-
return uint16(block.chainid);
|
|
1038
1031
|
}
|
|
1032
|
+
return block.chainid;
|
|
1039
1033
|
}
|
|
1040
1034
|
|
|
1041
1035
|
function checkNetworkId(uint16 _networkId) internal view returns (bool) {
|