Private ERC721

The Private ERC721 is an abstract implementation of the ERC721 Non-Fungible Token (NFT) Standard. It includes essential features of the standard, such as token ownership, approval, transfers, and safe transfers. This contract implements key components of the ERC721 standard while maintaining support for token metadata, but without fully implementing the metadata extension.

Core

Usage

// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "@coti-io/coti-contracts/contracts/token/PrivateERC721/PrivateERC721.sol";

contract MyNFT is PrivateERC721 {
    constructor() PrivateERC721("Private NFT", "PNFT") {}
}

Functions

constructor(string memory name_, string memory symbol_)
function supportsInterface(bytes4 interfaceId) view returns (bool)
function balanceOf(address owner) view returns (uint256)
function ownerOf(uint256 tokenId) view returns (address)
function name() view returns (string memory)
function symbol() view returns (string memory)
function approve(address to, uint256 tokenId)
function getApproved(uint256 tokenId) view returns (address)
function setApprovalForAll(address operator, bool approved)
function isApprovedForAll(address owner, address operator) view returns (bool)
function transferFrom(address from, address to, uint256 tokenId)
function safeTransferFrom(address from, address to, uint256 tokenId)
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
function _ownerOf(uint256 tokenId) view returns (address)
function _getApproved(uint256 tokenId) view returns (address)
function _isAuthorized(address owner, address spender, uint256 tokenId) view returns (bool)
function _checkAuthorized(address owner, address spender, uint256 tokenId) view
function _increaseBalance(address account, uint128 value)
function _update(address to, uint256 tokenId, address auth) returns (address)
function _mint(address to, uint256 tokenId)
function _safeMint(address to, uint256 tokenId)
function _safeMint(address to, uint256 tokenId, bytes memory data)
function _burn(uint256 tokenId)
function _transfer(address from, address to, uint256 tokenId)
function _safeTransfer(address from, address to, uint256 tokenId)
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data)
function _approve(address to, uint256 tokenId, address auth)
function _approve(address to, uint256 tokenId, address auth, bool emitEvent)
function _setApprovalForAll(address owner, address operator, bool approved)
function _requireOwned(uint256 tokenId) view returns (address)

Events

event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)
event ApprovalForAll(address indexed owner, address indexed operator, bool approved)

Errors

error ERC721InvalidOwner(address owner)
error ERC721NonexistentToken(uint256 tokenId)
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner)
error ERC721InvalidSender(address sender)
error ERC721InvalidReceiver(address receiver)
error ERC721InsufficientApproval(address operator, uint256 tokenId)
error ERC721InvalidApprover(address approver)
error ERC721InvalidOperator(address operator)

Extensions

PrivateERC721URIStorage

Usage

// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "@coti-io/coti-contracts/contracts/token/PrivateERC721/extensions/PrivateERC721URIStorage.sol";

contract MyNFT is PrivateERC721URIStorage {
    constructor() PrivateERC721("Private NFT", "PNFT") {}
}

Functions

function tokenURI(uint256 tokenId) view returns (ctString memory)
function _setTokenURI(address to, uint256 tokenId, itString calldata itTokenURI)
function _update(address to, uint256 tokenId, address auth) returns (address)

Errors

error ERC721URIStorageNonMintedToken(uint256 tokenId)

Last updated