Skip to content

Solidity API

PropsRoyaltyStorage

Library for managing royalty information storage for ERC2981 implementation

This library uses the diamond storage pattern for upgradeable contracts

RoyaltyInfo

Struct to store royalty information for a receiver

Parameters

NameTypeDescription
solidity
struct RoyaltyInfo {
  address receiver;
  uint96 royaltyFraction;
}

Layout

Layout struct for organizing royalty storage

Uses a mapping to store token-specific royalty info

solidity
struct Layout {
  struct PropsRoyaltyStorage.RoyaltyInfo defaultRoyaltyInfo;
  mapping(uint256 => struct PropsRoyaltyStorage.RoyaltyInfo) tokenRoyaltyInfo;
  uint96 defaultRoyaltyBips;
}

STORAGE_SLOT

solidity
bytes32 STORAGE_SLOT

Unique storage slot for the PropsRoyaltyStorage

Uses keccak256 hash to generate a unique slot for diamond storage pattern

layout

solidity
function layout() internal pure returns (struct PropsRoyaltyStorage.Layout l)

Provides access to the storage layout

Uses assembly to access the storage slot

Return Values

NameTypeDescription
lstruct PropsRoyaltyStorage.LayoutThe storage layout struct