Skip to content

ERC721 ​

Git Source

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 ​

solidity
string public name;

symbol ​

solidity
string public symbol;

_tokenConfig ​

solidity
mapping(uint256 => uint256) internal _tokenConfig;

_ownerConfig ​

solidity
mapping(address => mapping(uint256 => uint256)) internal _ownerConfig;

totalSupply ​

total amount of tokens stored by the contract.

solidity
uint256 public totalSupply;

getApproved ​

trackes if a NFT id is approved for a certain address.

solidity
mapping(uint256 => address) public getApproved;

isApprovedForAll ​

trackes if all the NFTs of an owner are approved for a certain other address.

solidity
mapping(address => mapping(address => bool)) public isApprovedForAll;

Functions ​

tokenURI ​

solidity
function tokenURI(uint256 id) public view virtual returns (string memory);

ownerOf ​

returns owner_ of NFT with id_

solidity
function ownerOf(uint256 id_) public view virtual returns (address owner_);

balanceOf ​

returns total count of NFTs owned by owner_

solidity
function balanceOf(address owner_) public view virtual returns (uint256);

constructor ​

solidity
constructor(string memory _name, string memory _symbol);

approve ​

approves an NFT with id_ to be spent (transferred) by spender_

solidity
function approve(address spender_, uint256 id_) public virtual;

setApprovalForAll ​

approves all NFTs owned by msg.sender to be spent (transferred) by operator_

solidity
function setApprovalForAll(address operator_, bool approved_) public virtual;

transferFrom ​

transfers an NFT with id_ from_ address to_ address without safe check

solidity
function transferFrom(address from_, address to_, uint256 id_) public virtual;

safeTransferFrom ​

transfers an NFT with id_ from_ address to_ address

solidity
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

solidity
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.

solidity
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.

solidity
function tokenOfOwnerByIndex(address owner_, uint256 index_) external view returns (uint256);

supportsInterface ​

solidity
function supportsInterface(bytes4 interfaceId_) public view virtual returns (bool);

_transfer ​

solidity
function _transfer(address from_, address to_, uint256 id_, uint256 vaultId_) internal;

_add ​

solidity
function _add(address user_, uint256 id_, uint256 vaultId_) private;

_remove ​

solidity
function _remove(address user_, uint256 id_) private;

_mint ​

solidity
function _mint(address to_, uint256 vaultId_) internal virtual returns (uint256 id_);

Events ​

Transfer ​

solidity
event Transfer(address indexed from, address indexed to, uint256 indexed id);

Approval ​

solidity
event Approval(address indexed owner, address indexed spender, uint256 indexed id);

ApprovalForAll ​

solidity
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);