Sample
wasm-bindgen 0.2.128: wasm_bindgen::prelude::wasm_bindgen
Verified sample for cargo wasm-bindgen 0.2.128: wasm_bindgen::prelude::wasm_bindgen. The contract ran on rust 1 · linux alpine/x64 · docker and passed.
sha256:26bb4766dc96c4a29f45b2b9c428073528d20f50abcb812710c3f72c98a649ed
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux x64 rust cargo
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| rust 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · cargo@1rust:1-alpine@sha256:a10e64dd139b… |
2026-10-17 |
Case
HOW- Goal
- verify wasm_bindgen::prelude::wasm_bindgen in pkg:cargo/wasm-bindgen@0.2.128
- Packages
- Symbols
-
- wasm_bindgen::prelude::wasm_bindgen
- Created
- 2026-10-17T11:32:39Z
Contract
- #[wasm_bindgen] exports Rust C-like enums, structs, constructors, methods, getters, setters, and standalone functions that compile and execute on host targets when they do not call imported JS functions
- Accumulator::new(5) initializes total to 5 and status to Status::Idle
- Accumulator::apply(12) updates total to 17, transitions status to Status::Active, and returns 17
- Accumulator::set_total(30) and set_status(Status::Done) update the struct fields read back via getter methods total() and status()
- scale_value(30, 3) exported with #[wasm_bindgen] returns 90
Files
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/main.rs
Source
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "bumpalo"
version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
[[package]]
name = "cfg-if"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
[[package]]
name = "once_cell"
version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustversion"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "sample-wasm-bindgen-prelude"
version = "0.1.0"
dependencies = [
"wasm-bindgen",
]
[[package]]
name = "syn"
version = "3.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
[[package]]
name = "wasm-bindgen"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.128"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e"
dependencies = [
"unicode-ident",
]
[package]
name = "sample-wasm-bindgen-prelude"
version = "0.1.0"
edition = "2021"
[dependencies]
wasm-bindgen = "=0.2.128"
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify wasm_bindgen::prelude::wasm_bindgen in pkg:cargo/wasm-bindgen@0.2.128
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/wasm-bindgen@0.2.128
Demonstrate these symbols/APIs:
- wasm_bindgen::prelude::wasm_bindgen
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:33086cc3f3c198340ac205f588851526f1d43d683fc65d6ecce042d83d3eed5d","contract":["#[wasm_bindgen] exports Rust C-like enums, structs, constructors, methods, getters, setters, and standalone functions that compile and execute on host targets when they do not call imported JS functions","Accumulator::new(5) initializes total to 5 and status to Status::Idle","Accumulator::apply(12) updates total to 17, transitions status to Status::Active, and returns 17","Accumulator::set_total(30) and set_status(Status::Done) update the struct fields read back via getter methods total() and status()","scale_value(30, 3) exported with #[wasm_bindgen] returns 90"],"goal":"verify wasm_bindgen::prelude::wasm_bindgen in pkg:cargo/wasm-bindgen@0.2.128","kind":"HOW","packages":["pkg:cargo/wasm-bindgen@0.2.128"],"schemaVersion":1,"symbols":["wasm_bindgen::prelude::wasm_bindgen"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","ecosystem":"cargo","language":"rust","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/wasm-bindgen@0.2.128"],"schemaVersion":1,"subject":"pkg:cargo/wasm-bindgen@0.2.128","symbols":["wasm_bindgen::prelude::wasm_bindgen"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify wasm_bindgen::prelude::wasm_bindgen in pkg:cargo/wasm-bindgen@0.2.128",
"kind": "HOW",
"packages": [
"pkg:cargo/wasm-bindgen@0.2.128"
],
"symbols": [
"wasm_bindgen::prelude::wasm_bindgen"
]
}
use wasm_bindgen::prelude::wasm_bindgen;
#[wasm_bindgen]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Status {
Idle = 0,
Active = 1,
Done = 2,
}
#[wasm_bindgen]
pub struct Accumulator {
total: i32,
status: Status,
}
#[wasm_bindgen]
impl Accumulator {
#[wasm_bindgen(constructor)]
pub fn new(initial: i32) -> Accumulator {
Accumulator {
total: initial,
status: Status::Idle,
}
}
pub fn apply(&mut self, delta: i32) -> i32 {
self.total += delta;
self.status = Status::Active;
self.total
}
#[wasm_bindgen(getter)]
pub fn total(&self) -> i32 {
self.total
}
#[wasm_bindgen(setter)]
pub fn set_total(&mut self, total: i32) {
self.total = total;
}
#[wasm_bindgen(getter)]
pub fn status(&self) -> Status {
self.status
}
#[wasm_bindgen(setter)]
pub fn set_status(&mut self, status: Status) {
self.status = status;
}
}
#[wasm_bindgen]
pub fn scale_value(value: i32, factor: i32) -> i32 {
value * factor
}
fn main() {
let mut acc = Accumulator::new(5);
assert_eq!(acc.total(), 5);
assert_eq!(acc.status(), Status::Idle);
assert_eq!(acc.apply(12), 17);
assert_eq!(acc.total(), 17);
assert_eq!(acc.status(), Status::Active);
acc.set_total(30);
acc.set_status(Status::Done);
assert_eq!(acc.total(), 30);
assert_eq!(acc.status(), Status::Done);
assert_eq!(scale_value(acc.total(), 3), 90);
}
Origin Seeder
anonymous