Deploy Stylus contracts

Deploy Stylus contracts

We have added CLI and SDK support for Stylus contracts.

This allows developers to use thirdweb CLI to create, publish, and deploy their contracts written with Stylus. The deployed contracts can be used via thirdweb dashboard or SDK.

Prerequisites:

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

Here's how to use this feature:

Setup a starter repo (can be skipped if you already have a Stylus project)

npx thirdweb create-stylus

This will setup a project containing a template contract.

You can now publish this contract by running the publish command:

npx thirdweb publish-stylus -k <YOUR SECRET KEY>

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 how it will look:

Alternatively, you can use the deploy command to do a one-time deployment:

npx thirdweb deploy-stylus -k <YOUR SECRET KEY>

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: