ODCutils
ChainidTools
This library provides helper to convert uint256 chainid provided by block.chainid to uint32 chainid used across this Data Index implementation
UnsupportedChain
Error thrown when chainid is not supported
UnexpectedChain
Error thrown when chainid is not the current chain
DifferentChainExpected
Error thrown when chainid is not the expected chain
chainid
Converts block.chainid to uint32 chainid
Return Values
Name | Type | Description |
---|---|---|
[0] | uint32 | uint32 chainid |
requireCurrentChain
Requires current chain to be the same as requested
Parameters
Name | Type | Description |
---|---|---|
chainId | uint32 | Requested chain ID |
requireNotCurrentChain
Requires current chain to be different than requested
Parameters
Name | Type | Description |
---|---|---|
chainId | uint32 | Requested chain ID |