Skip to content

Commit 20b6bde

Browse files
committed
fixes
1 parent 3ad92e1 commit 20b6bde

16 files changed

+35
-34
lines changed

website/docs/0-intro.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
id: introduction
3+
slug: /
34
title: NFT Zero to Hero
45
sidebar_label: Introduction
56
description: "Learn how to mint NFTs and build a full NFT contract step by step."
@@ -16,11 +17,11 @@ To complete these tutorials successfully, you'll need:
1617

1718
- [Rust](https://www.rust-lang.org/tools/install)
1819
- [A Testnet wallet](https://testnet.mynearwallet.com/create)
19-
- [NEAR-CLI](/tools/near-cli#installation)
20+
- [NEAR-CLI](https://docs.near.org/tools/near-cli#installation)
2021
- [cargo-near](https://github.com/near/cargo-near)
2122

2223
:::info New to Rust?
23-
If you are new to Rust and want to dive into smart contract development, our [Quick-start guide](../../smart-contracts/quickstart.md) is a great place to start
24+
If you are new to Rust and want to dive into smart contract development, our [Quick-start guide](https://docs.near.org/smart-contracts/quickstart) is a great place to start
2425
:::
2526

2627
---
@@ -31,21 +32,21 @@ These are the steps that will bring you from **_Zero_** to **_Hero_** in no time
3132

3233
| Step | Name | Description |
3334
|------|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
34-
| 1 | [Pre-deployed contract](/tutorials/nfts/predeployed-contract) | Mint an NFT without the need to code, create, or deploy a smart contract. |
35-
| 2 | [Contract architecture](/tutorials/nfts/skeleton) | Learn the basic architecture of the NFT smart contract and compile code. |
36-
| 3 | [Minting](/tutorials/nfts/minting) | Flesh out the skeleton so the smart contract can mint a non-fungible token. |
37-
| 4 | [Upgrade a contract](/tutorials/nfts/upgrade-contract) | Discover the process to upgrade an existing smart contract. |
38-
| 5 | [Enumeration](/tutorials/nfts/enumeration) | Explore enumeration methods that can be used to return the smart contract's states. |
39-
| 6 | [Core](/tutorials/nfts/core) | Extend the NFT contract using the core standard which allows token transfer. |
40-
| 7 | [Events](/tutorials/nfts/events) | The events extension, allowing the contract to react on certain events. |
41-
| 8 | [Approvals](/tutorials/nfts/approvals) | Expand the contract allowing other accounts to transfer NFTs on your behalf. |
42-
| 9 | [Royalty](/tutorials/nfts/royalty) | Add NFT royalties allowing for a set percentage to be paid out to the token creator. |
43-
| 10 | [Marketplace](/tutorials/nfts/marketplace) | Learn about how common marketplaces operate on NEAR and dive into some of the code that allows buying and selling NFTs. |
35+
| 1 | [Pre-deployed contract](0-predeployed.md) | Mint an NFT without the need to code, create, or deploy a smart contract. |
36+
| 2 | [Contract architecture](1-skeleton.md) | Learn the basic architecture of the NFT smart contract and compile code. |
37+
| 3 | [Minting](2-minting.md) | Flesh out the skeleton so the smart contract can mint a non-fungible token. |
38+
| 4 | [Upgrade a contract](2-upgrade.md) | Discover the process to upgrade an existing smart contract. |
39+
| 5 | [Enumeration](3-enumeration.md) | Explore enumeration methods that can be used to return the smart contract's states. |
40+
| 6 | [Core](4-core.md) | Extend the NFT contract using the core standard which allows token transfer. |
41+
| 7 | [Events](7-events.md) | The events extension, allowing the contract to react on certain events. |
42+
| 8 | [Approvals](5-approvals.md) | Expand the contract allowing other accounts to transfer NFTs on your behalf. |
43+
| 9 | [Royalty](6-royalty.md) | Add NFT royalties allowing for a set percentage to be paid out to the token creator. |
44+
| 10 | [Marketplace](8-marketplace.md) | Learn about how common marketplaces operate on NEAR and dive into some of the code that allows buying and selling NFTs. |
4445

4546
---
4647

4748
## Next steps
4849

49-
Ready to start? Jump to the [Pre-deployed Contract](/tutorials/nfts/predeployed-contract) tutorial and begin your learning journey!
50+
Ready to start? Jump to the [Pre-deployed Contract](0-predeployed.md) tutorial and begin your learning journey!
5051

5152
If you already know about non-fungible tokens and smart contracts, feel free to skip and jump directly to the tutorial of your interest. The tutorials have been designed so you can start at any given point!

website/docs/0-predeployed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Create your first non-fungible token by using a pre-deployed NFT smart contract
1414

1515
## Prerequisites
1616

17-
To complete this tutorial successfully, you'll need [a NEAR Wallet](https://testnet.mynearwallet.com/create) and [NEAR CLI](/tools/near-cli#installation)
17+
To complete this tutorial successfully, you'll need [a NEAR Wallet](https://testnet.mynearwallet.com/create) and [NEAR CLI](https://docs.near.org/tools/near-cli#installation)
1818

1919
---
2020

@@ -146,7 +146,7 @@ Now try going to your [NEAR Wallet](https://testnet.mynearwallet.com) and view y
146146

147147
This basic example illustrates all the required steps to call an NFT smart contract on NEAR and start minting your own non-fungible tokens.
148148

149-
Now that you're familiar with the process, you can jump to [Contract Architecture](/tutorials/nfts/skeleton) and learn more about the smart contract structure and how you can build your own NFT contract from the ground up.
149+
Now that you're familiar with the process, you can jump to [Contract Architecture](1-skeleton.md) and learn more about the smart contract structure and how you can build your own NFT contract from the ground up.
150150

151151
***Happy minting!*** 🪙
152152

website/docs/1-skeleton.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You can find the skeleton contract in our [GitHub repository](https://github.com
1515
:::
1616

1717
:::info New to Rust?
18-
If you are new to Rust and want to dive into smart contract development, our [Quick-start guide](../../smart-contracts/quickstart.md) is a great place to start.
18+
If you are new to Rust and want to dive into smart contract development, our [Quick-start guide](https://docs.near.org/smart-contracts/quickstart) is a great place to start.
1919
:::
2020

2121
---
@@ -90,7 +90,7 @@ This file contains the logic that complies with the standard's [approvals manage
9090

9191
<Github language="rust" start="4" end="33" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-basic/src/approval.rs" />
9292

93-
You'll learn more about these functions in the [approvals section](/tutorials/nfts/approvals) of the Zero to Hero series.
93+
You'll learn more about these functions in the [approvals section](5-approvals.md) of the Zero to Hero series.
9494

9595
---
9696

@@ -107,7 +107,7 @@ You'll learn more about these functions in the [approvals section](/tutorials/nf
107107

108108
<Github language="rust" start="4" end="44" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-skeleton/src/enumeration.rs" />
109109

110-
You'll learn more about these functions in the [enumeration section](/tutorials/nfts/enumeration) of the tutorial series.
110+
You'll learn more about these functions in the [enumeration section](3-enumeration.md) of the tutorial series.
111111

112112
---
113113

@@ -126,7 +126,7 @@ The initialization functions (`new`, `new_default_meta`) can only be called once
126126

127127
<Github language="rust" start="47" end="73" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-skeleton/src/lib.rs" />
128128

129-
You'll learn more about these functions in the [minting section](/tutorials/nfts/minting) of the tutorial series.
129+
You'll learn more about these functions in the [minting section](2-minting.md) of the tutorial series.
130130

131131
---
132132

@@ -144,7 +144,7 @@ You'll learn more about these functions in the [minting section](/tutorials/nfts
144144

145145
<Github language="rust" start="12" end="60" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-skeleton/src/metadata.rs" />
146146

147-
You'll learn more about these functions in the [minting section](/tutorials/nfts/minting) of the tutorial series.
147+
You'll learn more about these functions in the [minting section](2-minting.md) of the tutorial series.
148148

149149
---
150150

@@ -174,7 +174,7 @@ You'll learn more about these functions in the [minting section](/tutorials/nfts
174174

175175
<Github language="rust" start="7" end="56" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-skeleton/src/nft_core.rs" />
176176

177-
You'll learn more about these functions in the [core section](/tutorials/nfts/core) of the tutorial series.
177+
You'll learn more about these functions in the [core section](4-core.md) of the tutorial series.
178178

179179
---
180180

@@ -189,7 +189,7 @@ You'll learn more about these functions in the [core section](/tutorials/nfts/co
189189

190190
<Github language="rust" start="3" end="17" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-skeleton/src/royalty.rs" />
191191

192-
You'll learn more about these functions in the [royalty section](/tutorials/nfts/royalty) of the tutorial series.
192+
You'll learn more about these functions in the [royalty section](6-royalty.md) of the tutorial series.
193193

194194
---
195195

@@ -206,7 +206,7 @@ You'll learn more about these functions in the [royalty section](/tutorials/nfts
206206

207207
<Github language="rust" start="5" end="79" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-events/src/events.rs" />
208208

209-
You'll learn more about these functions in the [events section](/tutorials/nfts/events) of the tutorial series.
209+
You'll learn more about these functions in the [events section](7-events.md) of the tutorial series.
210210

211211
---
212212

website/docs/2-minting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ For deployment, you will need a NEAR account with the keys stored on your local
230230
Please ensure that you deploy the contract to an account with no pre-existing contracts. It's easiest to simply create a new account or create a sub-account for this tutorial.
231231
:::
232232

233-
Log in to your newly created account with [`near-cli-rs`](../../tools/cli.md) by running the following command in your terminal.
233+
Log in to your newly created account with [`near-cli-rs`](https://docs.near.org/tools/cli) by running the following command in your terminal.
234234

235235
```bash
236236
near account import-account using-web-wallet network-config testnet

website/docs/2-upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Upgrading contracts, when done right, can be an immensely powerful tool. If done
2424

2525
The NEAR Runtime will read the serialized state from disk and it will attempt to load it using the current contract code. When your code changes, it might not be able to figure out how to do this.
2626

27-
You need to strategically upgrade your contracts and make sure that the runtime will be able to read your current state with the new contract code. For more information about upgrading contracts and some best practices, see the NEAR SDK's [upgrading contracts](../../smart-contracts/release/upgrade.md) write-up.
27+
You need to strategically upgrade your contracts and make sure that the runtime will be able to read your current state with the new contract code. For more information about upgrading contracts and some best practices, see the NEAR SDK's [upgrading contracts](https://docs.near.org/smart-contracts/release/upgrade) write-up.
2828

2929
---
3030

website/docs/3-enumeration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ This should return an output similar to the following:
140140

141141
## Conclusion
142142

143-
In this tutorial, you have added two [new enumeration functions](/tutorials/nfts/enumeration#modifications-to-the-contract), and now you have a basic NFT smart contract with minting and enumeration methods in place. After implementing these modifications, you redeployed the smart contract and tested the functions using the CLI.
143+
In this tutorial, you have added two [new enumeration functions](#modifications-to-the-contract), and now you have a basic NFT smart contract with minting and enumeration methods in place. After implementing these modifications, you redeployed the smart contract and tested the functions using the CLI.
144144

145145
In the [next tutorial](4-core.md), you'll implement the core functions needed to allow users to transfer the minted tokens.
146146

website/docs/4-core.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ You'll start by implementing the `nft_transfer` logic. This function will transf
6161

6262
<Github language="rust" start="60" end="80" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-basic/src/nft_core.rs" />
6363

64-
There are a couple things to notice here. Firstly, we've introduced a new function called `assert_one_yocto()`, which ensures the user has attached exactly one yoctoNEAR to the call. This is a [security measure](../../smart-contracts/security/one_yocto.md) to ensure that the user is signing the transaction with a [full access key](../../protocol/access-keys.md).
64+
There are a couple things to notice here. Firstly, we've introduced a new function called `assert_one_yocto()`, which ensures the user has attached exactly one yoctoNEAR to the call. This is a [security measure](https://docs.near.org/smart-contracts/security/one_yocto) to ensure that the user is signing the transaction with a [full access key](https://docs.near.org/protocol/access-keys).
6565

6666
Since the transfer function is potentially transferring very valuable assets, you'll want to make sure that whoever is calling the function has a full access key.
6767

@@ -125,7 +125,7 @@ This way, we can effectively **attach an NFT to a function call**.
125125

126126
<Github language="rust" start="82" end="126" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-basic/src/nft_core.rs" />
127127

128-
The function will first assert that the caller attached exactly 1 yocto for security purposes. It will then transfer the NFT using `internal_transfer` and start the cross contract call. It will call the method `nft_on_transfer` on the `receiver_id`'s contract, and create a promise to call back `nft_resolve_transfer` with the result. This is a very common workflow when dealing with [cross contract calls](../../smart-contracts/anatomy/crosscontract.md).
128+
The function will first assert that the caller attached exactly 1 yocto for security purposes. It will then transfer the NFT using `internal_transfer` and start the cross contract call. It will call the method `nft_on_transfer` on the `receiver_id`'s contract, and create a promise to call back `nft_resolve_transfer` with the result. This is a very common workflow when dealing with [cross contract calls](https://docs.near.org/smart-contracts/anatomy/crosscontract).
129129

130130
As dictated by the core standard, the function we are calling (`nft_on_transfer`) needs to return a boolean stating whether or not you should return the NFT to its original owner.
131131

website/docs/5-approvals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Now that you've added the support for approved account IDs and the next approval
149149

150150
<Github language="rust" start="38" end="95" url="https://github.com/near-examples/nft-tutorial/blob/main/nft-contract-approval/src/approval.rs" />
151151

152-
The function will first assert that the user has attached **at least** one yoctoNEAR (which we'll implement soon). This is both for security and to cover storage. When someone approves an account ID, they're storing that information on the contract. As you saw in the [minting tutorial](/tutorials/nfts/minting), you can either have the smart contract account cover the storage, or you can have the users cover that cost. The latter is more scalable and it's the approach you'll be working with throughout this tutorial.
152+
The function will first assert that the user has attached **at least** one yoctoNEAR (which we'll implement soon). This is both for security and to cover storage. When someone approves an account ID, they're storing that information on the contract. As you saw in the [minting tutorial](2-minting.md), you can either have the smart contract account cover the storage, or you can have the users cover that cost. The latter is more scalable and it's the approach you'll be working with throughout this tutorial.
153153

154154
After the assertion comes back with no problems, you get the token object and make sure that only the owner is calling this method. Only the owner should be able to allow other accounts to transfer their NFTs. You then get the next approval ID and insert the passed in account into the map with the next approval ID. If it's a new approval ID, storage must be paid. If it's not a new approval ID, no storage needs to be paid and only attaching 1 yoctoNEAR would be enough.
155155

website/docs/9-series.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ If you now query for the metadata of the contract, it should return our default
337337

338338
## Creating The Series
339339

340-
The next step is to create two different series. One will have a price for lazy minting and the other will simply be a basic series with no price. The first step is to create an owner [sub-account](/tools/near-cli#create) that you can use to create both series
340+
The next step is to create two different series. One will have a price for lazy minting and the other will simply be a basic series with no price. The first step is to create an owner [sub-account](https://docs.near.org/tools/near-cli#create) that you can use to create both series
341341

342342
<Tabs groupId="cli-tabs">
343343
<TabItem value="short" label="Short">
@@ -547,7 +547,7 @@ Which has
547547

548548
## Minting NFTs
549549

550-
Now that you have both series created, it's time to now mint some NFTs. You can either login with an existing NEAR wallet using [`near login`](/tools/near-cli#import) or you can create a sub-account of the NFT contract. In our case, we'll use a sub-account.
550+
Now that you have both series created, it's time to now mint some NFTs. You can either login with an existing NEAR wallet using [`near login`](https://docs.near.org/tools/near-cli#import) or you can create a sub-account of the NFT contract. In our case, we'll use a sub-account.
551551

552552
<Tabs groupId="cli-tabs">
553553
<TabItem value="short" label="Short">

website/docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {themes as prismThemes} from 'prism-react-renderer';
1010

1111
/** @type {import('@docusaurus/types').Config} */
1212
const config = {
13-
title: 'FT Tutorial',
13+
title: 'NFT Tutorial',
1414
tagline: 'NEAR Protocol',
1515
favicon: 'img/favicon.ico',
1616

@@ -23,12 +23,12 @@ const config = {
2323
url: 'https://near-examples.github.io',
2424
// Set the /<baseUrl>/ pathname under which your site is served
2525
// For GitHub pages deployment, it is often '/<projectName>/'
26-
baseUrl: '/ft-tutorial/',
26+
baseUrl: '/nft-tutorial/',
2727

2828
// GitHub pages deployment config.
2929
// If you aren't using GitHub pages, you don't need these.
3030
organizationName: 'near-examples', // Usually your GitHub org/user name.
31-
projectName: 'ft-tutorial', // Usually your repo name.
31+
projectName: 'nft-tutorial', // Usually your repo name.
3232

3333
onBrokenLinks: 'throw',
3434

0 commit comments

Comments
 (0)