RelationAdjacencies

Git Source

Inherits: OmniRegistryErrors, Initializable

Stores and verifies relation adjacency specs

State Variables

RELATIONADJACENCIES_STORAGE_LOCATION

Deterministic storage slot per ERC-7201

keccak256(abi.encode(uint256(keccak256("every.storage.RelationAdjacencies")) - 1)) & ~bytes32(uint256(0xff))

bytes32 private constant RELATIONADJACENCIES_STORAGE_LOCATION =
    0x8f9f6b9dd32d65efadc33d5cec42974db93f3ef45f03c2694c960af8740c1c00;

Functions

_getRelationAdjacenciesStorage

function _getRelationAdjacenciesStorage() private pure returns (RelationAdjacenciesStorage storage $);

__RelationAdjacencies_init

function __RelationAdjacencies_init() internal onlyInitializing;

_insert

function _insert(Adjacency[] memory adjs) internal returns (bytes32 specId);

_admit

function _admit(bytes32 specId, uint48 kind)
    internal
    view
    returns (bool admit, uint48 effKind, uint16 effDegs, uint48 totalKind, uint16 totalDegs);

_validate

function _validate(Adjacency[] memory adjs) internal pure returns (SpecIndex memory result);

_hash

function _hash(Adjacency[] memory adjs) private pure returns (bytes32 specId);

_hash

function _hash(bytes32 a0, bytes32 a1, bytes32 a2, bytes32 a3) private pure returns (bytes32 specId);

Structs

KindIndex

struct KindIndex {
    uint16 kindDegs;
    uint16 totalDegs;
    bool status;
    bool totalSpecified;
}

SpecIndex

struct SpecIndex {
    uint16 othersDegs;
    uint16 totalDegs;
    bool status;
    bool totalSpecified;
    bool othersSpecified;
    uint8 kindsSpecified;
}

RelationAdjacenciesStorage

Note: storage-location: erc7201:every.storage.RelationAdjacencies

struct RelationAdjacenciesStorage {
    mapping(bytes32 => mapping(uint48 => KindIndex)) kindIndices;
    mapping(bytes32 => SpecIndex) specIndices;
}