Skip to content

Commit 6c71783

Browse files
committed
chore(utils): add denergy chain
1 parent f797e1a commit 6c71783

File tree

4 files changed

+27
-18
lines changed

4 files changed

+27
-18
lines changed

foundry.base.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
berachain = "https://direct.routeme.sh/rpc/80094/${ROUTEMESH_API_KEY}"
8181
bsc = "https://direct.routeme.sh/rpc/56/${ROUTEMESH_API_KEY}"
8282
chiliz = "https://direct.routeme.sh/rpc/88888/${ROUTEMESH_API_KEY}"
83+
denergy = "https://rpc.d.energy/"
8384
ethereum = "https://direct.routeme.sh/rpc/1/${ROUTEMESH_API_KEY}"
8485
gnosis = "https://direct.routeme.sh/rpc/100/${ROUTEMESH_API_KEY}"
8586
hyperevm = "https://direct.routeme.sh/rpc/999/${ROUTEMESH_API_KEY}"

utils/src/tests/BaseScript.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ abstract contract BaseScript is Script {
132132
/// @notice Returns the Sablier Comptroller on each chain.
133133
function getComptroller() public view returns (address) {
134134
if (ChainId.isSupported(chainId)) {
135+
// For dEnergy, return the different address.
136+
if (chainId == ChainId.DENERGY) return 0x946654AB30Dd6eD10236C89f2C8B2719df653691;
137+
135138
// For Linea, return the different address.
136139
if (chainId == ChainId.LINEA) return 0xF21b304A08993f98A79C7Eb841f812CCeab49B8b;
137140

utils/src/tests/ChainId.sol

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ library ChainId {
77
MAINNETS
88
//////////////////////////////////////////////////////////////////////////*/
99

10-
uint256 public constant MAINNETS_COUNT = 23;
10+
uint256 public constant MAINNETS_COUNT = 24;
1111

1212
uint256 public constant ABSTRACT = 2741;
1313
uint256 public constant ARBITRUM = 42_161;
@@ -16,6 +16,7 @@ library ChainId {
1616
uint256 public constant BERACHAIN = 80_094;
1717
uint256 public constant BSC = 56;
1818
uint256 public constant CHILIZ = 88_888;
19+
uint256 public constant DENERGY = 369_369;
1920
uint256 public constant ETHEREUM = 1;
2021
uint256 public constant GNOSIS = 100;
2122
uint256 public constant HYPEREVM = 999;
@@ -60,22 +61,23 @@ library ChainId {
6061
supportedIds[4] = BERACHAIN;
6162
supportedIds[5] = BSC;
6263
supportedIds[6] = CHILIZ;
63-
supportedIds[7] = ETHEREUM;
64-
supportedIds[8] = GNOSIS;
65-
supportedIds[9] = HYPEREVM;
66-
supportedIds[10] = LIGHTLINK;
67-
supportedIds[11] = LINEA;
68-
supportedIds[12] = MODE;
69-
supportedIds[13] = MONAD;
70-
supportedIds[14] = MORPH;
71-
supportedIds[15] = OPTIMISM;
72-
supportedIds[16] = POLYGON;
73-
supportedIds[17] = SCROLL;
74-
supportedIds[18] = SONIC;
75-
supportedIds[19] = SUPERSEED;
76-
supportedIds[20] = UNICHAIN;
77-
supportedIds[21] = XDC;
78-
supportedIds[22] = ZKSYNC;
64+
supportedIds[7] = DENERGY;
65+
supportedIds[8] = ETHEREUM;
66+
supportedIds[9] = GNOSIS;
67+
supportedIds[10] = HYPEREVM;
68+
supportedIds[11] = LIGHTLINK;
69+
supportedIds[12] = LINEA;
70+
supportedIds[13] = MODE;
71+
supportedIds[14] = MONAD;
72+
supportedIds[15] = MORPH;
73+
supportedIds[16] = OPTIMISM;
74+
supportedIds[17] = POLYGON;
75+
supportedIds[18] = SCROLL;
76+
supportedIds[19] = SONIC;
77+
supportedIds[20] = SUPERSEED;
78+
supportedIds[21] = UNICHAIN;
79+
supportedIds[22] = XDC;
80+
supportedIds[23] = ZKSYNC;
7981
}
8082

8183
/// @notice Returns the full list of supported testnet chain IDs.
@@ -99,6 +101,7 @@ library ChainId {
99101
if (chainId == ChainId.BERACHAIN) return "berachain";
100102
if (chainId == ChainId.BSC) return "bsc";
101103
if (chainId == ChainId.CHILIZ) return "chiliz";
104+
if (chainId == ChainId.DENERGY) return "denergy";
102105
if (chainId == ChainId.ETHEREUM) return "ethereum";
103106
if (chainId == ChainId.GNOSIS) return "gnosis";
104107
if (chainId == ChainId.HYPEREVM) return "hyperevm";

utils/tests/integration/fuzz/base-script/BaseScript.t.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ contract BaseScript_Fuzz_Test is StdAssertions {
9898

9999
function testFuzz_GetComptroller(uint64 chainId) external setChainId(chainId) {
100100
if (ChainId.isSupported(chainId)) {
101-
if (chainId == ChainId.LINEA) {
101+
if (chainId == ChainId.DENERGY) {
102+
assertEq(baseScript.getComptroller(), 0x946654AB30Dd6eD10236C89f2C8B2719df653691, "comptroller");
103+
} else if (chainId == ChainId.LINEA) {
102104
assertEq(baseScript.getComptroller(), 0xF21b304A08993f98A79C7Eb841f812CCeab49B8b, "comptroller");
103105
} else {
104106
assertEq(baseScript.getComptroller(), 0x0000008ABbFf7a84a2fE09f9A9b74D3BC2072399, "comptroller");

0 commit comments

Comments
 (0)