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 UnsupportedChain(uint256 chainId)

Error thrown when chainid is not supported

UnexpectedChain

error UnexpectedChain(uint32 expected, uint32 requested)

Error thrown when chainid is not the current chain

DifferentChainExpected

error DifferentChainExpected(uint256 chainId)

Error thrown when chainid is not the expected chain

chainid

function chainid() internal view returns (uint32)

Converts block.chainid to uint32 chainid

Return Values

NameTypeDescription
[0]uint32uint32 chainid

requireCurrentChain

function requireCurrentChain(uint32 chainId) internal view

Requires current chain to be the same as requested

Parameters

NameTypeDescription
chainIduint32Requested chain ID

requireNotCurrentChain

function requireNotCurrentChain(uint32 chainId) internal view

Requires current chain to be different than requested

Parameters

NameTypeDescription
chainIduint32Requested chain ID

On this page