{"id":15654650,"url":"https://github.com/idouble/simple-erc-1155-multi-token-template","last_synced_at":"2025-05-01T02:52:03.987Z","repository":{"id":156225428,"uuid":"632901924","full_name":"IDouble/Simple-ERC-1155-Multi-Token-Template","owner":"IDouble","description":"🌎 Very Simple ERC-1155 Smart Contract Template to create your own ERC-1155 Tokens on the Ethereum Blockchain, with many customizable options 🌏","archived":false,"fork":false,"pushed_at":"2024-02-29T16:54:59.000Z","size":1383,"stargazers_count":51,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-01T02:51:55.123Z","etag":null,"topics":["blockchain","blockchain-technology","customizable","erc","erc1155","eth","ethereum","ethereum-contract","fungible-token","multi-token","nft","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":"2023-04-26T11:12:24.000Z","updated_at":"2025-03-30T00:50:46.000Z","dependencies_parsed_at":"2024-04-08T23:02:36.766Z","dependency_job_id":"0404c798-4957-44a1-97c3-bf09247d4598","html_url":"https://github.com/IDouble/Simple-ERC-1155-Multi-Token-Template","commit_stats":null,"previous_names":["idouble/simple-erc-1155-multi-token-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-ERC-1155-Multi-Token-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-ERC-1155-Multi-Token-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-ERC-1155-Multi-Token-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDouble%2FSimple-ERC-1155-Multi-Token-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDouble","download_url":"https://codeload.github.com/IDouble/Simple-ERC-1155-Multi-Token-Template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251815443,"owners_count":21648367,"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","erc1155","eth","ethereum","ethereum-contract","fungible-token","multi-token","nft","non-fungible-token","simple","smart-contracts","solidity","solidity-contracts","template","template-project","token","unique-token"],"created_at":"2024-10-03T12:53:05.383Z","updated_at":"2025-05-01T02:52:03.961Z","avatar_url":"https://github.com/IDouble.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌎 Simple ERC 1155 Multi Token Template 🌏\n🌎 Very Simple ERC-1155 Smart Contract Template to create your own ERC-1155 Tokens on the Ethereum Blockchain, with many customizable options 🌏\n\n## 💎 What is ERC-1155? 💎\n**ERC-1155** is a free, open standard that describes how to build tokens and non-fungible or unique tokens (NFT) on the Ethereum blockchain. It can create fungible tokens (every token is the same as every other token), and non-fungible or unique tokens (NFT) where tokens are unique.\n\n**ERC-1155** has a huge advantage when it comes to transaction costs, because you're able to create multiple non-fungible (NFT) and fungible tokens in one transaction, you can also send the tokens in one single transaction as a batch, fewer transactions = less transactions cost.\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.8.19+commit.7dd6d404.js\u0026optimize=false\u0026gist=9ea36647220e2982ca55cf179bd98f81\u0026lang=en\u0026runs=200\u0026evmVersion=null\u0026language=Solidity) or use the [Gist link](https://gist.github.com/AYIDouble/9ea36647220e2982ca55cf179bd98f81) 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.8.19+commit.7dd6d404.js\u0026optimize=false\u0026gist=9ea36647220e2982ca55cf179bd98f81\u0026lang=en\u0026runs=200\u0026evmVersion=null\u0026language=Solidity\n\nGitHub Gist Link: https://gist.github.com/AYIDouble/9ea36647220e2982ca55cf179bd98f81\n\n## [📝 Remix - Solidity IDE  📝](https://remix.ethereum.org/#version=soljson-v0.8.19+commit.7dd6d404.js\u0026optimize=false\u0026gist=9ea36647220e2982ca55cf179bd98f81\u0026lang=en\u0026runs=200\u0026evmVersion=null\u0026language=Solidity)\n\n![Remix Solidity IDE Ethereum erc 1155 erc1155 erc-1155 item planet earth gold silver game blockchain](Images/ERC-1155-Remix-IDE-Solidity.png)\n\n## 🌎 PlanetEarth.sol 🌏 (ERC-1155 Token)\n\nIn this small example, we are creating an ERC-1155 Token with a non-fungible token (Earth) and fungible Tokens (Gold \u0026 Silver). 🌎\n\n**Example: Our planet Earth is saved as a non-fungible token (NFT) with gold and silver as fungible tokens (cryptocurrency) in the Ethereum Blockchain.**\n```\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract PlanetEarth is ERC1155, Ownable {\n\n    uint256 public constant EARTH = 0; // Unique Token, Non-fungible Token (NFT), planet Earth only exists once\n    uint256 public constant GOLD = 1; // Cryptocurrency, There're about 250'000 tonnes of gold on planet Earth\n    uint256 public constant SILVER = 2; // Cryptocurrency, There're about 2'000'000 tonnes of silver on planet Earth\n\n    constructor() ERC1155(\"https://planet.example/api/item/{id}.json\") { // The link to access our Token trough it's ID\n        _mint(msg.sender, EARTH, 1, \"\"); // Unique Token, Non-fungible Token (NFT), we only create 1 planet Earth\n        _mint(msg.sender, GOLD, 250000, \"\"); // Cryptocurrency, There're about 250'000 tonnes of gold on planet Earth\n        _mint(msg.sender, SILVER, 2000000, \"\"); // Cryptocurrency, There're about 2'000'000 tonnes of silver on planet Earth\n    } // msg.sender = our ethereum address, EARTH = the constant we specified above, 1 = Amount (how many are created)\n\n    function mint(address account, uint256 id, uint256 amount, bytes memory data)\n        public\n        onlyOwner // Only the smart contract owner can execute this function\n    { // This is our mint function to create new tokens and assign them to an ethereum address\n        _mint(account, id, amount, data);\n    }\n\n    function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)\n        public\n        onlyOwner // Only the smart contract owner can execute this function\n    { // The _mintBatch() function enables the Owner to create multiple tokens in a batch with one transaction\n        _mintBatch(to, ids, amounts, data);\n    } \n\n    function setURI(string memory newuri) public onlyOwner {\n        _setURI(newuri);\n    }\n}\n```\n\n## ❔ What's the difference between a non-fungible (NFT) and a fungible token in ERC-1155? ❔\n\nIn **ERC-1155** a non-fungible (NFT) gets only created once and is unique, and fungible tokens are created more than once, like a cryptocurrency.\nThat's it, it's very simple, here's a code example where non-fungible (NFT) and fungible tokens are created:\n\n```\n// A non-fungible (NFT) Token, created only once, the NFT planet Earth is unique and only exists once\n_mint(msg.sender, EARTH, 1, \"\"); // Unique Token, Non-fungible Token (NFT), we only create 1 planet Earth\n\n// Fungible tokens, created multiple times (250'000 gold and 2'000'000 silver tokens), all gold or silver tokens are identical\n_mint(msg.sender, GOLD, 250000, \"\"); // Cryptocurrency, There're about 250'000 tonnes of gold on planet Earth\n_mint(msg.sender, SILVER, 2000000, \"\"); // Cryptocurrency, There're about 2'000'000 tonnes of silver on planet Earth\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-erc-1155-multi-token-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidouble%2Fsimple-erc-1155-multi-token-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidouble%2Fsimple-erc-1155-multi-token-template/lists"}