Skip to main content

JBBitmap

Git Source

Utilities to manage a bool bitmap. Used for storing inactive tiers.

Functions

readId

Initialize a JBBitmapWord struct based on a mapping storage pointer and an index.

function readId(mapping(uint256 => uint256) storage self, uint256 index) internal view returns (JBBitmapWord memory);

isTierIdRemoved

Get the status of the specified bit within the JBBitmapWord struct.

The index is the index that the bit would have if the bitmap were reshaped to a 1n matrix.*

function isTierIdRemoved(JBBitmapWord memory self, uint256 index) internal pure returns (bool);

Returns

NameTypeDescription
<none>boolThe boolean value at the specified index, which indicates whether the corresponding tier has been removed.

isTierIdRemoved

Get the status of the specified bit within the JBBitmapWord struct.

The index is the index that the bit would have if the bitmap were reshaped to a 1n matrix.*

function isTierIdRemoved(mapping(uint256 => uint256) storage self, uint256 index) internal view returns (bool);

removeTier

Set the bit at the given index to true, indicating that the corresponding tier has been removed.

This is a one-way operation.

function removeTier(mapping(uint256 => uint256) storage self, uint256 index) internal;

refreshBitmapNeeded

Check if the specified index is at a different depth than than the current depth of the JBBitmapWord struct.

If the depth is different, the bitmap's current depth needs to be updated.

function refreshBitmapNeeded(JBBitmapWord memory self, uint256 index) internal pure returns (bool);

Returns

NameTypeDescription
<none>boolWhether the bitmap needs to be refreshed.

_retrieveDepth

Return the line number (depth) of a given index within the bitmap matrix.

function _retrieveDepth(uint256 index) internal pure returns (uint256);