Git Source

Inherits: ERC721A, RulesEngineClientERC721A

Functions

constructor

Constructor for the Example ERC721A token.

Initializes the token with a name and symbol.

constructor(string memory name, string memory symbol) ERC721A(name, symbol);

Parameters

NameTypeDescription
namestringThe name of the token.
symbolstringThe symbol of the token.

mint

Mints new tokens to the specified address.

function mint(address to, uint256 quantity) public payable virtual checksPoliciesERC721AMintAfter(to, quantity);

Parameters

NameTypeDescription
toaddressThe address of the recipient.
quantityuint256The number of tokens to mint.

safeTransferFrom

Safely transfers a token from one address to another.

This function overrides the ERC721A-safeTransferFrom function and interacts with the Rules Engine to ensure compliance with transfer policies. It includes additional checks for policy compliance.

function safeTransferFrom(address from, address to, uint256 tokenId)
    public
    payable
    override
    checksPoliciesERC721ASafeTransferFromBefore(from, to, tokenId);

Parameters

NameTypeDescription
fromaddressThe address of the current token owner.
toaddressThe address of the recipient.
tokenIduint256The ID of the token to transfer.

safeBatchTransferFrom

Safely transfers tokenIds from one address to another.

function safeBatchTransferFrom(address by, address from, address to, uint256[] memory tokenIds, bytes memory data)
    public
    virtual
    checksPoliciesERC721ASafeBatchTransferFromBefore(by, from, to, tokenIds, data);

Parameters

NameTypeDescription
byaddressThe approved address.
fromaddressThe sending address.
toaddressThe receiving address.
tokenIdsuint256[]The token identifiers.
databytesGeneric data to pass along with the transfer.