Skip to content

Commit

Permalink
fix: update chain ids with sonic and mantle (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
sendra authored Feb 6, 2025
1 parent b039c8c commit d379425
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/contracts/utils/ChainHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ library ChainIds {
uint256 internal constant CELO = 42220;
uint256 internal constant POLYGON_ZK_EVM = 1101;
uint256 internal constant LINEA = 59144;
uint256 internal constant SONIC = 146;
uint256 internal constant MANTLE = 5000;
}

library TestNetChainIds {
Expand All @@ -40,6 +42,8 @@ library TestNetChainIds {
uint256 internal constant ARBITRUM_SEPOLIA = 421614;
uint256 internal constant ZKSYNC_SEPOLIA = 300;
uint256 internal constant LINEA_SEPOLIA = 59141;
uint256 internal constant SONIC_BLAZE = 57054;
uint256 internal constant MANTLE_SEPOLIA = 5003;
}

library ChainHelpers {
Expand Down Expand Up @@ -83,6 +87,10 @@ library ChainHelpers {
newFork = vm.createSelectFork(vm.rpcUrl('zksync'));
} else if (chainId == ChainIds.LINEA) {
newFork = vm.createSelectFork(vm.rpcUrl('linea'));
} else if (chainId == ChainIds.SONIC) {
newFork = vm.createSelectFork(vm.rpcUrl('sonic'));
} else if (chainId == ChainIds.MANTLE) {
newFork = vm.createSelectFork(vm.rpcUrl('mantle'));
} else {
revert UnknownChainId();
}
Expand Down Expand Up @@ -119,6 +127,10 @@ library ChainHelpers {
networkName = 'zksync';
} else if (chainId == ChainIds.LINEA) {
networkName = 'linea';
} else if (chainId == ChainIds.SONIC) {
networkName = 'sonic';
} else if (chainId == ChainIds.MANTLE) {
networkName = 'mantle';
}
// testnets
else if (chainId == TestNetChainIds.ETHEREUM_SEPOLIA) {
Expand Down Expand Up @@ -147,6 +159,10 @@ library ChainHelpers {
networkName = 'zksync_sepolia';
} else if (chainId == TestNetChainIds.LINEA_SEPOLIA) {
networkName = 'linea_sepolia';
} else if (chainId == TestNetChainIds.SONIC_BLAZE) {
networkName = 'sonic_blaze';
} else if (chainId == TestNetChainIds.MANTLE_SEPOLIA) {
networkName = 'mantle_sepolia';
} else {
revert('chain id is not supported');
}
Expand Down

0 comments on commit d379425

Please sign in to comment.