infrastructure-upgrade/lib/v3-periphery/contracts/libraries/ChainId.sol

14 lines
357 B
Solidity
Raw Permalink Normal View History

2023-04-08 18:46:18 +00:00
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.0;
/// @title Function for getting the current chain ID
library ChainId {
/// @dev Gets the current chain ID
/// @return chainId The current chain ID
function get() internal pure returns (uint256 chainId) {
assembly {
chainId := chainid()
}
}
}