Skip to content

paritytech/cargo-pvm-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cargo-pvm-contract

A cargo subcommand to build Rust contracts to PolkaVM bytecode.

This tool scaffolds Rust contract projects from Solidity interface files (.sol). It automates:

  • Function selector generation
  • Input/output encoding and decoding (ABI)

This tool is designed for building smart contracts in Rust using the low-level API provided by pallet-revive-uapi. For a more high-level, user-friendly API, see Ink!.

Contract Generation

Contracts can be generated using two approaches:

  • High-level API: Uses the sol! macro with automatic struct generation for type-safe contract development
  • Low-level API: Provides more manual control over the contract implementation

To learn more, visit the Rust Contract Template.

Installation

cargo install --force --locked cargo-pvm-contract

Usage

Once installed, you can use it as a cargo subcommand:

cargo pvm-contract

This launches an interactive prompt to initialize a new contract project. Just build the generated project with cargo build. The PolkaVM bytecode will be written to target/<bin>.<profile>.polkavm.

About

Build commands for Rust PVM contracts

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •