32 releases (20 stable)

5.0.3 Jan 24, 2025
5.0.2 Dec 17, 2024
5.0.1 Nov 28, 2024
4.1.3 Nov 20, 2024
2.0.0-beta.1 Dec 7, 2022

#9 in #edsl

Download history 958/week @ 2024-10-29 2971/week @ 2024-11-05 1807/week @ 2024-11-12 1717/week @ 2024-11-19 2597/week @ 2024-11-26 2314/week @ 2024-12-03 1172/week @ 2024-12-10 1237/week @ 2024-12-17 194/week @ 2024-12-24 287/week @ 2024-12-31 628/week @ 2025-01-07 540/week @ 2025-01-14 783/week @ 2025-01-21 642/week @ 2025-01-28 1126/week @ 2025-02-04 931/week @ 2025-02-11

3,580 downloads per month
Used in 22 crates (10 directly)

Apache-2.0

255KB
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–43MB
~726K SLoC