|
| 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. |
0 commit comments