Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thirdweb-dev/cli

Package Overview
Dependencies
Maintainers
7
Versions
1399
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thirdweb-dev/cli

The thirdweb CLI is your one-stop-shop for publishing custom contracts for your team or the world to use. The CLI uploads all necessary data to decentralized storage and makes it available to deploy via the thirdweb sdk or thirdweb dashboard.

  • 0.2.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
230
decreased by-15.44%
Maintainers
7
Weekly downloads
 
Created
Source

thirdweb cli

The thirdweb CLI is your one-stop-shop for publishing custom contracts for your team or the world to use. The CLI uploads all necessary data to decentralized storage and makes it available to deploy via the thirdweb sdk or thirdweb dashboard.

This brings all the capabilities of thirdweb to your own custom contracts.

1. Extending ThirdwebContract

In order to publish a contract and get all the benefits of the thirdweb platform, your contract needs to extend ThirdwebContract.

From your project, add the thirdweb contracts dependency:

yarn add @thirdweb-dev/contracts@byoc

or with npm

npm i @thirdweb-dev/contracts@byoc

Once installed, in your Solidity contract you want to publish, import and extend ThirdwebContract. Here's an example:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@thirdweb-dev/contracts/ThirdwebContract.sol";

contract HellowWorldContract is ThirdwebContract {
    // your contract code
}

2. Publishing your contract

Once your contract code is setup like above, you can now publish it by running:

npx @thirdweb-dev/cli publish

Alternatively, you install the CLI as a global command on your machine:

npm i -g @thirdweb-dev/cli
thirdweb publish

This command will:

  • auto-detect any contract that extends ThirdwebContract in your project
  • compile your project
  • Upload ABIs to IPFS
  • Open the publish flow in your thirdweb dashboard in a browser

From the thirdweb dashboard, you can review and publish your contracts. Published contracts can be deployed via the dashboard on with our SDKs.


Supported projects

To publish, you need to be in a directory that contains a project which the CLI is compatible with. The projects we support so far:

  • hardhat

Coming soon:

  • forge
  • truffle

Running the examples

Clone the repo and run this command after installing the CLI tool:

$ cd examples/hardhat
$ thirdweb publish

Local Development

The simplest way to work on the CLI locally is to:

  1. Install the package locally
  2. Run the build:watch command to compile any changes in realtime
$ npm install -g ./
$ yarn run build:watch

TODO: figure out how to do the global local installation with yarn

FAQs

Package last updated on 27 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc