AavegotchiFacet
PetOperatorApprovalForAll
totalSupply
Query the universal totalSupply of all NFTs ever minted
Return Values
Name | Type | Description |
---|---|---|
totalSupply_ | uint256 | the number of all NFTs that have been minted |
balanceOf
Count all NFTs assigned to an owner
NFTs assigned to the zero address are considered invalid, and this. function throws for queries about the zero address.
Parameters
Name | Type | Description |
---|---|---|
_owner | address | An address for whom to query the balance |
Return Values
Name | Type | Description |
---|---|---|
balance_ | uint256 | The number of NFTs owned by |
getAavegotchi
Query all details relating to an NFT
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | the identifier of the NFT to query |
Return Values
Name | Type | Description |
---|---|---|
aavegotchiInfo_ | struct AavegotchiInfo | a struct containing all details about |
aavegotchiClaimTime
returns the time an NFT was claimed
will return 0 if the NFT is still an unclaimed portal
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | the identifier of the NFT |
Return Values
Name | Type | Description |
---|---|---|
claimTime_ | uint256 | the time the NFT was claimed |
tokenByIndex
tokenOfOwnerByIndex
tokenIdsOfOwner
Get all the Ids of NFTs owned by an address
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address to check for the NFTs |
Return Values
Name | Type | Description |
---|---|---|
tokenIds_ | uint32[] | an array of unsigned integers,each representing the tokenId of each NFT |
allAavegotchisOfOwner
Get all details about all the NFTs owned by an address
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address to check for the NFTs |
Return Values
Name | Type | Description |
---|---|---|
aavegotchiInfos_ | struct AavegotchiInfo[] | an array of structs,where each struct contains all the details of each NFT |
batchOwnerOf
ownerOf
Find the owner of an NFT
NFTs assigned to zero address are considered invalid, and queries about them do throw.
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The identifier for an NFT |
Return Values
Name | Type | Description |
---|---|---|
owner_ | address | The address of the owner of the NFT |
getApproved
Get the approved address for a single NFT
Throws if _tokenId
is not a valid NFT.
Parameters
Name | Type | Description |
---|---|---|
_tokenId | uint256 | The NFT to find the approved address for |
Return Values
Name | Type | Description |
---|---|---|
approved_ | address | The approved address for this NFT, or the zero address if there is none |
isApprovedForAll
Query if an address is an authorized operator for another address
Parameters
Name | Type | Description |
---|---|---|
_owner | address | The address that owns the NFTs |
_operator | address | The address that acts on behalf of the owner |
Return Values
Name | Type | Description |
---|---|---|
approved_ | bool | True if |
isPetOperatorForAll
Check if an address _operator
is an authorized pet operator for another address _owner
Parameters
Name | Type | Description |
---|---|---|
_owner | address | address of the lender of the NFTs |
_operator | address | address that acts pets the gotchis on behalf of the owner |
Return Values
Name | Type | Description |
---|---|---|
approved_ | bool | true if |
safeTransferFrom
Transfers the ownership of an NFT from one address to another address
Throws unless LibMeta.msgSender()
is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from
is not the current owner. Throws if _to
is the zero address. Throws if _tokenId
is not a valid NFT. When transfer is complete, this function checks if _to
is a smart contract (code size > 0). If so, it calls onERC721Received
on _to
and throws if the return value is not bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))
.
Parameters
Name | Type | Description |
---|---|---|
_from | address | The current owner of the NFT |
_to | address | The new owner |
_tokenId | uint256 | The NFT to transfer |
_data | bytes | Additional data with no specified format, sent in call to |
safeBatchTransferFrom
Throws unless LibMeta.msgSender()
is the current owner, an authorized operator, or the approved address of each of the NFTs in _tokenIds
. Throws if _from
is not the current owner. Throws if _to
is the zero address. Throws if one of the NFTs in _tokenIds
is not a valid NFT. When transfer is complete, this function checks if _to
is a smart contract (code size > 0). If so, it calls onERC721Received
on _to
and throws if the return value is not bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))
.
Parameters
Name | Type | Description |
---|---|---|
_from | address | The current owner of the NFTs |
_to | address | The new owner |
_tokenIds | uint256[] | An array containing the identifiers of the NFTs to transfer |
_data | bytes | Additional data with no specified format, sent in call to |
safeTransferFrom
Transfers the ownership of an NFT from one address to another address
This works identically to the other function with an extra data parameter, except this function just sets data to "".
Parameters
Name | Type | Description |
---|---|---|
_from | address | The current owner of the NFT |
_to | address | The new owner |
_tokenId | uint256 | The NFT to transfer |
transferFrom
Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE TO CONFIRM THAT _to
IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST
Throws unless LibMeta.msgSender()
is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from
is not the current owner. Throws if _to
is the zero address. Throws if _tokenId
is not a valid NFT.
Parameters
Name | Type | Description |
---|---|---|
_from | address | The current owner of the NFT |
_to | address | The new owner |
_tokenId | uint256 | The NFT to transfer |
approve
Change or reaffirm the approved address for an NFT
The zero address indicates there is no approved address. Throws unless LibMeta.msgSender()
is the current NFT owner, or an authorized operator of the current owner.
Parameters
Name | Type | Description |
---|---|---|
_approved | address | The new approved NFT controller |
_tokenId | uint256 | The NFT to approve |
setApprovalForAll
Enable or disable approval for a third party ("operator") to manage all of LibMeta.msgSender()
's assets
Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner.
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Address to add to the set of authorized operators |
_approved | bool | True if the operator is approved, false to revoke approval |
setPetOperatorForAll
Enable or disable approval for a third party("operator") to help pet LibMeta.msgSender()'s gotchis
Emits the PetOperatorApprovalForAll event
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Address to disable/enable as a pet operator |
_approved | bool | True if operator is approved,False if approval is revoked |
name
Return the universal name of the NFT
symbol
An abbreviated name for NFTs in this contract
tokenURI
A distinct Uniform Resource Identifier (URI) for a given asset.
Throws if _tokenId
is not a valid NFT. URIs are defined in RFC 3986. The URI may point to a JSON file that conforms to the "ERC721 Metadata JSON Schema".