Coder Social home page Coder Social logo

lrochetta / thirdweb-thirdweb-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thirdweb-dev/thirdweb-cli

0.0 0.0 0.0 533 KB

Publish and deploy smart contracts without dealing with private keys

Home Page: https://thirdweb.com/dashboard

JavaScript 8.14% TypeScript 91.86%

thirdweb-thirdweb-cli's Introduction



Thirdweb CLI

npm version Join our Discord!

Publish and deploy smart contracts without dealing with private keys


Getting started

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:

npm i @thirdweb-dev/contracts

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. Deploying your contract

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

npx thirdweb deploy

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

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

This command will:

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

From the thirdweb dashboard, you can review and deploy your contracts.


Commands

  • thirdweb deploy - Compile & deploy contracts through your dashboard
  • thirdweb publish - Compile & publish contracts, makes them available for easy deployment later directly from your dashboard.

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
  • forge
  • truffle
  • brownie
  • solc

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

thirdweb-thirdweb-cli's People

Contributors

jnsdls avatar joaquim-verges avatar atbe avatar jakeloo avatar furqanrydhan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.