Skip to content

Solidity API

SpanningERC721

Implementation of the {ISpanningERC721} interface.

name_

string name_

symbol_

string symbol_

owners_

mapping(uint256 => bytes32) owners_

balances_

mapping(bytes32 => uint256) balances_

tokenApprovals_

mapping(uint256 => bytes32) tokenApprovals_

operatorApprovals_

mapping(bytes32 => mapping(bytes32 => bool)) operatorApprovals_

onlyOwnerOrApproved

modifier onlyOwnerOrApproved(uint256 tokenId)

constructor

constructor(string nameIn, string symbolIn, address delegate) internal

Creates the instance and assigns required values.

NameTypeDescription
nameInstring- Desired name for the token collection
symbolInstring- Desired symbol for the token collection
delegateaddress- Legacy (local) address for the Spanning Delegate

supportsInterface

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

See {IERC165-supportsInterface}.

balanceOf

function balanceOf(address accountLegacyAddress) public view virtual returns (uint256)

See {IERC721-balanceOf}.

balanceOf

function balanceOf(bytes32 accountAddress) public view virtual returns (uint256)

Returns the number of tokens owned by an account.

NameTypeDescription
accountAddressbytes32- Address to be queried
NameTypeDescription
[0]uint256uint256 - Number of tokens owned by an account

ownerOf

function ownerOf(uint256 tokenId) public view virtual returns (address)

See {IERC721-ownerOf}.

ownerOfSpanning

function ownerOfSpanning(uint256 tokenId) public view virtual returns (bytes32)

See {IERC721-ownerOf}.

name

function name() public view virtual returns (string)

See {IERC721Metadata-name}.

symbol

function symbol() public view virtual returns (string)

See {IERC721Metadata-symbol}.

tokenURI

function tokenURI(uint256 tokenId) public view virtual returns (string)

See {IERC721Metadata-tokenURI}.

_baseURI

function _baseURI() internal view virtual returns (string)

Base URI for computing {tokenURI}. If set, the resulting URI for each token will be the concatenation of the baseURI and the tokenId. Empty by default, can be overridden in child contracts.

approve

function approve(address receiverLegacyAddress, uint256 tokenId) public virtual

See {IERC721-approve}.

approve

function approve(bytes32 receiverAddress, uint256 tokenId) public virtual

Sets a token allowance for a pair of addresses (sender and receiver).

NameTypeDescription
receiverAddressbytes32- Address of the allowance receiver
tokenIduint256- Token allowance to be approved

getApproved

function getApproved(uint256 tokenId) public view virtual returns (address)

See {IERC721-getApproved}.

getApprovedSpanning

function getApprovedSpanning(uint256 tokenId) public view virtual returns (bytes32)

Returns the account approved for a token.

NameTypeDescription
tokenIduint256- Token to be queried
NameTypeDescription
[0]bytes32bytes32 - Address of the account approved for a token

setApprovalForAll

function setApprovalForAll(address receiverLegacyAddress, bool shouldApprove) public virtual

See {IERC721-setApprovalForAll}.

setApprovalForAll

function setApprovalForAll(bytes32 receiverAddress, bool shouldApprove) public virtual

Allows an account to have control over another account's tokens.

NameTypeDescription
receiverAddressbytes32- Address of the allowance receiver (gains control)
shouldApprovebool- Whether to approve or revoke the approval

isApprovedForAll

function isApprovedForAll(address senderLegacyAddress, address receiverLegacyAddress) public view virtual returns (bool)

See {IERC721-isApprovedForAll}.

isApprovedForAll

function isApprovedForAll(bytes32 senderAddress, bytes32 receiverAddress) public view virtual returns (bool)

Indicates if an account has total control over another's assets.

NameTypeDescription
senderAddressbytes32- Address of the allowance sender (cede control)
receiverAddressbytes32- Address of the allowance receiver (gains control)
NameTypeDescription
[0]boolbool - Indicates whether the account is approved for all

transferFrom

function transferFrom(address senderLegacyAddress, address receiverLegacyAddress, uint256 tokenId) public virtual

See {IERC721-transferFrom}.

transferFrom

function transferFrom(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId) public virtual

Moves requested tokens between accounts.

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred

safeTransferFrom

function safeTransferFrom(address senderLegacyAddress, address receiverLegacyAddress, uint256 tokenId) public virtual

See {IERC721-safeTransferFrom}.

safeTransferFrom

function safeTransferFrom(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId) public virtual

Safely moves requested tokens between accounts.

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred

safeTransferFrom

function safeTransferFrom(address senderLegacyAddress, address receiverLegacyAddress, uint256 tokenId, bytes payload) public virtual

See {IERC721-safeTransferFrom}.

safeTransferFrom

function safeTransferFrom(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId, bytes payload) public virtual

Safely moves requested tokens between accounts, including data.

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred
payloadbytes- Additional, unstructured data to be included

_safeTransfer

function _safeTransfer(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId, bytes payload) internal virtual

Safely transfers a token between accounts, checking for ERC721 validity.

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred
payloadbytes- Additional, unstructured data to be included

_exists

function _exists(uint256 tokenId) internal view virtual returns (bool)

Checks if the token exists (has been minted but not burned).

NameTypeDescription
tokenIduint256- Token to be checked
NameTypeDescription
[0]boolbool - Whether the token exists

_isApprovedOrOwner

function _isApprovedOrOwner(bytes32 receiverAddress, uint256 tokenId) internal view virtual returns (bool)

Checks if the account is authorized to spend the token.

NameTypeDescription
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be checked
NameTypeDescription
[0]boolbool - Whether the account is authorized to spend the token

_safeMint

function _safeMint(bytes32 receiverAddress, uint256 tokenId) internal virtual

Safely mints a new token to an account

NameTypeDescription
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be minted

_safeMint

function _safeMint(bytes32 receiverAddress, uint256 tokenId, bytes payload) internal virtual

Safely mints a new token to an account

NameTypeDescription
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be minted
payloadbytes- Additional, unstructured data to be included

_mint

function _mint(bytes32 receiverAddress, uint256 tokenId) internal virtual

Mints a new token to an account

NameTypeDescription
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be minted

_burn

function _burn(uint256 tokenId) internal virtual

Burns the token

NameTypeDescription
tokenIduint256- Token to be burned

_transfer

function _transfer(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId) internal virtual

Transfers the token between accounts

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred

_approve

function _approve(bytes32 receiverAddress, uint256 tokenId) internal virtual

Sets a token allowance for a pair of addresses (sender and receiver).

NameTypeDescription
receiverAddressbytes32- Address of the allowance receiver
tokenIduint256- Token allowance to be approved

_setApprovalForAll

function _setApprovalForAll(bytes32 receiverAddress, bool shouldApprove) internal virtual

Allows an account to have control over another account's tokens.

NameTypeDescription
receiverAddressbytes32- Address of the allowance receiver (gains control)
shouldApprovebool- Whether to approve or revoke the approval

_checkOnERC721Received

function _checkOnERC721Received(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId, bytes payload) private returns (bool)

Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. The call is not executed if the target address is not a contract.

NameTypeDescription
senderAddressbytes32- Address of the sender
receiverAddressbytes32- Address of the receiver
tokenIduint256- Token to be transferred
payloadbytes- Additional, unstructured data to be included
NameTypeDescription
[0]boolbool - If call correctly returned the expected magic value

_beforeTokenTransfer

function _beforeTokenTransfer(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId) internal virtual

Hook that is called before any transfer of tokens.

NameTypeDescription
senderAddressbytes32- Address initiating the transfer
receiverAddressbytes32- Address receiving the transfer
tokenIduint256- Token to be transferred

_afterTokenTransfer

function _afterTokenTransfer(bytes32 senderAddress, bytes32 receiverAddress, uint256 tokenId) internal virtual

Hook that is called after any burn of tokens.

NameTypeDescription
senderAddressbytes32- Address sending tokens to burn
receiverAddressbytes32- Unused
tokenIduint256- Token to be burned