🌎 Simple ERC 1155 Multi Token Template 🌏

Alp ΰΈΏπŸ“ˆπŸš€πŸŒ•
Coinmonks
3 min readApr 26, 2023

--

Very Simple ERC-1155 Smart Contract Template to create your own ERC-1155 Tokens on the Ethereum Blockchain, with many customizable options

πŸ’Ž What is ERC-1155? πŸ’Ž

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.

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.

βš™οΈ Setup βš™οΈ

Each Line of the Solidity Code has a comment that explains what is happening. πŸ“

The Setup is fairly easy, you just need to click on the Remix link or use the Gist link and you’re done.
If you have problems with it, you can also do it the good old way and add each file separately. (Takes about 1 minute)

Remix IDE Link: https://remix.ethereum.org/#version=soljson-v0.8.19+commit.7dd6d404.js&optimize=false&gist=9ea36647220e2982ca55cf179bd98f81&lang=en&runs=200&evmVersion=null&language=Solidity

GitHub Gist Link: https://gist.github.com/AYIDouble/9ea36647220e2982ca55cf179bd98f81

πŸ“ Remix β€” Solidity IDE πŸ“

🌎 PlanetEarth.sol 🌏 (ERC-1155 Token)

In this small example, we are creating an ERC-1155 Token with a non-fungible token (Earth) and fungible Tokens (Gold & Silver). 🌎

Example: Our planet Earth is saved as a non-fungible token (NFT) with gold and silver as fungible tokens (cryptocurrency) in the Ethereum Blockchain.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

❔ What’s the difference between a non-fungible (NFT) and a fungible token in ERC-1155? ❔

In ERC-1155 a non-fungible (NFT) gets only created once and is unique, and fungible tokens are created more than once, like a cryptocurrency. That’s it, it’s very simple, here’s a code example where non-fungible (NFT) and fungible tokens are created:

// A non-fungible (NFT) Token, created only once, the NFT planet Earth is unique and only exists once
_mint(msg.sender, EARTH, 1, ""); // Unique Token, Non-fungible Token (NFT), we only create 1 planet Earth

About

Very Simple ERC-1155 Smart Contract Template to create your own ERC-1155 Tokens on the Ethereum Blockchain, with many customizable Options

Topics

template simple ethereum smart-contracts blockchain customizable solidity ethereum-contract token template-project eth erc blockchain-technology solidity-contracts nft erc1155 multi-token non-fungible-token unique-token fungible-token

License

MIT license

--

--

Alp ΰΈΏπŸ“ˆπŸš€πŸŒ•
Coinmonks

C# / Java / Python etc.| Zurich, Switzerland| Software Engineer βš™οΈGitHub: https://github.com/IDouble