[package] name = "mpc-contract" version = { workspace = true } license = { workspace = true } edition = { workspace = true } repository = "https://github.com/near/mpc" # Reproducible builds are produced by two coexisting paths # (see `docs/reproducible-builds.md`): # 1. The Nix derivation at `nix/mpc-contract.nix` (exposed as # `packages..mpc-contract` in `flake.nix`). # 2. cargo-near, driven by the NEP-330 metadata below. The pinned # `sourcescan/cargo-near` image lets third-party verifiers # (sourcescan.io, nearblocks) replay and verify the on-chain WASM. # fields to configure build with WASM reproducibility, according to specs # in https://github.com/near/NEPs/blob/master/neps/nep-0330.md [package.metadata.near.reproducible_build] # docker image, descriptor of build environment; pinned to match # `rust-toolchain.toml` (1.93.0) image = "sourcescan/cargo-near:0.21.1-rust-1.93.0" # tag after colon above serves only descriptive purpose; image is identified by digest image_digest = "sha256:79b789c81ba19ec30794a6b1046b02dcaf5c055994b22cc7c9af67ab5096b095" # list of environment variables names, whose values, if set, will be used as external build parameters # in a reproducible manner # supported by `sourcescan/cargo-near:0.10.1-rust-1.82.0` image or later images passed_env = [] # build command inside of docker container # if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags, # the command may be any combination of flags of `cargo-near`, # supported by respective version of binary inside the container besides `--no-locked` flag container_build_command = [ "cargo", "near", "build", # this is counter intuitive, but it correctly follows the docs, # the non-reproducible build inside a reproducible environment becomes reproducible "non-reproducible-wasm", "--locked", "--profile=release-contract", "--features", "abi", ] [lib] crate-type = ["cdylib", "lib"] [features] test-utils = [ "rand", "threshold-signatures", "near-mpc-contract-interface/blstrs", "near-sdk/unit-testing", ] # WASM-compatible benchmark endpoints for sandbox gas testing bench-contract-methods = [] # Sandbox-only view methods that expose internal contract state for tests that need to # assert invariants that aren't visible through the production API surface (e.g. the # length of a fan-out queue). Distinct from `bench-contract-methods` because these are # behavioral hooks, not gas-measurement hooks. sandbox-test-methods = [] dev-utils = ["rand", "threshold-signatures", "near-mpc-contract-interface/blstrs"] abi = [ "borsh/unstable__schema", "near-mpc-contract-interface/abi", "mpc-attestation/abi", "mpc-primitives/abi", "schemars", ] # This is used when running `cargo clippy --all-features`, because otherwise `abi` feat will break compilation. # But we can't put it under `abi` feat either, because it should appear only when building schema. In other words, # if it appears under wasm32 target, it will break compilation too. __abi-generate = ["abi", "near-sdk/__abi-generate"] [dependencies] assert_matches = { workspace = true } blstrs = { workspace = true } borsh = { workspace = true } curve25519-dalek = { workspace = true } derive_more = { workspace = true, features = ["from", "deref"] } elliptic-curve = { workspace = true } hex = { workspace = true, features = [] } k256 = { workspace = true, features = [ "sha256", "ecdsa", "serde", "arithmetic", "expose-field", ] } mpc-attestation = { workspace = true, features = ["local-verify"] } mpc-primitives = { workspace = true } near-account-id = { workspace = true, features = ["serde"] } near-mpc-bounded-collections = { workspace = true } near-mpc-contract-interface = { workspace = true, features = [ "ed25519-dalek", "k256", "near", ] } near-mpc-signature-verifier = { workspace = true } near-sdk = { workspace = true } rand = { workspace = true, optional = true } serde = { workspace = true } serde_json = { workspace = true } serde_with = { workspace = true } thiserror = { workspace = true } threshold-signatures = { workspace = true, optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] near-account-id = { workspace = true, features = [ "serde", "schemars-v0_8", "abi", ] } schemars = { workspace = true, optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] getrandom = { workspace = true, features = ["custom"] } [dev-dependencies] anyhow = { workspace = true } cargo-near-build = { workspace = true } contract-history = { workspace = true } digest = { workspace = true } ecdsa = { workspace = true } futures = { workspace = true } insta = { workspace = true } mpc-contract = { workspace = true, features = [ "sandbox-test-methods", "test-utils", ] } near-abi = { workspace = true } near-mpc-sdk = { workspace = true } near-workspaces = { workspace = true } rand = { workspace = true } rand_core = { workspace = true } rstest = { workspace = true } sha2 = { workspace = true } signature = { workspace = true } test-utils = { workspace = true } threshold-signatures = { workspace = true } tokio = { workspace = true } tokio-util = { workspace = true } zstd = { workspace = true } [lints] workspace = true