33 releases (20 stable)

6.0.0-alpha May 2, 2025
5.0.3 Jan 24, 2025
5.0.2 Dec 17, 2024
5.0.1 Nov 28, 2024
2.0.0-beta.1 Dec 7, 2022

#9 in #polka-vm

Download history 1498/week @ 2025-03-05 1627/week @ 2025-03-12 984/week @ 2025-03-19 1816/week @ 2025-03-26 998/week @ 2025-04-02 757/week @ 2025-04-09 529/week @ 2025-04-16 1824/week @ 2025-04-23 1569/week @ 2025-04-30 930/week @ 2025-05-07 1472/week @ 2025-05-14 188/week @ 2025-05-21 490/week @ 2025-05-28 498/week @ 2025-06-04 285/week @ 2025-06-11 494/week @ 2025-06-18

1,806 downloads per month
Used in 22 crates (10 directly)

Apache-2.0 and GPL-3.0-only

270KB
6K SLoC

contract-build

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

Usage

use contract_build::{
    ManifestPath,
    Verbosity,
    BuildArtifacts,
    BuildMode,
    Features,
    MetadataSpec,
    Network,
    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(),
    keep_debug_symbols: false,
    extra_lints: false,
    output_type: OutputType::Json,
    image: ImageVariant::Default,
    metadata_spec: MetadataSpec::Ink,
};

contract_build::execute(args);

Dependencies

~89MB
~1.5M SLoC