Skip to main content

ITokenERC721

SignatureMint is an ERC 721 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

approve

function approve(address to, uint256 tokenId) external nonpayable

Gives permission to to to transfer tokenId token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - tokenId must exist. Emits an {Approval} event.

Parameters

NameTypeDescription
toaddressundefined
tokenIduint256undefined

balanceOf

function balanceOf(address owner) external view returns (uint256 balance)

Returns the number of tokens in owner's account.

Parameters

NameTypeDescription
owneraddressundefined

Returns

NameTypeDescription
balanceuint256undefined

getApproved

function getApproved(uint256 tokenId) external view returns (address operator)

Returns the account approved for tokenId token. Requirements: - tokenId must exist.

Parameters

NameTypeDescription
tokenIduint256undefined

Returns

NameTypeDescription
operatoraddressundefined

isApprovedForAll

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

Returns if the operator is allowed to manage all of the assets of owner. See {setApprovalForAll}

Parameters

NameTypeDescription
owneraddressundefined
operatoraddressundefined

Returns

NameTypeDescription
_0boolundefined

mintTo

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

Lets an account with MINTER_ROLE mint an NFT.

Parameters

NameTypeDescription
toaddressThe address to mint the NFT to.
uristringThe URI to assign to the NFT.

Returns

NameTypeDescription
_0uint256tokenId of the NFT minted.

mintWithSignature

function mintWithSignature(ITokenERC721.MintRequest req, bytes signature) external payable returns (uint256)

Parameters

NameTypeDescription
reqITokenERC721.MintRequestundefined
signaturebytesundefined

Returns

NameTypeDescription
_0uint256undefined

ownerOf

function ownerOf(uint256 tokenId) external view returns (address owner)

Returns the owner of the tokenId token. Requirements: - tokenId must exist.

Parameters

NameTypeDescription
tokenIduint256undefined

Returns

NameTypeDescription
owneraddressundefined

safeTransferFrom

function safeTransferFrom(address from, address to, uint256 tokenId) external nonpayable

Safely transfers tokenId token from from to to, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

safeTransferFrom

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

Safely transfers tokenId token from from to to. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must exist and be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. - If to refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined
databytesundefined

setApprovalForAll

function setApprovalForAll(address operator, bool _approved) external nonpayable

Approve or remove operator as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The operator cannot be the caller. Emits an {ApprovalForAll} event.

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

transferFrom

function transferFrom(address from, address to, uint256 tokenId) external nonpayable

Transfers tokenId token from from to to. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - from cannot be the zero address. - to cannot be the zero address. - tokenId token must be owned by from. - If the caller is not from, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event.

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
tokenIduint256undefined

verify

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

Parameters

NameTypeDescription
reqITokenERC721.MintRequestundefined
signaturebytesundefined

Returns

NameTypeDescription
successboolundefined
signeraddressundefined

Events

Approval

event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)

Parameters

NameTypeDescription
owner indexedaddressundefined
approved indexedaddressundefined
tokenId indexeduint256undefined

ApprovalForAll

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

Parameters

NameTypeDescription
owner indexedaddressundefined
operator indexedaddressundefined
approvedboolundefined

TokensMinted

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

Emitted when an account with MINTER_ROLE mints an NFT.

Parameters

NameTypeDescription
mintedTo indexedaddressundefined
tokenIdMinted indexeduint256undefined
uristringundefined

TokensMintedWithSignature

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

Emitted when tokens are minted.

Parameters

NameTypeDescription
signer indexedaddressundefined
mintedTo indexedaddressundefined
tokenIdMinted indexeduint256undefined
mintRequestITokenERC721.MintRequestundefined

Transfer

event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)

Parameters

NameTypeDescription
from indexedaddressundefined
to indexedaddressundefined
tokenId indexeduint256undefined