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.
2/ Only the owner of the smart contract is allowed to change the status.
3/ The minting function is simple, it just calls a different function depending on "_mintStatus."
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.
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!
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.
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.
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