{"id":15633085,"url":"https://github.com/idouble/simple-game-erc-721-token-template","last_synced_at":"2025-04-09T12:09:18.259Z","repository":{"id":41579739,"uuid":"154917510","full_name":"IDouble/Simple-Game-ERC-721-Token-Template","owner":"IDouble","description":"🔮 Very Simple ERC-721 Smart Contract Template to create your own ERC-721 Tokens on the Ethereum Blockchain, with many customizable options 🔮","archived":false,"fork":false,"pushed_at":"2024-03-01T19:40:08.000Z","size":789,"stargazers_count":200,"open_issues_count":3,"forks_count":66,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T21:54:07.969Z","etag":null,"topics":["blockchain","blockchain-technology","customizable","erc","erc-721","erc721","eth","ethereum","ethereum-contract","nft","non-fungible","non-fungible-token","simple","smart-contracts","solidity","solidity-contracts","template","template-project","token","unique-token"],"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/IDouble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-10-27T02:43:16.000Z","updated_at":"2025-03-30T00:45:06.000Z","dependencies_parsed_at":"2024-03-01T20:47:52.618Z","dependency_job_id":null,"html_url":"https://github.com/IDouble/Simple-Game-ERC-721-Token-Template","commit_stats":null,"previous_names":["idouble/simple-game-erc-721-token-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Game-ERC-721-Token-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Game-ERC-721-Token-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Game-ERC-721-Token-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-Game-ERC-721-Token-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDouble","download_url":"https://codeload.github.com/IDouble/Simple-Game-ERC-721-Token-Template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"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":["blockchain","blockchain-technology","customizable","erc","erc-721","erc721","eth","ethereum","ethereum-contract","nft","non-fungible","non-fungible-token","simple","smart-contracts","solidity","solidity-contracts","template","template-project","token","unique-token"],"created_at":"2024-10-03T10:46:54.658Z","updated_at":"2025-04-09T12:09:18.242Z","avatar_url":"https://github.com/IDouble.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔮 Simple Game ERC-721 Token Template 🔮\n🔮 Very Simple **ERC-721 Smart Contract Template** to create your own **ERC-721 Tokens** on the **Ethereum** Blockchain, with many customizable Options 🔮\n\n## 💎 What is ERC-721? 💎\n**ERC-721** is a free, open standard that describes how to build non-fungible or unique tokens on the Ethereum blockchain. While most tokens are fungible (every token is the same as every other token), **ERC-721 Tokens** are all unique. \n\nOne of the most known examples for an **ERC-721 Token** is Crypto Kitties (https://www.cryptokitties.co/), where each Cat is an unique **ERC-721 Token**. 😺\n\n## ⚙️ Setup ⚙️\n\nEach Line of the **Solidity Code** has a comment that explains what is happening. 📝 \n\nThe Setup is fairly easy, you just need to click on the [Remix link](https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js\u0026optimize=false\u0026gist=6dfc6f9a27c0e6220094943657e3d834) or use the [Gist link](https://gist.github.com/AYIDouble/6dfc6f9a27c0e6220094943657e3d834) and you're done. \u003c/br\u003e\nIf you have problems with it, you can also do it the good old way and add each file separately. (Takes about 1 minute)\n\nRemix IDE Link: https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js\u0026optimize=false\u0026gist=6dfc6f9a27c0e6220094943657e3d834\n\nGitHub Gist Link: https://gist.github.com/AYIDouble/6dfc6f9a27c0e6220094943657e3d834\n\n## [📝 Remix - Solidity IDE  📝](https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js\u0026optimize=false\u0026gist=6dfc6f9a27c0e6220094943657e3d834)\n\n![Remix Solidity IDE Ethereum erc 721 erc721 erc-721 item game blockchain](Images/ERC-721-Remix-IDE-Solidity.png)\n\n### Explanation of the Code:\nAt Line **5–9**: In the **struct** the **Item** with all his properties is defined (**name**, **level**, **rarityLevel**).\n\nAt Line **11**: An Array is created, where all the **Items** of the contract **owner** are stored.\n\nAt Line **14–16**: We define that the **owner** is the user of the contract.\n\nAt Line **18**: We define a function **createItem**, where the **name** (**_name**) of the **Item** is a parameter and the Ethereum address (**_to**) where we want to send our **Items**.\n\nAt Line **19**: We define that only the **owner** of the contract is able to create **Items**.\n\nAt Line **20**: Each time we create an **Item** the current Length of the **Item** array is being used as the ID for the **Item**. (Each **Item** has a unique ID)\n\nAt Line **21**: The **Item** gets created and added to our **Items** array\n\nAt Line **22**: The **_mint** function from the ERC721 Libraries is used for sending our **Items** to the specific ethereum address. As an example, this is needed to send the created **Item** to your ethereum address or any other address.\n\n## ⚔️ Item.sol ⚔️ (ERC-721 Token)\n\nIn this small example we are creating an ERC-721 Token, that could be used as an in-game Item. ⚔️\n\n**Example: a Sword as a Item saved in the Ethereum Blockchain.**\n```\npragma solidity ^0.4.24;\n\ncontract Item is ERC721{\n    \n    struct Item{\n        string name; // Name of the Item\n        uint level; // Item Level\n        uint rarityLevel;  // 1 = normal, 2 = rare, 3 = epic, 4 = legendary\n    }\n    \n    Item[] public items; // First Item has Index 0\n    address public owner;\n    \n    function Item() public {\n        owner = msg.sender; // The Sender is the Owner; Ethereum Address of the Owner\n    }\n    \n    function createItem(string _name, address _to) public{\n        require(owner == msg.sender); // Only the Owner can create Items\n        uint id = items.length; // Item ID = Length of the Array Items\n        items.push(Item(_name,5,1)) // Item (\"Sword\",5,1)\n        _mint(_to,id); // Assigns the Token to the Ethereum Address that is specified\n    }\n    \n}\n```\n\n![Binance Ready to give crypto a try ? buy bitcoin and other cryptocurrencies on binance](Images/binance.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-game-erc-721-token-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidouble%2Fsimple-game-erc-721-token-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-game-erc-721-token-template/lists"}