All Projects → 0xsequence → Erc 1155

0xsequence / Erc 1155

Licence: other
Ethereum Multi-Token Standard (ERC-1155)

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Erc 1155

Truffle Assertions
🛠 Assertions and utilities for testing Ethereum smart contracts with Truffle unit tests
Stars: ✭ 109 (-2.68%)
Mutual labels:  ethereum
Awesome Solidity
A curated list of awesome Solidity resources
Stars: ✭ 111 (-0.89%)
Mutual labels:  ethereum
Ethereum Smart Contracts Security Checklist
Ethereum Smart Contracts Security CheckList From Knownsec 404 Team
Stars: ✭ 114 (+1.79%)
Mutual labels:  ethereum
Bee
Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; censorship-resistant and self-sustaining network for storing your (application) data.
Stars: ✭ 108 (-3.57%)
Mutual labels:  ethereum
Whitelist
whitelist.dock.io backend service
Stars: ✭ 111 (-0.89%)
Mutual labels:  ethereum
Blockapi
A general framework for blockchain analytics
Stars: ✭ 111 (-0.89%)
Mutual labels:  ethereum
Ergo
The Language for Smart Legal Contracts
Stars: ✭ 108 (-3.57%)
Mutual labels:  ethereum
Ds Math
Safe arithmetic
Stars: ✭ 113 (+0.89%)
Mutual labels:  ethereum
Geth Dev
A Docker Image to create a set of mining, local Ethereum nodes for development
Stars: ✭ 109 (-2.68%)
Mutual labels:  ethereum
Desktop
The official Musicoin Desktop Wallet Application
Stars: ✭ 112 (+0%)
Mutual labels:  ethereum
Backend Ico Dashboard
Free & open-source dashboard for your next ICO, crowdsale or tokensale
Stars: ✭ 110 (-1.79%)
Mutual labels:  ethereum
Bokkypoobahsdatetimelibrary
Gas-Efficient Solidity DateTime Library
Stars: ✭ 111 (-0.89%)
Mutual labels:  ethereum
Hydro Scaffold Dex
A Decentralized Exchange Scaffold - launch a DEX in minutes
Stars: ✭ 112 (+0%)
Mutual labels:  ethereum
Eden Smart Contracts
EDEN - EDN Smart Token & Smart Contracts
Stars: ✭ 109 (-2.68%)
Mutual labels:  ethereum
Audit Checklist
A Solidity smart contract auditing checklist
Stars: ✭ 113 (+0.89%)
Mutual labels:  ethereum
Cryptotrader
This is an experimental trading bot framework written in PHP. It may contain bugs and should not be trusted with much money
Stars: ✭ 108 (-3.57%)
Mutual labels:  ethereum
Sputter
Ethereum Virtual Machine (EVM) implementation
Stars: ✭ 111 (-0.89%)
Mutual labels:  ethereum
Theo
Ethereum recon and exploitation tool.
Stars: ✭ 112 (+0%)
Mutual labels:  ethereum
Awesome Crowdsales
A curated list of ICO repositories that produced ERC20/ERC223 tokens
Stars: ✭ 113 (+0.89%)
Mutual labels:  ethereum
Eth Cli
CLI swiss army knife for Ethereum developers
Stars: ✭ 109 (-2.68%)
Mutual labels:  ethereum

ERC-1155: Multi-Token Standard implementation

This repository maintains a secure, efficient and standards-compliant implementation of the ERC-1155 token standard for Ethereum. The implementation was created during Horizon Blockchain Games' participation in the coauthoring of the ERC-1155 and is used by Skyweaver, Opensea, and many other projects since its release.

The ERC-1155 token standard contains multiple classes of tokens referenced by IDs from non-fungible (max supply=1), to semi-fungible (supply=low), to highly fungible (supply=high). Standard interface discussion at ERC-1155.

Getting started

Install

yarn add @0xsequence/erc-1155 or npm install @0xsequence/erc-1155

Usage

pragma solidity ^0.7.4;

import '@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol';

contract MyERC1155Token is ERC1155 {
  ...
}

Description

The contracts in this repository follow a standard implementation of an (ERC-1155 contract. This standard provides basic functionality to track and transfer multiple tokens and the interface provide an API other contracts and off-chain third parties can use.

ERC-1155 contracts keep track of many token balances, which can lead to significant efficiency gains when batch transferring multiple token classes simultaneously. This is particularly useful for fungible tokens that are likely to be transfered together, such as gaming items (cards, weapons, parts of objects, minerals, etc.). The possible efficiency gains are more significant if the amount of tokens each address can own is capped, as shown in this implementation examples.

This repository contains two main implementations of the ERC-1155 token standards: ERC1155 and ERC155PackedBalance. The latter implementation packs multiple balances within a single uint256 using bitwise operations. This brings the cost of transferring 100 different token classes to 467,173 gas, an average of 4,671 gas per token type transfer. Still using MT, but without balance packing, transferring 100 different token types costs 2,763,399 gas, an average of 27,633 gas per token transfer. The latter is already an improvement over multiple fungible tokens that are stored on different contracts, since cross-contract calls have a base cost of 700 gas. This is ignoring the cost of initial approvals that would need to be set for each user and existing ERC-20 tokens.

Specification

A detailed specification document can be found at SPECIFICATIONS.md.

Security Review

@0xsequence/erc-1155 has been audited by two independant parties and all issues discovered were addressed.

** Agustín was hired as a full-time employee at Horizon after the audit was completed. Agustín did not take part in the writing of multi-token-standard contracts.

Dev env & release

This repository is configured as a yarn workspace, and has multiple pacakge.json files. Specifically, we have the root ./package.json for the development environment, contract compilation and testing. Contract source code and distribution files are packaged in "src/package.json".

To release a new version, make sure to bump the version, tag it, and run yarn release. The release command will publish the @0xsequence/erc-1155 package in the "src/" folder, separate from the root package. The advantage here is that application developers who consume @0xsequence/erc-1155 aren't required to install any of the devDependencies in their toolchains as our build and contract packages are separated.

LICENSE

Copyright (c) 2017-present Horizon Blockchain Games Inc.

Licensed under Apache-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].