ERC-721 (2024)

The Standard

ERC-721 defines a minimum interface a smart contract must implement to allow unique tokens to be managed, owned, and traded. It does not mandate a standard for token metadata or restrict adding supplemental functions.

  pragma solidity ^0.4.20; /// @title ERC-721 Non-Fungible Token Standard /// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md /// Note: the ERC-165 identifier for this interface is 0x80ac58cd interface ERC721 /* is ERC165 */ { /// @dev This emits when ownership of any NFT changes by any mechanism. /// This event emits when NFTs are created (`from` == 0) and destroyed /// (`to` == 0). Exception: during contract creation, any number of NFTs /// may be created and assigned without emitting Transfer. At the time of /// any transfer, the approved address for that NFT (if any) is reset to none. event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); /// @dev This emits when the approved address for an NFT is changed or /// reaffirmed. The zero address indicates there is no approved address. /// When a Transfer event emits, this also indicates that the approved /// address for that NFT (if any) is reset to none. event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); /// @dev This emits when an operator is enabled or disabled for an owner. /// The operator can manage all NFTs of the owner. event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /// @notice Count all NFTs assigned to an owner /// @dev NFTs assigned to the zero address are considered invalid, and this /// function throws for queries about the zero address. /// @param _owner An address for whom to query the balance /// @return The number of NFTs owned by `_owner`, possibly zero function balanceOf(address _owner) external view returns (uint256); /// @notice Find the owner of an NFT /// @dev NFTs assigned to zero address are considered invalid, and queries /// about them do throw. /// @param _tokenId The identifier for an NFT /// @return The address of the owner of the NFT function ownerOf(uint256 _tokenId) external view returns (address); /// @notice Transfers the ownership of an NFT from one address to another address /// @dev Throws unless `msg.sender` is the current owner, an authorized /// operator, or the approved address for this NFT. Throws if `_from` is /// not the current owner. Throws if `_to` is the zero address. Throws if /// `_tokenId` is not a valid NFT. When transfer is complete, this function /// checks if `_to` is a smart contract (code size > 0). If so, it calls /// `onERC721Received` on `_to` and throws if the return value is not /// `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer /// @param data Additional data with no specified format, sent in call to `_to` function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable; /// @notice Transfers the ownership of an NFT from one address to another address /// @dev This works identically to the other function with an extra data parameter, /// except this function just sets data to "" /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE /// TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE /// THEY MAY BE PERMANENTLY LOST /// @dev Throws unless `msg.sender` is the current owner, an authorized /// operator, or the approved address for this NFT. Throws if `_from` is /// not the current owner. Throws if `_to` is the zero address. Throws if /// `_tokenId` is not a valid NFT. /// @param _from The current owner of the NFT /// @param _to The new owner /// @param _tokenId The NFT to transfer function transferFrom(address _from, address _to, uint256 _tokenId) external payable; /// @notice Set or reaffirm the approved address for an NFT /// @dev The zero address indicates there is no approved address. /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized /// operator of the current owner. /// @param _approved The new approved NFT controller /// @param _tokenId The NFT to approve function approve(address _approved, uint256 _tokenId) external payable; /// @notice Enable or disable approval for a third party ("operator") to manage /// all of `msg.sender`'s assets. /// @dev Emits the ApprovalForAll event. The contract MUST allow /// multiple operators per owner. /// @param _operator Address to add to the set of authorized operators. /// @param _approved True if the operator is approved, false to revoke approval function setApprovalForAll(address _operator, bool _approved) external; /// @notice Get the approved address for a single NFT /// @dev Throws if `_tokenId` is not a valid NFT /// @param _tokenId The NFT to find the approved address for /// @return The approved address for this NFT, or the zero address if there is none function getApproved(uint256 _tokenId) external view returns (address); /// @notice Query if an address is an authorized operator for another address /// @param _owner The address that owns the NFTs /// @param _operator The address that acts on behalf of the owner /// @return True if `_operator` is an approved operator for `_owner`, false otherwise function isApprovedForAll(address _owner, address _operator) external view returns (bool); } interface ERC165 { /// @notice Query if a contract implements an interface /// @param interfaceID The interface identifier, as specified in ERC-165 /// @dev Interface identification is specified in ERC-165. This function /// uses less than 30,000 gas. /// @return `true` if the contract implements `interfaceID` and /// `interfaceID` is not 0xffffffff, `false` otherwise function supportsInterface(bytes4 interfaceID) external view returns (bool); } interface ERC721TokenReceiver { /// @notice Handle the receipt of an NFT /// @dev The ERC721 smart contract calls this function on the /// recipient after a `transfer`. This function MAY throw to revert and reject the transfer. Return /// of other than the magic value MUST result in the transaction being reverted. /// @notice The contract address is always the message sender. /// @param _operator The address which called `safeTransferFrom` function /// @param _from The address which previously owned the token /// @param _tokenId The NFT identifier which is being transferred /// @param _data Additional data with no specified format /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` /// unless throwing function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes _data) external returns(bytes4); }  

ERC-721 started as a EIP draft written by @dete and first came to life in the CryptoKitties project by Axiom Zen

ERC-721 has since moved out of beta and into a community formalized v1 spec, supported and endorsed by a large number of projects from across the crypto ecosystem. This EIP wouldn't be possible without time and dedication from a number of community members. Special thanks to @fulldecent and others who have put in tremendous amounts of work to push this forward.

ERC-721 (2024)

FAQs

What is an ERC-721 contract? ›

ERC721 is a standard for representing ownership of non-fungible tokens, that is, where each token is unique. ERC721 is a more complex standard than ERC20, with multiple optional extensions, and is split across a number of contracts.

What is the difference between ERC20 and ERC-721? ›

The key difference between ERC20 and ERC721 tokens lies in their fungibility. ERC20 tokens are fungible and represent a uniform asset, while ERC721 tokens are non-fungible and symbolize a set of unique assets. Additionally, ERC721 tokens cannot be divided into smaller units.

What is the main difference between ERC-721 and ERC 1155? ›

ERC-721 vs ERC-1155: Major Differences

Token Support: ERC-721 only supports the creation of NFTs, while ERC-1155 not only supports the creation of NFTs but also fungible and semi-fungible tokens, facilitating the conversion of these types of tokens to NFTs and vice-versa.

What is an example of ERC-721? ›

The ERC-721 token smart contract demonstrates how to create and transfer non-fungible tokens. Non-fungible tokens represent ownership over digital or physical assets. Example assets are artworks, houses, tickets, etc. Non-fungible tokens are distinguishable and we can track the ownership of each one separately.

How much does ERC-721 cost? ›

Estimated gas costs for airdropping tokens: Cost of airdropping 1 ERC721 token: ~ 76,521 gas. Cost of airdropping each additional ERC721 token: ~ 44,610 gas.

What are the benefits of ERC-721? ›

Standardized Management: ERC-721 establishes a set of rules and functionalities for smart contracts – self-executing code on the blockchain – to handle these unique digital assets. This ensures a consistent and secure way to: Mint NFTs: Create new, one-of-a-kind NFTs within a collection.

How do I get ERC-721? ›

4 Steps to Create an ERC721 Token on Kaleido
  1. Step 1: Create a Kaleido Account. If you haven't already, sign up for a Kaleido account here. ...
  2. Step 2: Create a Blockchain Network. To get started, create a blockchain network. ...
  3. Step 3: Create a Token Pool. ...
  4. Step 4: Create Your Token. ...
  5. Step 5: Transfer Your NFT to Metamask.
Feb 13, 2024

How do I know if my contract is ERC-721 or ERC1155? ›

According to EIPs, ERC721 and ERC1155 will implements EIP165. Therefore, we can use the supportsInterface of EIP165 to check whether the contract is ERC721 or ERC1155. The interface id for ERC1155 is 0xd9b67a26 , while the interface of ERC721 is 0x80ac58cd .

What are ERC contracts? ›

An ERC20 token is a standard for creating and issuing smart contracts on the Ethereum blockchain. ERC stands for "Ethereum Request for Comment," and the ERC20 standard was proposed in 2015.

What are the characteristics of ERC-721? ›

ERC-721 tokens provide a secure and transparent way to prove ownership of unique assets. Their flexibility allows creators to add extra features. They work seamlessly on various platforms, ensuring transparent and protected digital ownership, and this sets the stage for innovative applications.

Can ERC-721 be fractionalized? ›

By definition, an ERC721 cannot be replicated as each token is completely unique. In order to fractionalize an NFT, a smart contract can be designed to generate a series of ERC20 tokens which are then linked to the specific ERC721 token.

What is the difference between ERC-721 and ERC 721A? ›

ERC-721A is better optimized for generative artwork NFT collections. Unlike the ERC-721 standard, ERC-721A has allowed token ownership at the transferring stage rather than the minting stage. This token standard also has better metadata management.

What is the difference between ERC-20 and ERC-721? ›

ERC20 tokens are fungible, meaning that each token is identical and interchangeable with another token of the same type. This fungibility facilitates secure exchange and on cryptocurrency exchanges. In contrast, ERC721 tokens are non-fungible, with each token representing a unique digital asset.

Is ERC-721 a smart contract? ›

Under the hood, ERC-721 smart contracts maintain a record of token ownership, allowing for the transfer of tokens between users. The contract also keeps track of the total supply of tokens and the balance of tokens owned by individual addresses.

Is ERC-721 free? ›

What is ERC-721? ERC-721 is a free, open standard that describes how to build non-fungible or unique tokens on the Ethereum blockchain.

What is an ERC agreement? ›

The Employee Retention Credit (ERC) – sometimes called the Employee Retention Tax Credit or ERTC – is a refundable tax credit for certain eligible businesses and tax-exempt organizations.

Top Articles
How to Run Many Parallel HTTP Requests using Node.js ? - GeeksforGeeks
Looking for Turing Alternatives? Discover 10 Top Platforms for Hiring Developers
Shoe Game Lit Svg
Phcs Medishare Provider Portal
Booknet.com Contract Marriage 2
Linkvertise Bypass 2023
Lowes 385
1TamilMV.prof: Exploring the latest in Tamil entertainment - Ninewall
270 West Michigan residents receive expert driver’s license restoration advice at last major Road to Restoration Clinic of the year
Katie Boyle Dancer Biography
Uvalde Topic
Chris Hipkins Fue Juramentado Como El Nuevo Primer Ministro De...
6001 Canadian Ct Orlando Fl
charleston cars & trucks - by owner - craigslist
Dutch Bros San Angelo Tx
Aldi Süd Prospekt ᐅ Aktuelle Angebote online blättern
2016 Hyundai Sonata Refrigerant Capacity
Ibukunore
ZURU - XSHOT - Insanity Mad Mega Barrel - Speelgoedblaster - Met 72 pijltjes | bol
Recap: Noah Syndergaard earns his first L.A. win as Dodgers sweep Cardinals
VERHUURD: Barentszstraat 12 in 'S-Gravenhage 2518 XG: Woonhuis.
Craigslist Org Appleton Wi
Kingdom Tattoo Ithaca Mi
Aliciabibs
Idle Skilling Ascension
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Nottingham Forest News Now
897 W Valley Blvd
Insidious 5 Showtimes Near Cinemark Southland Center And Xd
Inmate Search Disclaimer – Sheriff
Mumu Player Pokemon Go
Texters Wish You Were Here
oklahoma city community "puppies" - craigslist
Polk County Released Inmates
Craigslist Georgia Homes For Sale By Owner
Weapons Storehouse Nyt Crossword
Bitchinbubba Face
Crazy Balls 3D Racing . Online Games . BrightestGames.com
The Conners Season 5 Wiki
Coroner Photos Timothy Treadwell
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Skyward Cahokia
Port Huron Newspaper
Zipformsonline Plus Login
Value Village Silver Spring Photos
25 Hotels TRULY CLOSEST to Woollett Aquatics Center, Irvine, CA
Sleep Outfitters Springhurst
The 5 Types of Intimacy Every Healthy Relationship Needs | All Points North
Kobe Express Bayside Lakes Photos
What Are Routing Numbers And How Do You Find Them? | MoneyTransfers.com
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6008

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.