diff --git a/packages/protocol/contracts/L1/TaikoL1.sol b/packages/protocol/contracts/L1/TaikoL1.sol index bb1b3579e5..685ca32d3e 100644 --- a/packages/protocol/contracts/L1/TaikoL1.sol +++ b/packages/protocol/contracts/L1/TaikoL1.sol @@ -202,7 +202,7 @@ contract TaikoL1 is EssentialContract, ITaikoL1, TaikoEvents, TaikoErrors { // - anchorGasLimit: 250_000 (based on internal devnet, its ~220_000 // after 256 L2 blocks) return TaikoData.Config({ - chainId: 167_009, + chainId: LibNetwork.TAIKO, // Assume the block time is 3s, the protocol will allow ~90 days of // new blocks without any verification. blockMaxProposals: 3_000_000, diff --git a/packages/protocol/contracts/libs/LibNetwork.sol b/packages/protocol/contracts/libs/LibNetwork.sol index 24d7076252..46c3a18c9e 100644 --- a/packages/protocol/contracts/libs/LibNetwork.sol +++ b/packages/protocol/contracts/libs/LibNetwork.sol @@ -11,6 +11,8 @@ library LibNetwork { uint256 internal constant HOLESKY = 17_000; uint256 internal constant SEPOLIA = 11_155_111; + uint64 internal constant TAIKO = 167_000; + /// @dev Checks if the chain ID represents an Ethereum testnet. /// @param _chainId The chain ID. /// @return true if the chain ID represents an Ethereum testnet, false otherwise. @@ -28,6 +30,13 @@ library LibNetwork { return _chainId == LibNetwork.MAINNET || isEthereumTestnet(_chainId); } + /// @dev Checks if the chain ID represents the Taiko L2 mainnet. + /// @param _chainId The chain ID. + /// @return true if the chain ID represents the Taiko L2 mainnet. + function isTaikoMainnet(uint256 _chainId) internal pure returns (bool) { + return _chainId == TAIKO; + } + /// @dev Checks if the chain ID represents an internal Taiko devnet's base layer. /// @param _chainId The chain ID. /// @return true if the chain ID represents an internal Taiko devnet's base layer, false