Skip to main content

ITokenERC1155

SignatureMint1155 is an ERC 1155 contract. It lets anyone mint NFTs by producing a mint request and a signature (produced by an account with MINTER_ROLE, signing the mint request).

Methods

balanceOf

function balanceOf(address account, uint256 id) external view returns (uint256)

Returns the amount of tokens of token type id owned by account. Requirements: - account cannot be the zero address.

Parameters

NameTypeDescription
accountaddressundefined
iduint256undefined

Returns

NameTypeDescription
_0uint256undefined

balanceOfBatch

function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[])

xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. Requirements: - accounts and ids must have the same length.

Parameters

NameTypeDescription
accountsaddress[]undefined
idsuint256[]undefined

Returns

NameTypeDescription
_0uint256[]undefined

isApprovedForAll

function isApprovedForAll(address account, address operator) external view returns (bool)

Returns true if operator is approved to transfer account's tokens. See {setApprovalForAll}.

Parameters

NameTypeDescription
accountaddressundefined
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

mintTo

function mintTo(address to, uint256 tokenId, string uri, uint256 amount) external nonpayable

Lets an account with MINTER_ROLE mint an NFT.

Parameters

NameTypeDescription
toaddressThe address to mint the NFT to.
tokenIduint256The tokenId of the NFTs to mint
uristringThe URI to assign to the NFT.
amountuint256The number of copies of the NFT to mint.

mintWithSignature

function mintWithSignature(ITokenERC1155.MintRequest req, bytes signature) external payable

Mints an NFT according to the provided mint request.

Parameters

NameTypeDescription
reqITokenERC1155.MintRequestThe mint request.
signaturebyteshe signature produced by an account signing the mint request.

safeBatchTransferFrom

function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable

xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. Emits a {TransferBatch} event. Requirements: - ids and amounts must have the same length. - If to refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
idsuint256[]undefined
amountsuint256[]undefined
databytesundefined

safeTransferFrom

function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable

Transfers amount tokens of token type id from from to to. Emits a {TransferSingle} event. Requirements: - to cannot be the zero address. - If the caller is not from, it must be have been approved to spend from's tokens via {setApprovalForAll}. - from must have a balance of tokens of type id of at least amount. - If to refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
iduint256undefined
amountuint256undefined
databytesundefined

setApprovalForAll

function setApprovalForAll(address operator, bool approved) external nonpayable

Grants or revokes permission to operator to transfer the caller's tokens, according to approved, Emits an {ApprovalForAll} event. Requirements: - operator cannot be the caller.

Parameters

NameTypeDescription
operatoraddressundefined
approvedboolundefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

verify

function verify(ITokenERC1155.MintRequest req, bytes signature) external view returns (bool success, address signer)

Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).

Parameters

NameTypeDescription
reqITokenERC1155.MintRequestThe mint request.
signaturebytesThe signature produced by an account signing the mint request. returns (success, signer) Result of verification and the recovered address.

Returns

NameTypeDescription
successboolundefined
signeraddressundefined

Events

ApprovalForAll

event ApprovalForAll(address indexed account, address indexed operator, bool approved)

Parameters

NameTypeDescription
account indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

TokensMinted

event TokensMinted(address indexed mintedTo, uint256 indexed tokenIdMinted, string uri, uint256 quantityMinted)

Emitted when an account with MINTER_ROLE mints an NFT.

Parameters

NameTypeDescription
mintedTo indexedaddressundefined
tokenIdMinted indexeduint256undefined
uristringundefined
quantityMinteduint256undefined

TokensMintedWithSignature

event TokensMintedWithSignature(address indexed signer, address indexed mintedTo, uint256 indexed tokenIdMinted, ITokenERC1155.MintRequest mintRequest)

Emitted when tokens are minted.

Parameters

NameTypeDescription
signer indexedaddressundefined
mintedTo indexedaddressundefined
tokenIdMinted indexeduint256undefined
mintRequestITokenERC1155.MintRequestundefined

TransferBatch

event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
idsuint256[]undefined
valuesuint256[]undefined

TransferSingle

event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)

Parameters

NameTypeDescription
operator indexedaddressundefined
from indexedaddressundefined
to indexedaddressundefined
iduint256undefined
valueuint256undefined

URI

event URI(string value, uint256 indexed id)

Parameters

NameTypeDescription
valuestringundefined
id indexeduint256undefined