ODCutils

DataPoints

DataPoints

Library with utility functions to encode and decode DataPoint

PREFIX

bytes4 PREFIX

Represents PPPPVVRR prefix

PREFIX_BIT_OFFSET

uint256 PREFIX_BIT_OFFSET

Offset of the DataPoint prefix

ID_BIT_OFFSET

uint256 ID_BIT_OFFSET

Offset of the DataPoint id

CHAINID_BIT_OFFSET

uint256 CHAINID_BIT_OFFSET

Offset of the DataPoint chainid

UnsupportedDataPointStructure

error UnsupportedDataPointStructure()

Error thrown when DataPoint structure is not supported

encode

function encode(address registry, uint32 id) internal view returns (DataPoint)

Encode DataPoint

Parameters

NameTypeDescription
registryaddressAddress of the registry which allocated the DataPoint
iduint3232 bit implementation-specific id of the DataPoint

Return Values

NameTypeDescription
[0]DataPointEncoded DataPoint

decode

function decode(DataPoint dp) internal pure returns (uint32 chainid, address registry, uint32 id)

Decode DataPoint

Parameters

NameTypeDescription
dpDataPointDataPoint to decode

Return Values

NameTypeDescription
chainiduint32Chain ID of the DataPoint
registryaddressAddress of the registry which allocated the DataPoint
iduint3232 bit implementation-specific id of the DataPoint

On this page