{"id":13620518,"url":"https://github.com/nibbstack/erc721","last_synced_at":"2025-05-15T17:07:54.869Z","repository":{"id":37384141,"uuid":"132498941","full_name":"nibbstack/erc721","owner":"nibbstack","description":"The reference implementation of the ERC-721 non-fungible token standard.","archived":false,"fork":false,"pushed_at":"2022-08-10T08:06:18.000Z","size":2507,"stargazers_count":1055,"open_issues_count":6,"forks_count":398,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-05-11T23:45:54.298Z","etag":null,"topics":["contract","contracts","erc-721","erc721","eth","ethereum","hacktoberfest","implementation","non-fungible","smart-contracts","standard","token","tokens"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nibbstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null},"funding":{"github":["xpepermint","MoMannn","fulldecent"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-05-07T18:12:45.000Z","updated_at":"2025-05-11T14:42:04.000Z","dependencies_parsed_at":"2022-07-08T07:40:00.771Z","dependency_job_id":null,"html_url":"https://github.com/nibbstack/erc721","commit_stats":null,"previous_names":["0xcert/ethereum-erc721"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nibbstack%2Ferc721","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nibbstack%2Ferc721/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nibbstack%2Ferc721/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nibbstack%2Ferc721/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nibbstack","download_url":"https://codeload.github.com/nibbstack/erc721/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contract","contracts","erc-721","erc721","eth","ethereum","hacktoberfest","implementation","non-fungible","smart-contracts","standard","token","tokens"],"created_at":"2024-08-01T21:00:56.742Z","updated_at":"2025-05-15T17:07:49.859Z","avatar_url":"https://github.com/nibbstack.png","language":"Solidity","readme":"![Build Status](https://travis-ci.org/nibbstack/erc721.svg?branch=master)\u0026nbsp;[![codecov](https://codecov.io/gh/nibbstack/erc721/branch/master/graph/badge.svg?token=F0tgRHyWSM)](https://codecov.io/gh/nibbstack/erc721)\u0026nbsp;[![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-erc721.svg)](https://www.npmjs.com/package/@nibbstack/erc721)\u0026nbsp;[![Bug Bounty](https://img.shields.io/badge/bounty-open-2930e8.svg)](https://github.com/nibbstack/erc721/blob/master/BUG_BOUNTY.md)\n\n# ERC-721 Token — Reference Implementation\n\n**NOTICE: This repository has been transferred from 0xcert to Nibbstack and thus renamed from 0xcert/ethereum-erc721 to @nibbstack/erc721.**\n\nThis is the complete reference implementation of the [ERC-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) non-fungible token standard for the Ethereum and Wanchain blockchains. It is also compatible with other EVM compatible chains like Binance Smart Chain (BSC), Avalanche (AVAX) etc. This is an open-source project, complete with [Hardhat](https://hardhat.org/) testing.\n\nThe purpose of this implementation is to provide a good starting point for anyone who wants to use and develop non-fungible tokens on the Ethereum and Wanchain blockchains. Instead of re-implementing the ERC-721 yourself you can use this code which has gone through multiple audits and we hope it will be extensively used by the community in the future.\nNote that this implementation is more restrictive then the ERC-721 standard since it does not support `payable` function calls out of the box. You are however free to add this yourself.\n\nIf you are looking for a more feature-rich and advanced ERC-721 implementation, then check out the [0xcert Framework](https://github.com/0xcert/framework).\n\n## Structure\n\nAll contracts and tests are in the [src](src/) folder. There are multiple implementations and you can select between:\n\n- [`nf-token.sol`](src/contracts/tokens/nf-token.sol): This is the base ERC-721 token implementation (with support for ERC-165).\n- [`nf-token-metadata.sol`](src/contracts/tokens/nf-token-metadata.sol): This implements optional ERC-721 metadata features for the token contract. It implements a token name, a symbol and a distinct URI pointing to a publicly exposed ERC-721 JSON metadata file.\n- [`nf-token-enumerable.sol`](src/contracts/tokens/nf-token-enumerable.sol): This implements optional ERC-721 support for enumeration. It is useful if you want to know the total supply of tokens, to query a token by index, etc.\n\nOther files in the [tokens](src/contracts/tokens) and [utils](src/contracts/utils) directories named `erc*.sol` are interfaces and define the respective standards.\n\nMock contracts showing basic contract usage are available in the [mocks](src/contracts/mocks) folder.\n\nThere are also test mocks that can be seen [here](src/tests/mocks). These are specifically made to test different edge cases and behaviours and should NOT be used as a reference for implementation.\n\n## Requirements\n\n* NodeJS 12+ is supported\n* Windows, Linux or macOS\n\n## Installation\n\n### npm\n\n*This is the recommended installation method if you want to use this package in your JavaScript project.*\n\nThis project is [released as an npm module](https://www.npmjs.com/package/@nibbstack/erc721). You must install it using the `npm` command:\n\n```\n$ npm install @nibbstack/erc721@2.6.1\n```\n\n### Source\n\n*This is the recommended installation method if you want to improve the `nibbstack/erc721` project.*\n\nClone this repository and install the required `npm` dependencies:\n\n```\n$ git clone git@github.com:nibbstack/erc721.git\n$ cd ethereum-erc721\n$ npm install\n```\n\nMake sure that everything has been set up correctly:\n\n```\n$ npm run test\n```\n\n## Usage\n\n### npm\n\nTo interact with this package's contracts within JavaScript code, you simply need to require this package's `.json` files:\n\n```js\nconst contract = require(\"@nibbstack/erc721/abi/NFTokenEnumerable.json\");\nconsole.log(contract);\n```\n\n### Remix IDE (Ethereum only)\n\nYou can quickly deploy a contract with this library using [Remix IDE](https://remix.ethereum.org). Here is one example.\n\nYou have created and have possession of unique glass-blown artwork (each having a serial/lot number) which you would like to sell using the Ethereum or Wanchain mainnet. You will sell non-fungible tokens and the buyers would be able to trade those to other people. One token per piece of artwork. You commit to anybody holding these tokens that they may redeem their token and take physical possession of the art.\n\nTo do this, simply paste the code below into Remix and deploy the smart contract. You will \"mint\" a token for each new piece of artwork you want to see. Then you will \"burn\" that token when you surrender physical possession of the piece.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"https://github.com/nibbstack/erc721/src/contracts/tokens/nf-token-metadata.sol\";\nimport \"https://github.com/nibbstack/erc721/src/contracts/ownership/ownable.sol\";\n\n/**\n * @dev This is an example contract implementation of NFToken with metadata extension.\n */\ncontract MyArtSale is\n  NFTokenMetadata,\n  Ownable\n{\n\n  /**\n   * @dev Contract constructor. Sets metadata extension `name` and `symbol`.\n   */\n  constructor()\n  {\n    nftName = \"Frank's Art Sale\";\n    nftSymbol = \"FAS\";\n  }\n\n  /**\n   * @dev Mints a new NFT.\n   * @param _to The address that will own the minted NFT.\n   * @param _tokenId of the NFT to be minted by the msg.sender.\n   * @param _uri String representing RFC 3986 URI.\n   */\n  function mint(\n    address _to,\n    uint256 _tokenId,\n    string calldata _uri\n  )\n    external\n    onlyOwner\n  {\n    super._mint(_to, _tokenId);\n    super._setTokenUri(_tokenId, _uri);\n  }\n\n}\n```\n\n*You should contact a lawyer before holding an auction, or selling anything. Specifically, laws for auctions vary wildly by jurisdiction. This application is provided only as an example of the technology and is not legal advice.*\n\n## Validation\n\nYou can check the validity of the smart contract, the correctness of the implementation and the supported functions of the respective smart contract using the online validator at https://erc721validator.org/.\n\n## Playground\n\n### Ethereum - Ropsten testnet\n\nWe already deployed some contracts to the [Ropsten](https://ropsten.etherscan.io/) network. You can play with them RIGHT NOW. No need to install the software. In this test version of the contract, anybody can `mint` or `burn` tokens, so don't use it for anything important.\n\n| Contract                                                     | Token address | Transaction hash |\n| ------------------------------------------------------------ | ------------- | ---------------- |\n| [`nf-token.sol`](src/contracts/tokens/nf-token.sol)          | [0xd8bbf8ceb445de814fb47547436b3cfeecadd4ec](https://ropsten.etherscan.io/address/0xd8bbf8ceb445de814fb47547436b3cfeecadd4ec)          | [0xaac94c9ce15f5e437bd452eb1847a1d03a923730824743e1f37b471db0f16f0c](https://ropsten.etherscan.io/tx/0xaac94c9ce15f5e437bd452eb1847a1d03a923730824743e1f37b471db0f16f0c)             |\n| [`nf-token-metadata.sol`](src/contracts/tokens/nf-token-metadata.sol) | [0x5c007a1d8051dfda60b3692008b9e10731b67fde](https://ropsten.etherscan.io/address/0x5c007a1d8051dfda60b3692008b9e10731b67fde)          | [0x1e702503aff40ea44aa4d77801464fd90a018b7b9bad670500a6e2b3cc281d3f](https://ropsten.etherscan.io/tx/0x1e702503aff40ea44aa4d77801464fd90a018b7b9bad670500a6e2b3cc281d3f)             |\n| [`nf-token-enumerable.sol`](src/contracts/tokens/nf-token-enumerable.sol) | [0x130dc43898eb2a52c9d11043a581ce4414487ed0](https://ropsten.etherscan.io/address/0x130dc43898eb2a52c9d11043a581ce4414487ed0)          | [0x8df4c9b73d43c2b255a4038eec960ca12dae9ba62709894f0d85dc90d3938280](https://ropsten.etherscan.io/tx/0x8df4c9b73d43c2b255a4038eec960ca12dae9ba62709894f0d85dc90d3938280)             |\n\n### Wanchain - testnet\n\nWe already deployed some contracts to [testnet](http://testnet.wanscan.org/) network. You can play with them RIGHT NOW. No need to install software. In this test version of the contract, anybody can `mint` or `burn` tokens, so don't use it for anything important.\n\n| Contract                                                     | Token address | Transaction hash |\n| ------------------------------------------------------------ | ------------- | ---------------- |\n| [`nf-token.sol`](src/contracts/tokens/nf-token.sol)          | [0x6D0eb4304026116b2A7bff3f46E9D2f320df47D9](http://testnet.wanscan.org/address/0x6D0eb4304026116b2A7bff3f46E9D2f320df47D9)          | [0x9ba7a172a50fc70433e29cfdc4fba51c37d84c8a6766686a9cfb975125196c3d](http://testnet.wanscan.org/tx/0x9ba7a172a50fc70433e29cfdc4fba51c37d84c8a6766686a9cfb975125196c3d)             |\n| [`nf-token-metadata.sol`](src/contracts/tokens/nf-token-metadata.sol) | [0xF0a3852BbFC67ba9936E661fE092C93804bf1c81](http://testnet.wanscan.org/address/0xF0a3852BbFC67ba9936E661fE092C93804bf1c81)          | [0x338ca779405d39c0e0f403b01679b22603c745828211b5b2ea319affbc3e181b](http://testnet.wanscan.org/tx/0x338ca779405d39c0e0f403b01679b22603c745828211b5b2ea319affbc3e181b)             |\n| [`nf-token-enumerable.sol`](src/contracts/tokens/nf-token-enumerable.sol) | [0x539d2CcBDc3Fc5D709b9d0f77CaE6a82e2fec1F3](http://testnet.wanscan.org/address/0x539d2CcBDc3Fc5D709b9d0f77CaE6a82e2fec1F3)          | [0x755886c9a9a53189550be162410b2ae2de6fc62f6791bf38599a078daf265580](http://testnet.wanscan.org/tx/0x755886c9a9a53189550be162410b2ae2de6fc62f6791bf38599a078daf265580)             |\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for how to help out.\n\n## Bug bounty\n\nYou are somebody that reads the documentation of smart contracts and understands how the ERC-721 Token Reference Implementation works. So you have unique skills and your time is valuable. We will pay you for your contributions to this project in the form of bug reports.\n\nIf your project depends on ERC-721 or you want to help improve the assurance of this project then you can pledge a bounty. This means you will commit to paying researchers that demonstrate a problem. Contact us at [bounty@nibbstack.com](mailto:bounty@nibbstack.com) if interested. Thank you.\n\nRead the full [bug bounty program](BUG_BOUNTY.md).\n\n## Licence\n\nSee [LICENSE](./LICENSE) for details.\n","funding_links":["https://github.com/sponsors/xpepermint","https://github.com/sponsors/MoMannn","https://github.com/sponsors/fulldecent"],"categories":["Libraries","Solidity"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnibbstack%2Ferc721","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnibbstack%2Ferc721","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnibbstack%2Ferc721/lists"}