ERC1155Facet

ERC1155Facet

balanceOf

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

query the balance of given token held by given address

Parameters

Name
Type
Description

account

address

address to query

id

uint256

token to query

Return Values

Name
Type
Description

[0]

uint256

token balance

balanceOfBatch

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

query the balances of given tokens held by given addresses

Parameters

Name
Type
Description

accounts

address[]

addresss to query

ids

uint256[]

tokens to query

Return Values

Name
Type
Description

[0]

uint256[]

token balances

isApprovedForAll

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

query approval status of given operator with respect to given address

Parameters

Name
Type
Description

account

address

address to query for approval granted

operator

address

address to query for approval received

Return Values

Name
Type
Description

[0]

bool

whether operator is approved to spend tokens held by account

setApprovalForAll

function setApprovalForAll(address operator, bool status) external

grant approval to or revoke approval from given operator to spend held tokens

Parameters

Name
Type
Description

operator

address

address whose approval status to update

status

bool

whether operator should be considered approved

safeTransferFrom

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

transfer tokens between given addresses, checking for ERC1155Receiver implementation if applicable

Parameters

Name
Type
Description

from

address

sender of tokens

to

address

receiver of tokens

id

uint256

token ID

amount

uint256

quantity of tokens to transfer

data

bytes

data payload

safeBatchTransferFrom

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

transfer batch of tokens between given addresses, checking for ERC1155Receiver implementation if applicable

Parameters

Name
Type
Description

from

address

sender of tokens

to

address

receiver of tokens

ids

uint256[]

list of token IDs

amounts

uint256[]

list of quantities of tokens to transfer

data

bytes

data payload

totalSupply

function totalSupply(uint256 id) public view returns (uint256)

query total minted supply of given token

Parameters

Name
Type
Description

id

uint256

token id to query

Return Values

Name
Type
Description

[0]

uint256

token supply

Was this helpful?