ERC721
Inherits:Error
Authors: Instadapp, Modified Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol)
Fluid Vault Factory ERC721 base contract. Implements the ERC721 standard, based on Solmate. In addition, implements ERC721 Enumerable. Modern, minimalist, and gas efficient ERC-721 with Enumerable implementation.
State Variables
name
string public name;
symbol
string public symbol;
_tokenConfig
mapping(uint256 => uint256) internal _tokenConfig;
_ownerConfig
mapping(address => mapping(uint256 => uint256)) internal _ownerConfig;
totalSupply
total amount of tokens stored by the contract.
uint256 public totalSupply;
getApproved
trackes if a NFT id is approved for a certain address.
mapping(uint256 => address) public getApproved;
isApprovedForAll
trackes if all the NFTs of an owner are approved for a certain other address.
mapping(address => mapping(address => bool)) public isApprovedForAll;
Functions
tokenURI
function tokenURI(uint256 id) public view virtual returns (string memory);
ownerOf
returns owner_
of NFT with id_
function ownerOf(uint256 id_) public view virtual returns (address owner_);
balanceOf
returns total count of NFTs owned by owner_
function balanceOf(address owner_) public view virtual returns (uint256);
constructor
constructor(string memory _name, string memory _symbol);
approve
approves an NFT with id_
to be spent (transferred) by spender_
function approve(address spender_, uint256 id_) public virtual;
setApprovalForAll
approves all NFTs owned by msg.sender to be spent (transferred) by operator_
function setApprovalForAll(address operator_, bool approved_) public virtual;
transferFrom
transfers an NFT with id_
from_
address to_
address without safe check
function transferFrom(address from_, address to_, uint256 id_) public virtual;
safeTransferFrom
transfers an NFT with id_
from_
address to_
address
function safeTransferFrom(address from_, address to_, uint256 id_) public virtual;
safeTransferFrom
transfers an NFT with id_
from_
address to_
address, passing data_
to onERC721Received
callback
function safeTransferFrom(address from_, address to_, uint256 id_, bytes calldata data_) public virtual;
tokenByIndex
Returns a token ID at a given index_
of all the tokens stored by the contract.
Use along with {totalSupply} to enumerate all tokens.
function tokenByIndex(uint256 index_) external view returns (uint256);
tokenOfOwnerByIndex
Returns a token ID owned by owner_
at a given index_
of its token list.
Use along with balanceOf to enumerate all of owner_
's tokens.
function tokenOfOwnerByIndex(address owner_, uint256 index_) external view returns (uint256);
supportsInterface
function supportsInterface(bytes4 interfaceId_) public view virtual returns (bool);
_transfer
function _transfer(address from_, address to_, uint256 id_, uint256 vaultId_) internal;
_add
function _add(address user_, uint256 id_, uint256 vaultId_) private;
_remove
function _remove(address user_, uint256 id_) private;
_mint
function _mint(address to_, uint256 vaultId_) internal virtual returns (uint256 id_);
Events
Transfer
event Transfer(address indexed from, address indexed to, uint256 indexed id);
Approval
event Approval(address indexed owner, address indexed spender, uint256 indexed id);
ApprovalForAll
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);