Skip to main content

PositionConfigId

Git Source - Generated with forge doc

A configId is set per tokenId The lower 255 bits are used to store the truncated hash of the corresponding PositionConfig The upper bit is used to signal if the tokenId has a subscriber

struct PositionConfigId {
bytes32 id;
}

PositionConfigIdLibrary

Git Source

State Variables

MASK_UPPER_BIT

bytes32 constant MASK_UPPER_BIT = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

DIRTY_UPPER_BIT

bytes32 constant DIRTY_UPPER_BIT = 0x8000000000000000000000000000000000000000000000000000000000000000;

Functions

getConfigId

returns the truncated hash of the PositionConfig for a given tokenId

function getConfigId(PositionConfigId storage _configId) internal view returns (bytes32 configId);

setConfigId

We only set the config on mint, guaranteeing that the most significant bit is unset, so we can just assign the entire 32 bytes to the id.

function setConfigId(PositionConfigId storage _configId, bytes32 configId) internal;

setSubscribe

function setSubscribe(PositionConfigId storage configId) internal;

setUnsubscribe

function setUnsubscribe(PositionConfigId storage configId) internal;

hasSubscriber

function hasSubscriber(PositionConfigId storage configId) internal view returns (bool subscribed);