How do NFT whitelists work on Ethereum? It's pretty simpleβ€”let's take a look at the @smilesssvrs smart contract to see how they did it πŸ‘‡

1/ The contract has a state variable called "_mintStatus."

This determines whether minting is only open to people on the whitelist (Acts 1-4), or is open to the public (Public 1-2).

Each status is associated with a minting limit. E.g. during Act 1, one person can mint 9 NFTs. Image
2/ Only the owner of the smart contract is allowed to change the status. Image
3/ The minting function is simple, it just calls a different function depending on "_mintStatus." Image
4/ Each minting function is pretty similar.

If the user has already minted the max amount of NFTs, the transaction fails.

Otherwise, a certain number of NFTs will be minted to the user.

The "premint" function also checks that the user is on the whitelist.
5/ How do people get onto the whitelist?

This is also pretty simple. There's a function called "addToPremintList" that's only callable by the contract's owner.

This function just adds a bunch of addresses to a mapping from addresses to mint statuses. Image
6/ For example, if 0x123 maps to MintStatus.ACT_I, then user 0x123 is on the whitelist for Act 1.
7/ That's it! Here's a quick recap:
- There's a state variable called "_mintStatus", only the owner can change it. It controls how minting works
- During Acts 1-4, only people on the whitelist can mint
- The whitelist can be updated by the contract's owner
8/ If you want to learn more about how NFTs work, head over here!

9/ Lastly, you can view the smart contract code here

etherscan.io/address/0x177e…

β€’ β€’ β€’

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

Keep Current with pencilflip.sol πŸ„ (πŸ“œ,πŸ“œ)

pencilflip.sol πŸ„ (πŸ“œ,πŸ“œ) 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

12 Nov
gm πŸ„ Excited to share @TheMycoverse, the project @petrichorate and I are working on!

We're starting with a mushroom-inspired NFT collection (b/c mushrooms are awesome), but our larger goal is to help onboard more artists and creators into web3.
Right now, getting into web3 as an artist is hard πŸ˜΅β€πŸ’«.

Which blockchain should you choose? Which marketplace should you list on? How do you make an NFT collection? How do you airdrop NFTs to people? How do you market yourself?
We're building a community that cares about helping artists. With that community, we'll create tools and resources that make it easy for any artist or creator to get started with web3.
Read 4 tweets
3 Nov
PDAs, or program derived addresses, are one of the trickier #Solana concepts πŸ€”. They're also something that every Solana dev should understand.

In this thread, I'll go over what they are, and why they're useful πŸ‘‡
1/ First of all, if you don't know how Solana's account model works, check out this thread. It's only 5 tweets!

2/ Now, onto PDAs, or program derived addresses.

The name is pretty self-explanatoryβ€”a PDA is an address derived from a program.

The address points to a data account, which can hold state.
Read 37 tweets
25 Oct
Proof of Stake is used by #Solana and Ethereum 2.0. But what is Proof of Stake, and how does it work? A short thread πŸ‘‡
1/ "Proof of stake is a type of consensus mechanism used by blockchain networks to achieve distributed consensus."

In other words, Proof of Stake enables nodes in a blockchain network to agree on the state of the blockchain.
2/ For example, nodes should agree on:

- Which blocks are included in the blockchain
- Which transactions are included in each block
Read 12 tweets
24 Oct
#Solana accounts explained in 5 tweets πŸ‘‡
1/ There are 2 kinds of accounts in Solana.

Data accounts store data. Program accounts store executable programs.

Each account has an address (usually a public key) and an owner (address of a program account). There are a few more fields every account stores, see πŸ‘‡
2/ There are a few important ownership rules:

- Only a data account's owner can modify its data and subtract lamports.
- Anyone is allowed to give lamports to a data account.
- The owner of an account may assign a new owner if the account's data is zeroed out.
Read 7 tweets
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
21 Oct
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.
Read 12 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

Thank you for your support!

Follow Us on Twitter!

:(