ERC721 is the "gold standard" for NFTs. But ERC1155 is another commonly used standard—in fact, it's the one @opensea uses!

So what is ERC115, and how does it differ from ERC721. You guessed it... it's another thread 👇

1/ First, if you haven't read my thread on ERC721, go check that out!

2/ Second, if you want to find out which token standard an NFT on OpenSea uses, just follow this video.
3/ Alright, now let's jump into ERC1155.

The main difference between ERC1155 and ERC721 is that ERC1155 can represent both fungible AND non-fungible tokens.
4/ I explained before how each ERC20 token has its own contract, and how each collection of ERC721 NFTs has its own contract.

You can think of an ERC1155 contract as a mashup of those two—a single contract keeps track of how many fungible and non-fungible tokens people own.
5/ How does this work?

An ERC20 contract stores a mapping from addresses to balances.

An ERC721 contract stores a mapping from token IDs to owners.

An ERC1155 contract stores a mapping from token IDs to another mapping—a mapping from addresses to balances.
6/ For example, an ERC1155 contract's mapping might look like this:

0 => (0x123 => 5, 0x234 => 10)
1 => (0x123 => 1)

0 is the token ID for a fungible token—multiple people can own it.

1 is the token ID for an NFT—only one person owns it.
7/ Why would anyone want to do this? There are two main reasons.
8/ The first reason:

If a project requires multiple token types (e.g. a game), it's cheaper to deploy one ERC1155 contract instead of multiple ERC20/ERC721 contracts.
9/ The second reason:

ERC1155 supports batch transfers. E.g. I can transfer token 1 and token 2 to you in just one transaction. That saves gas, and reduces costs for the end-user.
10/ Note that most NFT collections, like @BoredApeYC, @foxfamnft, and @Pudgy_Penguins use ERC721, because they have no need to support fungible tokens.
11/ That's it! If you have any questions, reach out. And check out @OpenZeppelin for more details on this subject.

docs.openzeppelin.com/contracts/3.x/…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with pencilflip.eth 🍄

pencilflip.eth 🍄 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @pencilflip

23 Oct
I'm currently learning how to program on @solana, and have found it much more difficult than learning to program on Ethereum.

Luckily, there are lots of great resources out there. Here are the ones I've found most helpful! 👇
1/ First, it's helpful to at least slightly understand Rust 🦀 before diving into Solana dev.

Luckily, there's a great free book about it!

You don't need to read the whole thing, just enough to get the syntax down. You can always refer back to it later.

doc.rust-lang.org/book/
2/ Anchor (by @ProjectSerum) is a framework that will make your life much easier.

There are three parts to Anchor:
- A TypeScript library that's similar to web3.js
- Rust crates that make writing Solana programs easier
- A CLI for building/testing, similar to @HardhatHQ
Read 13 tweets
6 Oct
1/ Arweave vs. IPFS, a high-level comparison
2/ Arweave, made by @ArweaveTeam, provides "permanent, resilient storage."

IPFS, made by @protocollabs, is a "distributed system for storing and accessing files, websites, applications, and data."
3/ The main difference is that Arweave guarantees permanence. If you store a file on Arweave, it will never be deleted.

This is not true for IPFS.
Read 16 tweets
6 Oct
My 7 favorite resources for getting started with web3...
1/ @3blue1brown's video "But how does bitcoin actually work?" explains Bitcoin's blockchain, and is the most understandable introduction to blockchain I've come across.

2/ The @ethereum whitepaper explains what Ethereum is and how it works. I recommend skimming it to get the general idea and revisiting it later.

ethereum.org/en/whitepaper/
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(