Thirdweb is one of the platforms that Rootstock supports to enable smooth development and scalable projects. It supports project development and provides tools like an SDK for easy integration and interaction of dApps on Rootstock.
So, if you're someone who struggles with writing or finding deployment scripts, you'll learn about what Thirdweb is, how to set up your project's Client ID and secret key, and how to deploy your smart contract on Rootstock using the Thirdweb CLI in just 5 minutes.
Thirdweb is a full-stack and open-source Web3 development platform that enables developers to build, deploy, and manage scalable dApps on Rootstock (RSK). It offers tools like:
SDKs: such as ConnectWallet and functions that facilitate the integration of wallets and smart contracts into your dApps.
Dashboard: A user-friendly interface that allows developers to manage their projects, monitor smart contract interactions, and view analytics.
CLI: A command-line interface that provides developers with the ability to deploy and manage smart contracts directly from their terminal.
Automatic Verified Contract: When you deploy your contract using Thirdweb, it gets verified automatically. This means you don't have to worry about verifying your smart contract after deployment.
For more information visit thirdweb’s site or documentation.
Before you can deploy your smart contract, you will need a Client ID and Secret key
Go to dashboard
Click on Add New
Click on Project
Enter your project details, you can authorize specific domains including the local server or allow all domains.
To allow all domains, click on “Allow all domains”
Click on “Create”
Copy your Client ID and Secret Key
It's very important to keep your secret key because you won't be able to access it again, unlike the client ID.
You will see your new project when you’re being routed back to your dashboard.
Congratulations, you’ve successfully created a client ID and Secret key for your project 🎉.
Create a new folder
Open the folder in your terminal and run the following command:
npx thirdweb create
Select “Contract” using the Arrow function
Enter the name of your Contract folder
Select the deployment framework of your choice
Enter the name of your contract
Select any type of contract or empty contract
What is happening here is that thirdweb already have some contract templates you can work with e.g for Token, NFTs or Novel token
Once you press enter, some packages will install which may take a longer time to install or less.
Upon successful installation, you will see something like this ⬇️
Open the project in your code Editor and navigate to the project folder
Run the following command:
npx thirdweb -k {secret key}
Your contract will compile automatically like this:
You will see a link to deploy your contract, click on it
Ensure your wallet is connected to Rootstock Testnet.
Fill in the details of your contract and click on “Deploy”
To import the contract to your dashboard, click on “Import so I can find it in the list of my contracts”
After a successful deployment, you will see your deploy status. Click “View Contract”
You will see your contact details including the contract address
Congratulations, you have successfully deployed your smart contract on Rootstock using thirdweb
You can get some code snippets for interacting with the smart contract.
On the side nav bar, click on “Code Snippets”
You see how to install the SDK and initialize the SDK in your project including Rootstock chain ID(31)
Scroll down to see all the functions and code snippets js and its frameworks
Using thirdweb is the easiest and most efficient way to deploy your smart contract on Rootstock especially if you are a beginner in the ecosystem. Following the steps, developers can easily set up their project’s Client ID and Secret key, create and deploy smart contracts, and even access code snippets for further interaction. This streamlined approach enhances productivity and empowers developers to focus on building innovative solutions on the Rootstock platform.