Appearance
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) externalInitializes the contract with metadata and sets up interface support
Can only be called by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the token collection |
| symbol | string | The symbol of the token collection |
| description | string | A description of the token collection |
| baseURI | string | The base URI for token metadata |
| contractURI | string | The URI for contract-level metadata |
| startTokenIndex | uint256 | The starting index for token IDs |
mint
solidity
function mint(address account, uint256 id, uint256 amount) externalMints a single token
Reverts if the account is sanctioned
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to receive the minted token |
| id | uint256 | The token ID to mint |
| amount | uint256 | The amount of tokens to mint |
mintBatch
solidity
function mintBatch(address account, uint256[] ids, uint256[] amounts) externalMints multiple tokens in a batch
Reverts if the account is sanctioned
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to receive the minted tokens |
| ids | uint256[] | An array of token IDs to mint |
| amounts | uint256[] | An array of amounts for each token ID |
burn
solidity
function burn(address account, uint256 id, uint256 amount) externalBurns a single token
Reverts if the account is sanctioned
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address from which to burn the token |
| id | uint256 | The token ID to burn |
| amount | uint256 | The amount of tokens to burn |
burnBatch
solidity
function burnBatch(address account, uint256[] ids, uint256[] amounts) externalBurns multiple tokens in a batch
Reverts if the account is sanctioned
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address from which to burn the tokens |
| ids | uint256[] | An array of token IDs to burn |
| amounts | uint256[] | 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
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | The interface identifier, as specified in ERC-165 |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | bool True if the contract supports the interface, false otherwise |