# ChainUtils

*Chain helpers internal library*

## ARBITRUM\_MAINNET

```solidity
uint256 ARBITRUM_MAINNET
```

## ARBITRUM\_SEPOLIA

```solidity
uint256 ARBITRUM_SEPOLIA
```

## POLYGON\_MAINNET

```solidity
uint256 POLYGON_MAINNET
```

## TESTNET

```solidity
uint256 TESTNET
```

## Overflow

```solidity
error Overflow()
```

## getBlockNumber

```solidity
function getBlockNumber() internal view returns (uint256)
```

*Returns the current block number (l2 block for arbitrum)*

## getUint48BlockNumber

```solidity
function getUint48BlockNumber(uint256 blockNumber) internal pure returns (uint48)
```

*Returns blockNumber converted to uint48*

### Parameters

| Name        | Type    | Description             |
| ----------- | ------- | ----------------------- |
| blockNumber | uint256 | block number to convert |

## getWrappedNativeToken

```solidity
function getWrappedNativeToken() internal view returns (address)
```

*Returns the wrapped native token address for the current chain*

## isWrappedNativeToken

```solidity
function isWrappedNativeToken(address _token) internal view returns (bool)
```

*Returns whether a token is the wrapped native token for the current chain*

### Parameters

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| \_token | address | token address to check |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gains.trade/developer/technical-reference/contracts/libraries/chainutils.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
