Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidated NFT tutorial #502

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Consolidated NFT tutorial #502

wants to merge 20 commits into from

Conversation

timothymcmackin
Copy link
Collaborator

@timothymcmackin timothymcmackin commented Jan 7, 2025

We have a few tutorials around NFTs. This creates a single one to rule them all; then we can remove the other tutorials.

Source code: trilitech/tutorial-applications#17

Preview: https://docs-staging-git-merge-nft-tutorials-trili-tech.vercel.app/tutorials/nft-consolidated

This tutorial covers frontend and backend parts of an NFT application. It starts with the front end and uses a predeployed smart contract. Then it has the user deploy their own contract and switch the application to it. I think this might ease developers into it because the web application part is less of a leap for most programmers.

After merging this tutorial, we can delete these tutorials:

@timothymcmackin timothymcmackin self-assigned this Jan 7, 2025
Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-staging ✅ Ready (Inspect) Visit Preview Jan 13, 2025 9:10pm

Copy link
Collaborator

@NicNomadic NicNomadic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran up to Part 3, included.


<img src="/img/tutorials/nft-consolidated-show-info-ids.png" alt="The application showing the IDs of the owned NFTs" style={{width: 500}} />

The source code of the completed application is available here: https://github.com/trilitech/tutorial-applications/tree/main/nft-consolidated.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo doesn't exist, or perhaps just not yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be created with trilitech/tutorial-applications#17.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, once that PR is merged let's try again.

docs/tutorials/nft-consolidated/setting-up-app.md Outdated Show resolved Hide resolved
</script>

<style lang="scss">
/* Your Sass code */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it rather "Scss", as implied by the tag just above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, that's the default code for this file. I'll change it to "your styles."

docs/tutorials/nft-consolidated/setting-up-app.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/setting-up-app.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/setting-up-app.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/connect-wallet.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/send-transactions.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/send-transactions.md Outdated Show resolved Hide resolved
Co-authored-by: NicNomadic <[email protected]>
timothymcmackin and others added 4 commits January 10, 2025 12:43
Copy link
Collaborator

@NicNomadic NicNomadic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also executed Step 4

docs/tutorials/nft-consolidated/create-contract.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/create-contract.md Outdated Show resolved Hide resolved
docs/tutorials/nft-consolidated/create-contract.md Outdated Show resolved Hide resolved
return True
```

You can omit this override to use the default behavior, but in this case you must set an administrator account when you deploy the contract or else you will not be able to mint any tokens.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These instructions are confusing. Either you instruct to omit the override, but then the test says "only admins can mint", so you have to instruct the reader to modify the first mint test to allow the mint by Bob.

Or you instruct to not override, but then you explain how to set the adiminstrator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this section about the override.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but did you fix the tests accordingly? The first test expected Bob NOT to be able to mint. I had to fix manually this expectation for the tests to pass.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just went through the instructions and the created contract works including the tests. With the changes to the admin (setting your address as admin), Bob is not supposed to be able to mint and that's what the tests show. Maybe try the steps again from the beginning? The contract should match this one: https://github.com/trilitech/tutorial-applications/blob/main/create-nfts/contract/fa2-from-template.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then why it's still written:"The overridden version always returns true, so anyone can mint a token."? Where is this overridden version?

Anyways, just check that and I trust you that it works, I won't be able to test the whole thing again.

docs/tutorials/nft-consolidated/create-contract.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@NicNomadic NicNomadic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also executed Step 5, so the review is complete

@timothymcmackin timothymcmackin marked this pull request as ready for review January 10, 2025 20:47
timothymcmackin and others added 3 commits January 10, 2025 15:48
Co-authored-by: NicNomadic <[email protected]>
Co-authored-by: NicNomadic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants