contract-build

Crates.iocontract-build
lib.rscontract-build
version5.0.1
sourcesrc
created_at2022-12-01 13:26:03.747891
updated_at2024-11-28 13:23:11.73696
descriptionLibrary for building ink! smart contracts
homepagehttps://www.substrate.io/
repositoryhttps://github.com/use-ink/cargo-contract
max_upload_size
id727622
size247,029
ink! Developers (github:use-ink:ink-developers)

documentation

https://docs.rs/contract-build

README

contract-build

A crate for building ink! smart contracts. Used by cargo-contract.

Usage

use contract_build::{
    ManifestPath,
    Verbosity,
    BuildArtifacts,
    BuildMode,
    Features,
    Network,
    OptimizationPasses,
    OutputType,
    UnstableFlags,
    Target,
    ImageVariant,
};

let manifest_path = ManifestPath::new("my-contract/Cargo.toml").unwrap();

let args = contract_build::ExecuteArgs {
    manifest_path,
    verbosity: Verbosity::Default,
    build_mode: BuildMode::Release,
    features: Features::default(),
    network: Network::Online,
    build_artifact: BuildArtifacts::All,
    unstable_flags: UnstableFlags::default(),
    optimization_passes: Some(OptimizationPasses::default()),
    keep_debug_symbols: false,
    extra_lints: false,
    output_type: OutputType::Json,
    skip_wasm_validation: false,
    target: Target::Wasm,
    max_memory_pages: 16,
    image: ImageVariant::Default,
};

contract_build::execute(args);
Commit count: 1329

cargo fmt