Skip to content

Series1155V1

bytes32 MINTER_ROLE
bytes32 METADATA_ROLE
bytes32 PAUSER_ROLE
bytes32 ROYALTY_ROLE
bytes32 ADMIN_ROLE
bool contractUriFrozen

Indicates if the contract URI is frozen

bool royaltyFrozen

Indicates if the royalty is frozen

event SeriesCreated(uint256 seriesId, string uri, bool isFungible)

A new series is registered.

NameTypeDescription
seriesIduint256Unique identifier for the series.
uristringIPFS base URI for the series metadata (e.g. “ipfs://“).
isFungibleboolTrue if the series is fungible, false for 1-of-1 NFTs.
event SeriesMetadataUpdated(uint256 seriesId, string oldUri, string newUri)

Series metadata URI updated.

NameTypeDescription
seriesIduint256Series identifier.
oldUristringPrevious IPFS base URI.
newUristringNew IPFS base URI.
event SeriesMetadataFrozen(uint256 seriesId, string uri)

Series metadata permanently frozen.

NameTypeDescription
seriesIduint256Series identifier.
uristringFrozen IPFS base URI.
event SeriesTokensMinted(uint256 seriesId, address to, uint256[] tokenIds, uint256[] amounts, bool isFungible)

Tokens minted for a series.

NameTypeDescription
seriesIduint256Series identifier.
toaddressRecipient address.
tokenIdsuint256[]List of token IDs minted.
amountsuint256[]Corresponding amounts minted for each token ID.
isFungibleboolTrue if the series is fungible.
event ContractURIFrozen(string uri)

Contract-level metadata URI frozen.

NameTypeDescription
uristringFrozen contract-level URI.
event RoyaltySet(address receiver, uint96 feeBps)

Default royalty configured.

NameTypeDescription
receiveraddressRoyalty recipient address.
feeBpsuint96Royalty fee in basis points.
event RoyaltyCleared()

Default royalty removed.

event RoyaltyFrozen()

Default royalty frozen and can no longer be changed.

event MaxAtomicOperationUpdated(uint256 oldLimit, uint256 newLimit)

_maxAtomicOperation updated.

NameTypeDescription
oldLimituint256Previous limit.
newLimituint256New limit.
event PermanentURI(string uri, uint256 tokenId)

Token-level metadata permanently frozen (OpenSea compliant).

https://docs.opensea.io/docs/metadata-standards#freezing-metadata

NameTypeDescription
uristringFull metadata URI.
tokenIduint256Token identifier.
error SeriesNotFound()

Series does not exist.

error InvalidCID()

IPFS CID is not valid CIDv0.

error SeriesFrozen()

Series metadata is frozen (immutable).

error SeriesAlreadyExists()

Series ID already exists.

error LengthMismatch()

tokenIds and amounts array lengths mismatch.

error NFTAmountMustBeOne()

Amount must be 1 for non-fungible tokens.

error DuplicateTokenId()

Token ID already minted in this series.

error TokenInDifferentSeries()

Token ID belongs to a different series.

error URIFrozen()

Contract URI is frozen.

error SeriesTooLarge(uint256 seriesSize, uint256 maxAtomicOperation)

Series size exceeds _maxAtomicOperation.

error ZeroAtomicLimit()

Atomic operation limit cannot be zero.

error InvalidLimit()

Limit parameter is zero or exceeds maximum.

error RoyaltyAlreadyFrozen()

Royalties are frozen.

error RoyaltyTooHigh()

Royalty fee exceeds maximum basis points.

error ZeroAmount()

Amount must be greater than zero.

error ZeroAddress()

Zero address.

error UpdateInProgress()

A metadata update is currently in progress for the series.

error NoPendingEvents()

No pending batch events to emit.

modifier seriesExists(uint256 seriesId)

Modifier to check if a series exists

NameTypeDescription
seriesIduint256Series ID to check
function initialize(string contractUri) external

Initialize the contract

NameTypeDescription
contractUristringContract Metadata URI
function _authorizeUpgrade(address) internal virtual

required by the OZ UUPS module

function createSeries(string cid, bool isFungible) external returns (uint256 seriesId)

Register a new metadata series.

The seriesId is the keccak256 hash of the raw IPFS CID, making the mapping deterministic across chains. Reverts with: - {InvalidCID} if cid is not a valid CIDv0 - {SeriesAlreadyExists} if the hash is already registered

NameTypeDescription
cidstringRaw IPFS content identifier (CID) that forms the folder for metadata.
isFungiblebooltrue → tokens in this series may be multi‑minted; false → every tokenId is a unique 1‑of‑1 NFT.
NameTypeDescription
seriesIduint256Deterministic identifier assigned to the series. Emits {SeriesCreated}. Requirements: - caller has METADATA_ROLE - contract is not paused
function updateSeriesInit(uint256 seriesId, string cid) external

Start a streamed metadata‑update for a large series.

Stores newCid, resets the internal cursor and emits a single {SeriesMetadataUpdated}. Event emission must be finished via successive calls to {updateSeriesEmit} until it reverts with {NoPendingEvents}.

NameTypeDescription
seriesIduint256Target series.
cidstringNew IPFS CID.
function updateSeriesEmit(uint256 seriesId, uint256 limit) external returns (bool hasMore)

Continue a streamed metadata‑update started with {updateSeriesInit}.

Emits up to limit {URI} events from the current cursor. Reverts with: - {InvalidLimit} if limit is 0 or above _maxAtomicOperation - {NoPendingEvents} once the last token has been processed

NameTypeDescription
seriesIduint256Target series.
limituint256Max tokens to process this call.
NameTypeDescription
hasMoreboolTrue if there are more tokens to process, false if the update is complete.
function freezeSeriesInit(uint256 seriesId) external

Begin a streamed metadata‑freeze for a large series.

Sets the frozen flag, resets the cursor and emits one {SeriesMetadataFrozen}. Actual PermanentURI emission is delegated to {freezeSeriesEmit}.

NameTypeDescription
seriesIduint256Target series.
function freezeSeriesEmit(uint256 seriesId, uint256 limit) external returns (bool hasMore)

Continue a streamed metadata‑freeze started with {freezeSeriesInit}.

Emits up to limit {PermanentURI} events and advances the cursor. Reverts with: - {InvalidLimit} if limit is 0 or above _maxAtomicOperation - {NoPendingEvents} once all tokens are processed

NameTypeDescription
seriesIduint256Target series.
limituint256Max tokens to process this call.
function mintBatch(address to, uint256 seriesId, uint256[] tokenIds, uint256[] amounts) external

Mint tokens in a series

NameTypeDescription
toaddressAddress to mint tokens to
seriesIduint256ID of the series
tokenIdsuint256[]Array of token IDs to mint
amountsuint256[]Array of amounts to mint for each token
function seriesCount() external view returns (uint256)

Total number of series that have ever been created.

function listSeries(uint256 offset, uint256 limit) external view returns (uint256[] seriesIds, string[] uris)

List series IDs and their CIDs with pagination.

NameTypeDescription
offsetuint256Starting index in the global series array.
limituint256Maximum items to return.
NameTypeDescription
seriesIdsuint256[]Array of series IDs.
urisstring[]Array of corresponding IPFS CIDs.
function seriesTokenCount(uint256 seriesId) external view returns (uint256)

Get the number of tokens in a series

NameTypeDescription
seriesIduint256ID of the series
NameTypeDescription
[0]uint256count Number of tokens in the series
function seriesTokens(uint256 seriesId, uint256 offset, uint256 limit) external view returns (uint256[] tokens)

Get tokens in a series with pagination

NameTypeDescription
seriesIduint256ID of the series
offsetuint256Starting index
limituint256Maximum number of tokens to return
NameTypeDescription
tokensuint256[]Array of token IDs in the series
function tokenSeries(uint256 tokenId) external view returns (uint256)

Get the series ID for a token

NameTypeDescription
tokenIduint256ID of the token
NameTypeDescription
[0]uint256seriesId ID of the series the token belongs to
function uri(uint256 tokenId) public view virtual returns (string)

Get the URI for a token

see {ERC1155-uri}

function contractURI() public view returns (string)

Returns the contract-level metadata URI (OpenSea compliant).

function setContractURI(string newContractUri) external

Set the contract-level metadata URI

NameTypeDescription
newContractUristringThe new contract-level metadata URI
function freezeContractURI() external

Freeze the contract-level metadata URI

function setRoyalty(address receiver, uint96 feeBps) external

Set the default royalty for the contract

NameTypeDescription
receiveraddressThe address to receive the royalty
feeBpsuint96The royalty fee in basis points
function clearRoyalty() external
function freezeRoyalties() external
function setMaxAtomicOperation(uint256 newLimit) external

Update {_maxAtomicOperation} cap.

function pause() external
function unpause() external
function _processMint(uint256 seriesId, uint256 tokenId, uint256 amount, bool fungible, bool frozen) internal

When a series is frozen, new token IDs cannot be minted. However, existing fungible tokens in the series can still be minted.

function isCid(string cid) internal pure returns (bool)
function cidIdToUri(string cid, uint256 id) public pure returns (string)
function supportsInterface(bytes4 interfaceId) public view returns (bool)

See {IERC165-supportsInterface}.

function _update(address from, address to, uint256[] ids, uint256[] values) internal

_Transfers a value amount of tokens of type id from from to to. Will mint (or burn) if from (or to) is the zero address.

Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.

Requirements:

  • If to refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
  • ids and values must have the same length.

NOTE: The ERC-1155 acceptance check is not performed in this function. See {updateWithAcceptanceCheck} instead.