31 releases (19 stable)

new 5.0.2 Dec 17, 2024
5.0.1 Nov 28, 2024
5.0.0-alpha Sep 9, 2024
4.1.3 Nov 20, 2024
2.0.0-beta.1 Dec 7, 2022

#4 in #edsl

Download history 648/week @ 2024-08-26 597/week @ 2024-09-02 952/week @ 2024-09-09 708/week @ 2024-09-16 602/week @ 2024-09-23 637/week @ 2024-09-30 310/week @ 2024-10-07 614/week @ 2024-10-14 465/week @ 2024-10-21 758/week @ 2024-10-28 3148/week @ 2024-11-04 1743/week @ 2024-11-11 1823/week @ 2024-11-18 2347/week @ 2024-11-25 2275/week @ 2024-12-02 1292/week @ 2024-12-09

7,749 downloads per month
Used in 20 crates (9 directly)

Apache-2.0

250KB
5.5K SLoC

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);

Dependencies

~28–42MB
~704K SLoC