-
Notifications
You must be signed in to change notification settings - Fork 64
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
feat: add thirdweb tutorials #4
feat: add thirdweb tutorials #4
Conversation
hi @avneesh0612 thanks for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs a rewrite to be merged.
The smart contract tutorial is closer to a tutorial than the dapp tutorial. However, it does not follow through like a single storyline which I would vow for considering there could be new developers following this. Moreover, the deployment failed for me with an error message which I hope is an anomaly as it could also throw other readers off.
The dApp tutorial is far from a tutorial at the moment, it mentions several functionalities without linking them together in a development flow which is more akin to a ref doc than a tutorial. I strongly suggest changing this to a story format such that readers may follow along to experience the tooling.
To create a new application pre-configured with thirdweb’s SDKs run and choose your preferred configurations: | ||
|
||
```jsx | ||
npx thirdweb create app --evm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this a little confusing. Is the reader supposed to follow the steps outlined above after running npx thirdweb create --app
or these right here?
|
||
thirdweb provides several SDKs to allow you to interact with your contract including: [React](https://portal.thirdweb.com/react?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs), [React Native](https://portal.thirdweb.com/react-native?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs), [TypeScript](https://portal.thirdweb.com/typescript?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs), [Python](https://portal.thirdweb.com/python?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs), [Go](https://portal.thirdweb.com/go?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs), and [Unity](https://portal.thirdweb.com/unity?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs). | ||
|
||
This document will show you how to interact with your contract deployed to zkSync Era using React |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my view, if the text assumes the reader has a contract ready and deployed it becomes less of a tutorial and more of a ref doc. I'd suggest including an address here of a deployed contract and elaborate on its methods/logic.
|
||
#### Initialize SDK On zkSync Era | ||
|
||
Wrap your application in the `ThirdwebProvider` component and change the `activeChain` to zkSync Era |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this again confusing. I was under the impression this would walk the reader through creating an application or teaching the reader how the code of an application interacts with a contract. I appreciate the syntax is uncomplicated and important to highlight, but without the educational portion I'd argue this does not belong in a tutorial section.
To connect to your contract, use the SDK’s [`getContract`](https://portal.thirdweb.com/typescript/sdk.thirdwebsdk.getcontract?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs) method. | ||
|
||
```jsx | ||
import { useContract } from "@thirdweb-dev/react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text above mentions getContract
but this code showcases useContract
, would be more clear if the two were to align, or if some explanation would be given for the difference
@@ -0,0 +1,10 @@ | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to hold an overview of the tutorials in one JSON file in the root dir of the repo, please add this there
1. In your CLI run the following command: | ||
|
||
``` | ||
npx thirdweb create contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tutorial should either mention thirdweb
should be installed globally on the system or change this command to something along the lines of: npx @thirdweb/cli create contract
- Inheriting the contract by declaring that our contract is an ERC721Base contract | ||
- Implementing any required methods, such as the constructor. | ||
|
||
5. After modifying your contract with your desired custom logic, you may deploy it to zkSync Era using [Deploy](https://portal.thirdweb.com/deploy?utm_source=zksync&utm_medium=docs&utm_campaign=chain_docs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires an API key, I'd prefer for this text to have a warning here before redirecting to the site
|
||
--- | ||
|
||
Alternatively, you can deploy a prebuilt contract for NFTs, tokens, or marketplace directly from the thirdweb Explore page: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be more helpful in another tutorial or in any case this is information that deserves to be on its own. As a follower of the tutorial, adding options on things to do is confusing when I am just becoming acquainted with a new tool
- `_royaltyRecipient`: wallet address to receive royalties from secondary sales | ||
- `_royaltyBps`: basis points (bps) that will be given to the royalty recipient for each secondary sale, e.g. 500 = 5% | ||
3. Select `ZksyncEra` as the network | ||
4. Manage additional settings on your contract’s dashboard as needed such as uploading NFTs, configuring permissions, and more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, after (creating an API key on the webUI and) running npx thirdweb deploy
and filling the fields returned an error:
Failed to deploy contract
Contract bytecode is invalid. 0x{"error":"Not Found"}
If you believe this is incorrect or the error persists, please reach out in [discord](https://discord.gg/thirdweb).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@avneesh0612 can you confirm if npx thidweb deploy
uses the zksolc compiler behind the scenes? All contracts deployed on zkSync Era must be compiled with our compilers
@@ -0,0 +1,10 @@ | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as with other JSON file
Closes #11 |
Tutorial submission
Title of the tutorial
Brief tutorial description
The first guide includes creating and deploying a smart contract on zkSync and the second one includes creating and deploying a dapp.
Checklist