The is an abstract implementation of the . 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
Copy // 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
Copy constructor(string memory name_, string memory symbol_)
Copy function supportsInterface(bytes4 interfaceId) view returns (bool)
Copy function balanceOf(address owner) view returns (uint256)
Copy function ownerOf(uint256 tokenId) view returns (address)
Copy function name() view returns (string memory)
Copy function symbol() view returns (string memory)
Copy function approve(address to, uint256 tokenId)
Copy function getApproved(uint256 tokenId) view returns (address)
Copy function setApprovalForAll(address operator, bool approved)
Copy function isApprovedForAll(address owner, address operator) view returns (bool)
Copy function transferFrom(address from, address to, uint256 tokenId)
Copy function safeTransferFrom(address from, address to, uint256 tokenId)
Copy function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
Copy function _ownerOf(uint256 tokenId) view returns (address)
Copy function _getApproved(uint256 tokenId) view returns (address)
Copy function _isAuthorized(address owner, address spender, uint256 tokenId) view returns (bool)
Copy function _checkAuthorized(address owner, address spender, uint256 tokenId) view
Copy function _increaseBalance(address account, uint128 value)
Copy function _update(address to, uint256 tokenId, address auth) returns (address)
Copy function _mint(address to, uint256 tokenId)
Copy function _safeMint(address to, uint256 tokenId)
Copy function _safeMint(address to, uint256 tokenId, bytes memory data)
Copy function _burn(uint256 tokenId)
Copy function _transfer(address from, address to, uint256 tokenId)
Copy function _safeTransfer(address from, address to, uint256 tokenId)
Copy function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data)
Copy function _approve(address to, uint256 tokenId, address auth)
Copy function _approve(address to, uint256 tokenId, address auth, bool emitEvent)
Copy function _setApprovalForAll(address owner, address operator, bool approved)
Copy function _requireOwned(uint256 tokenId) view returns (address)
Events
Copy event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
Copy event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId)
Copy event ApprovalForAll(address indexed owner, address indexed operator, bool approved)
Errors
Copy error ERC721InvalidOwner(address owner)
Copy error ERC721NonexistentToken(uint256 tokenId)
Copy error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner)
Copy error ERC721InvalidSender(address sender)
Copy error ERC721InvalidReceiver(address receiver)
Copy error ERC721InsufficientApproval(address operator, uint256 tokenId)
Copy error ERC721InvalidApprover(address approver)
Copy error ERC721InvalidOperator(address operator)
Extensions
PrivateERC721URIStorage
Usage
Copy // 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
Copy function tokenURI(uint256 tokenId) view returns (ctString memory)
Copy function _setTokenURI(address to, uint256 tokenId, itString calldata itTokenURI)
Copy function _update(address to, uint256 tokenId, address auth) returns (address)
Errors
Copy error ERC721URIStorageNonMintedToken(uint256 tokenId)