SidLibrary

Git Source

Library for parsing and extracting information from a Synthetic Asset ID (SID).

State Variables

MAXUINT64

uint128 constant MAXUINT64 = 0xFFFFFFFFFFFFFFFF;

MAXUINT32

uint128 constant MAXUINT32 = 0xFFFFFFFF;

Functions

chainId

Retrieves the chain ID from the Synthetic Asset ID (SID).

function chainId(uint128 SID) internal pure returns (uint64);

Parameters

NameTypeDescription

SID

uint128

The Synthetic Asset ID.

Returns

NameTypeDescription

<none>

uint64

The chain ID.

protocolId

Retrieves the protocol ID from the Synthetic Asset ID (SID).

function protocolId(uint128 SID) internal pure returns (uint32);

Parameters

NameTypeDescription

SID

uint128

The Synthetic Asset ID.

Returns

NameTypeDescription

<none>

uint32

The protocol ID.

poolId

Retrieves the pool ID from the Synthetic Asset ID (SID).

function poolId(uint128 SID) internal pure returns (uint32);

Parameters

NameTypeDescription

SID

uint128

The Synthetic Asset ID.

Returns

NameTypeDescription

<none>

uint32

The pool ID.

isLpStackingSynth

Checks if the Synthetic Asset ID (SID) represents an LP-stacking synthetic asset.

function isLpStackingSynth(uint128 SID) internal pure returns (bool);

Parameters

NameTypeDescription

SID

uint128

The Synthetic Asset ID.

Returns

NameTypeDescription

<none>

bool

True if the SID represents an LP-stacking synthetic asset, otherwise false.

unpack

Unpacks the chain ID, protocol ID, and pool ID from the Synthetic Asset ID (SID).

function unpack(uint128 SID) internal pure returns (uint64, uint32, uint32);

Parameters

NameTypeDescription

SID

uint128

The Synthetic Asset ID.

Returns

NameTypeDescription

<none>

uint64

The chain ID, protocol ID, and pool ID.

<none>

uint32

<none>

uint32

Last updated