ERC721
Inherits: Context
, ERC165
, IERC721
, IERC721Metadata
Doesn't track balances.
Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including the Metadata extension, but not including the Enumerable extension, which is available separately as ERC721Enumerable.
State Variables
_name
string private _name;
_symbol
string private _symbol;
_owners
mapping(uint256 => address) internal _owners;
_tokenApprovals
mapping(uint256 => address) private _tokenApprovals;
_operatorApprovals
mapping(address => mapping(address => bool)) private _operatorApprovals;
Functions
_initialize
Initializes the contract by setting a name
and a symbol
to the token collection.
function _initialize(string memory name_, string memory symbol_) internal;
supportsInterface
See IERC165-supportsInterface.
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool);
balanceOf
Balance tracking to be overriden by childs
function balanceOf(address owner) external view virtual override returns (uint256 balance);
ownerOf
See IERC721-ownerOf.
function ownerOf(uint256 tokenId) public view virtual override returns (address);
name
See IERC721Metadata-name.
function name() public view virtual override returns (string memory);
symbol
See IERC721Metadata-symbol.
function symbol() public view virtual override returns (string memory);
tokenURI
See IERC721Metadata-tokenURI.
function tokenURI(uint256 tokenId) public view virtual override returns (string memory);
_baseURI
Base URI for computing tokenURI. If set, the resulting URI for each
token will be the concatenation of the baseURI
and the tokenId
. Empty
by default, can be overridden in child contracts.
function _baseURI() internal view virtual returns (string memory);
approve
See IERC721-approve.
function approve(address to, uint256 tokenId) public virtual override;
getApproved
See IERC721-getApproved.
function getApproved(uint256 tokenId) public view virtual override returns (address);
setApprovalForAll
See IERC721-setApprovalForAll.
function setApprovalForAll(address operator, bool approved) public virtual override;
isApprovedForAll
See IERC721-isApprovedForAll.
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool);
transferFrom
See IERC721-transferFrom.
function transferFrom(address from, address to, uint256 tokenId) public virtual override;
safeTransferFrom
See IERC721-safeTransferFrom.
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override;