Skip to content

Commit 4a8adc1

Browse files
committed
[Docs] Stylus dev workflow (#7060)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces documentation and assets for integrating thirdweb tools into the Stylus contract development workflow, specifically for Rust. It includes setup instructions, publishing and deployment commands, and images to enhance the documentation. ### Detailed summary - Added new sections in `page.mdx` for Arbitrum Stylus. - Included prerequisites for Rust and Solidity installations. - Provided setup commands for creating a Stylus project. - Added commands for publishing and deploying Stylus contracts. - Included images (`stylus-publish-page.png`, `stylus-deploy-page.png`) to illustrate the process. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent db53847 commit 4a8adc1

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed
Loading
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { DocImage } from "@doc";
2+
import { Tabs, TabsList, TabsContent } from "@/components/ui/tabs";
3+
import stylusPublishPage from "./assets/stylus-publish-page.png";
4+
import stylusDeployPage from "./assets/stylus-deploy-page.png";
5+
6+
# Arbitrum Stylus
7+
8+
Integrate thirdweb tools in Stylus contract (Rust) development workflow.
9+
10+
Use thirdweb CLI to create, publish, and deploy contracts written with Stylus. The deployed contracts can be used via thirdweb dashboard or SDK.
11+
12+
## Prerequisites
13+
- Rust toolchain should be installed (https://www.rust-lang.org/tools/install)
14+
- Solidity (solc) should be installed (https://docs.soliditylang.org/en/latest/installing-solidity.html)
15+
16+
You can also use the Stylus quickstart guide for reference: https://docs.arbitrum.io/stylus/quickstart
17+
18+
## Getting started
19+
20+
To get started, setup a starter repo (can be skipped if you already have a Stylus project):
21+
22+
<Tabs defaultValue="forge">
23+
<TabsContent value="forge">
24+
```bash
25+
npx thirdweb create-stylus
26+
```
27+
</TabsContent>
28+
</Tabs>
29+
30+
This will setup a project containing a template contract.
31+
32+
## Publishing and Deploying
33+
34+
Use one of these commands to publish or deploy your Stylus contract.
35+
36+
<Tabs defaultValue="forge">
37+
<TabsContent value="forge">
38+
```bash
39+
npx thirdweb publish-stylus -k <YOUR SECRET KEY>
40+
```
41+
</TabsContent>
42+
</Tabs>
43+
44+
OR
45+
46+
<Tabs defaultValue="forge">
47+
<TabsContent value="forge">
48+
```bash
49+
npx thirdweb deploy-stylus -k <YOUR SECRET KEY>
50+
```
51+
</TabsContent>
52+
</Tabs>
53+
54+
Publishing a contract saves the contract metadata to an onchain registry, and creates a contract page from where you can deploy a specific version of this contract multiple times.
55+
56+
This is what you should see:
57+
58+
<DocImage src={stylusPublishPage} />
59+
60+
61+
62+
After deployment, the contract will be available on thirdweb dashboard. You can interact with it via dashboard or integrate it in your app using the code snippets as shown below:
63+
64+
<DocImage src={stylusDeployPage} />
65+
66+
More templates for Stylus Rust contracts and use-case specific installable modules are coming soon.

apps/portal/src/app/contracts/sidebar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ export const sidebar: SideBar = {
799799
},
800800
],
801801
},
802+
// stylus
803+
{
804+
name: "Arbitrum Stylus",
805+
href: `${buildSlug}/stylus`,
806+
},
802807
],
803808
},
804809
{ separator: true },

0 commit comments

Comments
 (0)