ERC721
A smart contract interface standard for non-fungible tokens.
Our docs are now available at dune.com/docs. We'll keep this around as a reference, but we won't update them and eventually plan to deprecate.

ERC721 definition

The ERC721 standard is the token standard that is used for non-fungible assets on all EVM blockchains. ERC721s can represent digital art, a deed to a house, an insurance policy or even a uniswap V3 liquidity position. The shared property of all these things is that they are not fungible and therefore unique. ERC721 tokens are uniquely identified by a combination of contract_address and tokenId. There only ever can exist one of each tokenId within each smart contract. an optional feature of the interface is a tokenURI property in which the associated media content of the tokenId within this smart contract is stored. This mostly is links to decentralized storage solutions like ifps.
The standard contains many functions similar to ERC20 tokens as it was influenced by it, but does expand on the functionality **** due to the added complexity regarding tokenId.
Methods
function balanceOf(address _owner) external view returns (uint256);
/* returns the amount of tokens a certain address(_owner) contains */
function ownerOf(uint256 _tokenId) external view returns (address);
/* returns the owner of a specific NFT, identified by it's tokenId*/
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
/* is used to transfer a specific token from the sender(_from) to the receiver(_to)*/
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
/* is used to transfer a specific token from the sender(_from) to the receiver(_to)*/
function approve(address _approved, uint256 _tokenId) external payable;
/* is used to allow a certain address to move a specific tokenID */
function setApprovalForAll(address _operator, bool _approved) external;
/* is used to allow a certain address to move any tokenID */
function getApproved(uint256 _tokenId) external view returns (address);
/* returns which address is currently able to move this token. Only one can be active at a time.*/
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
/* Tells whether an operator is approved by a given owner. */
Events
event Transfer(address _from, address _to, uint256 _tokenId);
/* gets emitted upon successfull transfer of a token. Only one unit can ever be transferred at a time*/
event Approval(address _owner, address _approved, uint256 _tokenId);
/* gets emitted upon the approval of an operator for a specific tokenId */
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
/* gets emitted upon the approval of an operator for all tokens of this collection */

Tables in Dune

In Dune, we decode all erc721 transfer events from all smart contracts into one table erc721."ERC721_evt_Transfer".

erc721."ERC721_evt_Transfer"

This is the event that gets emitted upon successful transfer of a token within a ERC721 smart contract. This can be triggered by either the safeTransferFrom or the transferFrom functions.
from
bytea
the sender of the ERC721 token
to
bytea
the receiver of the ERC721 token
tokenID
numeric
The Token ID which uniquely identifies this NFT
contract_address
bytea
the contract_address of this ERC721 token
evt_tx_hash
bytea
the transaction hash in which this event got emitted
evt_index
numeric
this logs index position in the block (cumulative amount of logs ordered by execution)
evt_block_time
timestamptz
the time at which the block that contains this event log got mined
evt_block_number
int8
the length of the blockchain

erc721."ERC721_evt_Approval"

This is the event that gets emitted upon a successful call of the approve function.
owner
bytea
the address which gives permission to move this token
approved
bytea
the operator which is able to move the specified tokenId
tokenId
numeric
the tokenId in question
contract_address
bytea
the contract_address of this ERC721 token
evt_tx_hash
bytea
the transaction hash in which this event got emitted
evt_index
bigint
this logs index position in the block (cumulative amount of logs ordered by execution)
evt_block_time
timestamp with time zone
the time at which the block that contains this event log got mined
evt_block_number
bigint
the length of the blockchain
Last modified 7d ago
Copy link
On this page
ERC721 definition
Tables in Dune