Skip to content

[Docs] Stylus dev workflow #7060

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

Merged
merged 1 commit into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions apps/portal/src/app/contracts/build/stylus/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { DocImage } from "@doc";
import { Tabs, TabsList, TabsContent } from "@/components/ui/tabs";
import stylusPublishPage from "./assets/stylus-publish-page.png";
import stylusDeployPage from "./assets/stylus-deploy-page.png";

# Arbitrum Stylus

Integrate thirdweb tools in Stylus contract (Rust) development workflow.

Use thirdweb CLI to create, publish, and deploy contracts written with Stylus. The deployed contracts can be used via thirdweb dashboard or SDK.

## Prerequisites
- Rust toolchain should be installed (https://www.rust-lang.org/tools/install)
- Solidity (solc) should be installed (https://docs.soliditylang.org/en/latest/installing-solidity.html)

You can also use the Stylus quickstart guide for reference: https://docs.arbitrum.io/stylus/quickstart

## Getting started

To get started, setup a starter repo (can be skipped if you already have a Stylus project):

<Tabs defaultValue="forge">
<TabsContent value="forge">
```bash
npx thirdweb create-stylus
```
</TabsContent>
</Tabs>

This will setup a project containing a template contract.

## Publishing and Deploying

Use one of these commands to publish or deploy your Stylus contract.

<Tabs defaultValue="forge">
<TabsContent value="forge">
```bash
npx thirdweb publish-stylus -k <YOUR SECRET KEY>
```
</TabsContent>
</Tabs>

OR

<Tabs defaultValue="forge">
<TabsContent value="forge">
```bash
npx thirdweb deploy-stylus -k <YOUR SECRET KEY>
```
</TabsContent>
</Tabs>

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.

This is what you should see:

<DocImage src={stylusPublishPage} />



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:

<DocImage src={stylusDeployPage} />

More templates for Stylus Rust contracts and use-case specific installable modules are coming soon.
5 changes: 5 additions & 0 deletions apps/portal/src/app/contracts/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,11 @@ export const sidebar: SideBar = {
},
],
},
// stylus
{
name: "Arbitrum Stylus",
href: `${buildSlug}/stylus`,
},
],
},
{ separator: true },
Expand Down
Loading