#unc #abi #cargo #build #contract #smart-contracts

bin+lib cargo-unc

Cargo extension for building Rust smart contracts on UNC

7 releases (4 breaking)

0.7.3 Apr 12, 2024
0.7.1 Apr 7, 2024
0.6.0 Apr 7, 2024
0.3.0 Apr 7, 2024
0.1.0 Mar 7, 2024

#31 in #unc

Download history 141/week @ 2024-03-03 14/week @ 2024-03-10 1/week @ 2024-03-17 13/week @ 2024-03-31 304/week @ 2024-04-07 15/week @ 2024-04-14

332 downloads per month
Used in unc-workspaces

MIT/Apache and GPL-2.0-or-later

67KB
1.5K SLoC

cargo-unc

Cargo extension for building unc-sdk-rs smart contracts and ABI schemas on UNC

Github CI Build Crates.io version Download

Release notes

Release notes and unreleased changes can be found in the CHANGELOG

Installation

Install prebuilt binaries via shell script (Linux, macOS)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/unc/cargo-unc/releases/latest/download/cargo-unc-installer.sh | sh
Install prebuilt binaries via powershell script (Windows)
irm https://github.com/unc/cargo-unc/releases/latest/download/cargo-unc-installer.ps1 | iex
Install prebuilt binaries into your Node.js application
npm install cargo-unc
Compile and install from source code (Cargo)
cargo install cargo-unc

or, install the most recent version from git repository:

$ git clone https://github.com/unc/cargo-unc
$ cargo install --path cargo-unc

Usage

See cargo unc --help for a complete list of available commands or run cargo unc to dive into interactive mode. Help is also available for each individual command with a --help flag, e.g. cargo unc build --help.

cargo unc

Starts interactive mode that will allow to explore all the available commands.

cargo unc build

Builds a UNC smart contract along with its ABI (while in the directory containing contract's Cargo.toml).

You can also make this command embed ABI into your WASM artifact by adding --embed-abi parameter. Once deployed, this will allow you to call a view function __contract_abi to retrieve a ZST-compressed ABI.

cargo unc abi

Generates UNC smart contract's ABI (while in the directory containing contract's Cargo.toml).

cargo unc create-dev-account

Guides you through creation of a new UNC account on testnet.

cargo unc deploy

Builds the smart contract (equivalent to cargo unc build) and guides you to deploy it to the blockchain.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under either of

at your option.

Dependencies

~55–78MB
~1.5M SLoC