You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to this tutorial, where you will learn how to create tiered NFTs using Solidity smart contracts and expand the capabilities of your NFT projects. This tutorial builds upon the knowledge gained from our previous *Getting Started with Smart Contract Development* and *Build a Basic NFT* lessons. If you haven't already, we recommend you complete them to familiarise yourself with the fundamentals of Solidity and the concepts we will be building upon in this lesson.
28
+
Welcome to this tutorial, where you will learn how to create tiered NFTs using Solidity smart contracts and expand the capabilities of your NFT projects. This tutorial builds upon the knowledge gained from our previous **Getting Started with Smart Contract Development** and **Build a Basic NFT** lessons. If you haven't already, we recommend you complete them to familiarise yourself with the fundamentals of Solidity and the concepts we will be building upon in this lesson.
30
29
31
30
32
-
Throughout this tutorial, we will provide you with checkpoint questions to test your previous knowledge, predict upcoming steps in the lesson, and allow you to gauge how well you are soaking up the new content. Be sure to check out all the side-drawers for a deeper dive into the concepts, as there will be a quiz at the end of the lesson. We estimage between one and six hours to complete the lesson, depending on your previous experience and your need to learn new ideas. Remember to take regular breaks and enjoy the process of development. We even have a pomodoro timer ⌛ in the menu header to help you pace yourself and remind you to 'touch some grass' and appreciate nature's contribution to our well-being. 🌱
31
+
Throughout this tutorial, we will provide you with checkpoint questions to test your previous knowledge, predict upcoming steps in the lesson, and allow you to gauge how well you are soaking up the new content. Be sure to check out all the side-drawers for a deeper dive into the concepts, as there will be a quiz at the end of the lesson. We estimate between one and six hours to complete the lesson, depending on your previous experience and your need to learn new ideas. Remember to take regular breaks and enjoy the process of development. We even have a pomodoro timer ⌛ in the menu header to help you pace yourself and remind you to "touch grass" and appreciate nature's contribution to our well-being. 🌱
33
32
34
33
## What are we building?
35
34
{/* INTRO AND CONTENTS */}
@@ -58,7 +57,7 @@ Now that we have set the stage, it's time to dive into the exciting world of tie
58
57
- Writing and deploying a Solidity smart contract
59
58
- Creating tiered NFTs with varying levels of rarity and attributes
60
59
- Write scripts for deployment
61
-
- Exploring additional functionalities and possibilities with tiered NFTs ..... in the smart contract!
60
+
- Exploring additional functionalities and possibilities with tiered NFTs ... in the smart contract!
62
61
- Showcasing and trading your tiered NFTs on a public marketplace
63
62
64
63
### Developer tooling
@@ -305,7 +304,7 @@ Now we need to modify the mint function with logic that can access the three NFT
305
304
306
305
The mint function selects tiers based on the amount of native token it receives stored in `msg.value`.
307
306
308
-
The `require` statement is a simple and powerful built-in function of Solidity you'll be using a lot in the future. It checks if the 1st parameter is true or false. On true, it does nothing, allowing execution to continue normally, but on false it throws an exception that reverts everything we modified in the transaction. In our case, if we send the function zero token value, it will **revert** with a "Not enough value for the minimum Tier" message, and stop executing. Otherwise we can select the tier we want..... as long as we can afford it!
307
+
The `require` statement is a simple and powerful built-in function of Solidity you'll be using a lot in the future. It checks if the 1st parameter is true or false. On true, it does nothing, allowing execution to continue normally, but on false it throws an exception that reverts everything we modified in the transaction. In our case, if we send the function zero token value, it will **revert** with a "Not enough value for the minimum Tier" message, and stop executing. Otherwise we can select the tier we want... as long as we can afford it!
309
308
310
309
We already have two `uint256` variables declared. You might wonder which is the *key* and which the *value* inside the `tokenTier` mapping? See if you can track through the code and find out.
311
310
@@ -661,7 +660,7 @@ contract TierNFT is ERC721 {
661
660
662
661
### Where are all our funds? Let's add a withdraw Function!
663
662
664
-
We need to find a way to actually withdraw any funds our contract generates, otherwise they'll get stuck **in the contract** .... that **we** created! Let's import `Ownable.sol`, to get those permissions, so that only **we** can withdraw those funds, and not anyone else. Clever, eh?
663
+
We need to find a way to actually withdraw any funds our contract generates, otherwise they'll get stuck **in the contract** ... that **we** created! Let's import `Ownable.sol`, to get those permissions, so that only **we** can withdraw those funds, and not anyone else. Clever, eh?
665
664
666
665
```solidity
667
666
// Place this next to the other imports at the top:
@@ -930,7 +929,7 @@ For your wallet's private key, the most sensitive data of the project, you need
930
929
notice so you know that you are entering the *danger zone*. Confirm and you'll be able to copy your private key. Add your private key into the `.env` file like so:
931
930
932
931
```bash
933
-
PRIVATE_KEY=f8abc629b....
932
+
PRIVATE_KEY=f8abc629b...
934
933
```
935
934
936
935
<Calloutemoji='💡'size='md'variant='info'>
@@ -952,7 +951,7 @@ configuration files, which may need uploaded to a project's repo.
952
951
953
952
Remember to always **protect your private keys, and your recovery seed phrases** to keep your wallet safe and **unwanted guests out**.
954
953
955
-
### It’s Time . . . .
954
+
### It’s Time . . .
956
955
957
956
We will deploy our smart contract by using this command:
0 commit comments