Skip to content

Solidity API

PropsERC1155

This contract implements the ERC1155 standard with additional functionality

Inherits from PropsBaseFacet and PropsERC1155Base

init

solidity
function init(string name, string symbol, string description, string baseURI, string contractURI, uint256 startTokenIndex) external

Initializes the contract with metadata and sets up interface support

Can only be called by the diamond owner or factory

Parameters

NameTypeDescription
namestringThe name of the token collection
symbolstringThe symbol of the token collection
descriptionstringA description of the token collection
baseURIstringThe base URI for token metadata
contractURIstringThe URI for contract-level metadata
startTokenIndexuint256The starting index for token IDs

mint

solidity
function mint(address account, uint256 id, uint256 amount) external

Mints a single token

Reverts if the account is sanctioned

Parameters

NameTypeDescription
accountaddressThe address to receive the minted token
iduint256The token ID to mint
amountuint256The amount of tokens to mint

mintBatch

solidity
function mintBatch(address account, uint256[] ids, uint256[] amounts) external

Mints multiple tokens in a batch

Reverts if the account is sanctioned

Parameters

NameTypeDescription
accountaddressThe address to receive the minted tokens
idsuint256[]An array of token IDs to mint
amountsuint256[]An array of amounts for each token ID

burn

solidity
function burn(address account, uint256 id, uint256 amount) external

Burns a single token

Reverts if the account is sanctioned

Parameters

NameTypeDescription
accountaddressThe address from which to burn the token
iduint256The token ID to burn
amountuint256The amount of tokens to burn

burnBatch

solidity
function burnBatch(address account, uint256[] ids, uint256[] amounts) external

Burns multiple tokens in a batch

Reverts if the account is sanctioned

Parameters

NameTypeDescription
accountaddressThe address from which to burn the tokens
idsuint256[]An array of token IDs to burn
amountsuint256[]An array of amounts for each token ID

supportsInterface

solidity
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

Checks if the contract supports a given interface

Overrides the supportsInterface function from ERC165

Parameters

NameTypeDescription
interfaceIdbytes4The interface identifier, as specified in ERC-165

Return Values

NameTypeDescription
[0]boolbool True if the contract supports the interface, false otherwise