wNFT1155

Wrapper contract for original ERC-1155 collection contract

_owners

mapping(uint256 => address) _owners

Mapping from token ID to owner address

InvalidTokenId

error InvalidTokenId(uint256 tokenId)

Trigged when non existing tokenId is queried

Parameters

Name
Type
Description

tokenId

uint256

Token identifier

MultipleOwnersNotAllowed

error MultipleOwnersNotAllowed(uint256 tokenId)

Trigged when minting of already minted ERC-1155 token is attempted This is due to limitation of the sistem that only unique (non-fungible) tokens are supported by protocol

Parameters

Name
Type
Description

tokenId

uint256

Token identifier

initialize

Initializer method

Parameters

Name
Type
Description

renfter_

address

renfter contract address

uri

balanceOf

Please be aware that balanceOf may be invalid due to token not being moved immitiatly after rent expiration but only after token is rented again or resetOwnership is called

_See {IERC1155-balanceOf}.

Requirements:

  • account cannot be the zero address._

balanceOfBatch

Please be aware that balanceOf may be invalid due to token not being moved immitiatly after rent expiration but only after token is rented again or resetOwnership is called

_See {IERC1155-balanceOfBatch}.

Requirements:

  • accounts and ids must have the same length._

safeTransferFrom

See {IERC1155-safeTransferFrom}.

safeBatchTransferFrom

See {IERC1155-safeBatchTransferFrom}.

adminTransfer

Transfers tokenId from current owner to to

Parameters

Name
Type
Description

to

address

Receiver address

tokenId

uint256

Token identifier

mint

Mints new token

Parameters

Name
Type
Description

to

address

Address token is minted for

tokenId

uint256

Token identifier

amount

uint256

Amount of tokens minted

burn

Burns token from owners account

Parameters

Name
Type
Description

tokenId

uint256

Token identifier

amount

uint256

Amount of token burnt

exists

Checks if token with passed ID exists

Return Values

Name
Type
Description

[0]

bool

Flag determinating if token exists

ownerOf

Returns owner of token with given identifier

Parameters

Name
Type
Description

tokenId

uint256

Token identifier

Return Values

Name
Type
Description

[0]

address

Owner address

_beforeTokenTransfer

_afterTokenTransfer

_Hook that is called after any token transfer. This includes minting and burning, as well as batched variants.

The same hook is called on both single and batched variants. For single transfers, the length of the id and amount arrays will be 1.

Calling conditions (for each id and amount pair):

  • When from and to are both non-zero, amount of from's tokens of token type id will be transferred to to.

  • When from is zero, amount tokens of token type id will be minted for to.

  • when to is zero, amount of from's tokens of token type id will be burned.

  • from and to are never both zero.

  • ids and amounts have the same, non-zero length.

To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]._

Last updated