Skip to content

Commit

Permalink
added Linea Sepolia support too
Browse files Browse the repository at this point in the history
Signed-off-by: Nischal Sharma <[email protected]>
  • Loading branch information
NickSneo committed Aug 19, 2024
1 parent c8a9a9d commit 260460a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/web3j/ens/Contracts.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class Contracts {
public static final String RINKEBY = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
public static final String GOERLI = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
public static final String SEPOLIA = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
public static final String LINEA_SEPOLIA = "0x5B2636F0f2137B4aE722C01dd5122D7d3e9541f7";
public static final String LINEA = "0x50130b669B28C339991d8676FA73CF122a121267";
public static final String LINEA_SEPOLIA = "0x5B2636F0f2137B4aE722C01dd5122D7d3e9541f7";

public static String resolveRegistryContract(String chainId) {
final Long chainIdLong = Long.parseLong(chainId);
Expand All @@ -39,6 +39,8 @@ public static String resolveRegistryContract(String chainId) {
return SEPOLIA;
} else if (chainIdLong.equals(ChainIdLong.LINEA)) {
return LINEA;
} else if (chainIdLong.equals(ChainIdLong.LINEA_SEPOLIA)) {
return LINEA_SEPOLIA;
} else {
throw new EnsResolutionException(
"Unable to resolve ENS registry contract for network id: " + chainId);
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/web3j/tx/ChainIdLong.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ public class ChainIdLong {
public static final long ETHEREUM_CLASSIC_MAINNET = 61;
public static final long ETHEREUM_CLASSIC_TESTNET = 62;
public static final long LINEA = 59144;
public static final long LINEA_SEPOLIA = 59141;
}

0 comments on commit 260460a

Please sign in to comment.