Crates.io | contract-build |
lib.rs | contract-build |
version | 5.0.1 |
source | src |
created_at | 2022-12-01 13:26:03.747891 |
updated_at | 2024-11-28 13:23:11.73696 |
description | Library for building ink! smart contracts |
homepage | https://www.substrate.io/ |
repository | https://github.com/use-ink/cargo-contract |
max_upload_size | |
id | 727622 |
size | 247,029 |
A crate for building ink!
smart contracts. Used by
cargo-contract
.
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);