@gearbox-protocol/sdk 2.1.6 → 2.1.8

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.
@@ -14,6 +14,8 @@ contract NetworkDetector is Test {
14
14
 
15
15
  uint16[] public connectedNetworks;
16
16
 
17
+ uint256 public immutable chainId;
18
+
17
19
  constructor() {
18
20
  // ---------------- Networks ---------------------
19
21
  connectedNetworks.push(1);
@@ -21,7 +23,7 @@ contract NetworkDetector is Test {
21
23
  usdcByNetwork[1] = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
22
24
  usdcByNetwork[42161] = 0xaf88d065e77c8cC2239327C5EDb3A432268e5831;
23
25
 
24
- vm.chainId(getNetworkId());
26
+ chainId = getNetworkId();
25
27
  }
26
28
 
27
29
  function getNetworkId() internal view returns (uint256) {
@@ -30,7 +30,7 @@ contract SupportedContracts is Test, ISupportedContracts {
30
30
 
31
31
  uint256 public override contractCount;
32
32
 
33
- constructor() {
33
+ constructor(uint256 _chainId) {
34
34
  contractDataByNetwork[1].push(
35
35
  ContractData({
36
36
  id: Contracts.UNISWAP_V2_ROUTER,
@@ -349,7 +349,7 @@ contract SupportedContracts is Test, ISupportedContracts {
349
349
  })
350
350
  );
351
351
 
352
- ContractData[] storage cd = contractDataByNetwork[block.chainid];
352
+ ContractData[] storage cd = contractDataByNetwork[_chainId];
353
353
 
354
354
  uint256 len = cd.length;
355
355
  contractCount = len;
@@ -1006,7 +1006,7 @@ contract TokensDataLive {
1006
1006
  );
1007
1007
  }
1008
1008
 
1009
- function getTokenData() external view returns (TokenData[] memory) {
1010
- return tokenDataByNetwork[block.chainid];
1009
+ function getTokenData(uint256 chainId) external view returns (TokenData[] memory) {
1010
+ return tokenDataByNetwork[chainId];
1011
1011
  }
1012
1012
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",