npx thirdweb release
Release A Contract
From the same directory as your smart contract(s), run the following command to:
- Compile your smart contract.
- Upload the contract source code (ABI) to IPFS.
- Open the release flow in the dashboard.
npx thirdweb@latest release
Open the generated URL in your browser and follow the steps below to release your contract.
Configure Contract Metadata
From the dashboard, provide metadata about your smart contract such as a name, image, description and more.
This information is what users will see when they visit your smart contract from the explore page.
Add A Version
Use semantic versioning to incrementally release new versions of your smart contract; ideal for when you want to make changes to your smart contract but don't want to break existing integrations.
Each version of your smart contract is stored on-chain and can be deployed by anyone, and can optionally include release notes to describe the changes you've made between versions.
Describe Constructor Parameters
Help users trying to deploy your smart contract by providing a description of each constructor parameter.
Finally, click the "Create Release" button to publish your smart contract to the on-chain registry.
Get Your Release Featured
Releasing your contract on thirdweb is the best way to get your protocol in front of 60k+ web3 developers.
Contact Us to apply to have your contract featured on the explore page.
EIP-1967 Proxy contracts
When releasing a contract, you can choose to let others deploy a "proxy" of a pre-deployed contract. Since proxies are much lighter weight than the actual full contract, they are much cheaper to deploy. Proxy deploys only requiring a fraction of the gas of a normal deploy.
This feature has a requirement however, the "main" contract, referred to as the "implementation" needs to be deployed on chain already.
Here's the step-by-step flow to create a release with proxy deploys enabled:
- Your contract needs to implement the upgradeable pattern, generally means it has an "initialize" function instead of a regular constructo
npx thirdweb releasefrom your project
- On the create release page, check "Deployable via proxy"
- This will reveal a new section, where you can deploy your implementations on any supported chain in one click.
- Deploy your implementations on your desired chains (addresses are saved automatically)
- Create your release
Now anyone can deploy proxies of your contract simply by clicking "deploy" on your release page.
Another way to let users deploy your contracts is by using a factory contract. This allows you to not only provide cheap deployments, but also to add extra logic that will be executed when others deploy your contracts.
To enable factory deploys, you will need to deploy a factory contract that implements the IContractFactory interface. This is a simple interface with one function that you can implement to add deploy contracts any way you like, and add your custom logic on top. This is extremely useful when deploying a contract requires multiple steps, having the factory take care of the heavy lifting.
Here's the step-by-step flow to create a release with factory deploys enabled:
- Follow steps 1 to 5
- Check "Deployable via factory"
- Fill in the addresses of your factory contracts on each chain
- Create your release
That's it, now when people click deploy from your release page, your factory will be invoked instead.