COTI V2 Documentation
  • Welcome
  • Networks
    • Faucet
    • Contracts Addresses
    • Adding the COTI Network to Metamask
  • How COTI Works
    • Introduction
      • EVM Introduction
      • Conceptual Overview
      • Use Cases and Applications
      • COTI Architecture
    • Advanced Topics
      • Garbled Circuits
      • AES Keys
      • Precompiles
      • Whitepaper
      • COTI vs others
  • Build on COTI
    • Core Concepts
      • Account Onboarding Procedure
      • Private Data Types
      • Supported Operations on Private Data Types
    • Quickstart
    • Guides
      • Basic Private Smart Contract
      • Account Onboard
      • Sending a Transaction with Encrypted Inputs
      • Resolving a Transaction's Encrypted Outputs
      • Writing a Private Smart Contract
      • Dos and Don'ts
        • Proper Use of Types
        • No Constant/Immutable Secret Types
        • No Public Contract Variables
      • Best Practices
        • Careful Onboarding
        • Careful Decrypting
        • Don't loop over an array without an index
        • Check Overflow
    • Tools
      • TypeScript SDK
      • Ethers.js
      • Python SDK
      • Web3.py
      • Contracts Library
        • MPC Core
        • Data Privacy Framework
        • Tokens
          • Private ERC20
          • Private ERC721
        • Onboard
      • Hardhat
      • Remix Plugin
      • COTI MetaMask Snap
      • Developer Sandbox
  • Running a COTI Node
    • COTI Node Ecosystem Litepaper
  • COTI Bridge
    • Swap COTI V1 Funds to COTI V2
  • Support and Community
    • Glossary
    • Telegram
    • Discord
    • GitHub
    • X
    • YouTube
  • COTI Builders Program
Powered by GitBook
On this page
  • Core
  • Usage
  • Functions
  • Events
  • Errors
  • Extensions
  • PrivateERC721URIStorage

Was this helpful?

Edit on GitHub
  1. Build on COTI
  2. Tools
  3. Contracts Library
  4. Tokens

Private ERC721

PreviousPrivate ERC20NextOnboard

Last updated 5 months ago

Was this helpful?

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

// 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)
Private ERC721
ERC721 Non-Fungible Token (NFT) Standard