샘플
js-sys 0.3.107: js_sys
검증된 샘플 — cargo js-sys 0.3.107: js_sys. rust 1 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: js_sys::Number exposes IEEE 754 safe integer boundaries…
sha256:6b5aad08b2543924cd7370bb81ee5fe95789de07e80bcccac727ef9bffa6659c
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux · alpine · musl x64 rust cargo
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-11-23 |
케이스
HOW- 목표
- verify js_sys in pkg:cargo/js-sys@0.3.107
- 패키지
- 심벌
-
- js_sys
- 생성일
- 2026-11-23T14:25:27Z
컨트랙트
- js_sys::Number exposes IEEE 754 safe integer boundaries (MAX_SAFE_INTEGER == 2^53 - 1, MIN_SAFE_INTEGER == -(2^53 - 1)) and float constants (EPSILON, MAX_VALUE, subnormal MIN_VALUE == 5e-324, NAN, POSITIVE_INFINITY, NEGATIVE_INFINITY)
- Number::try_from rejects integers outside the safe 53-bit range for i64, u64, i128, and u128 (including +/-2^53 boundaries and type MIN/MAX) with js_sys::TryFromIntError
- js_sys::TryFromIntError implements Copy, Clone, PartialEq, Eq, Debug, Display ('out of range integral type conversion attempted'), and std::error::Error
- js_sys::Base64Alphabet (Base64, Base64Url) and js_sys::Base64LastChunkHandling (Loose, Strict, StopBeforePartial) expose distinct variants with Copy, Clone, PartialEq, Eq, and Debug
파일
- Cargo.lock
- Cargo.toml
- PROMPT.md
- csx.json
- spec.json
- src/lib.rs
- test/contract.rs
소스
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "bumpalo"
version = "3.20.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db"
[[package]]
name = "cfg-if"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
[[package]]
name = "futures-core"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
[[package]]
name = "futures-task"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
[[package]]
name = "futures-util"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
dependencies = [
"futures-core",
"futures-task",
"pin-project-lite",
"slab",
]
[[package]]
name = "js-sys"
version = "0.3.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
dependencies = [
"cfg-if",
"futures-util",
"wasm-bindgen",
]
[[package]]
name = "pin-project-lite"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752"
[[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-js-sys"
version = "1.0.0"
dependencies = [
"js-sys",
]
[[package]]
name = "slab"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "syn"
version = "3.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
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.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"
dependencies = [
"cfg-if",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"
dependencies = [
"unicode-ident",
]
[package]
name = "sample-js-sys"
version = "1.0.0"
edition = "2021"
publish = false
[dependencies]
js-sys = "=0.3.107"
[[bin]]
name = "contract"
path = "test/contract.rs"
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 js_sys in pkg:cargo/js-sys@0.3.107
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:cargo/js-sys@0.3.107
Demonstrate these symbols/APIs:
- js_sys
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:e8b3ecd8a4ec662d4ed0553c9f809c5c32b04339a68d41d958cacf39e2ac21ce","contract":["js_sys::Number exposes IEEE 754 safe integer boundaries (MAX_SAFE_INTEGER == 2^53 - 1, MIN_SAFE_INTEGER == -(2^53 - 1)) and float constants (EPSILON, MAX_VALUE, subnormal MIN_VALUE == 5e-324, NAN, POSITIVE_INFINITY, NEGATIVE_INFINITY)","Number::try_from rejects integers outside the safe 53-bit range for i64, u64, i128, and u128 (including +/-2^53 boundaries and type MIN/MAX) with js_sys::TryFromIntError","js_sys::TryFromIntError implements Copy, Clone, PartialEq, Eq, Debug, Display ('out of range integral type conversion attempted'), and std::error::Error","js_sys::Base64Alphabet (Base64, Base64Url) and js_sys::Base64LastChunkHandling (Loose, Strict, StopBeforePartial) expose distinct variants with Copy, Clone, PartialEq, Eq, and Debug"],"goal":"verify js_sys in pkg:cargo/js-sys@0.3.107","kind":"HOW","packages":["pkg:cargo/js-sys@0.3.107"],"schemaVersion":1,"symbols":["js_sys"]},"contractCommand":["cargo","run","--offline"],"environment":{"arch":"x64","distro":"alpine","ecosystem":"cargo","language":"rust","libc":"musl","os":"linux","packageManager":"cargo","schemaVersion":1},"license":"MIT-0","packages":["pkg:cargo/js-sys@0.3.107"],"schemaVersion":1,"subject":"pkg:cargo/js-sys@0.3.107","symbols":["js_sys"],"verifierAdapter":"cargo@1"}
{
"schemaVersion": 1,
"goal": "verify js_sys in pkg:cargo/js-sys@0.3.107",
"kind": "HOW",
"packages": [
"pkg:cargo/js-sys@0.3.107"
],
"symbols": [
"js_sys"
]
}
//! Minimal clean-room sample verifying `js_sys` crate APIs in `js-sys@0.3.107`.
pub use js_sys;
use core::convert::TryFrom;
use js_sys::{Base64Alphabet, Base64LastChunkHandling, Number, TryFromIntError};
fn main() {
// 1. IEEE 754 safe integer boundaries and float constants on js_sys::Number
let max_safe = ((1u64 << 53) - 1) as f64;
assert_eq!(Number::MAX_SAFE_INTEGER, 9_007_199_254_740_991.0);
assert_eq!(Number::MAX_SAFE_INTEGER, max_safe);
assert_eq!(Number::MIN_SAFE_INTEGER, -9_007_199_254_740_991.0);
assert_eq!(Number::MIN_SAFE_INTEGER, -max_safe);
assert_eq!(Number::EPSILON, f64::EPSILON);
assert_eq!(Number::MAX_VALUE, f64::MAX);
assert_eq!(Number::MIN_VALUE, 5e-324);
assert!(Number::MIN_VALUE.is_subnormal());
assert!(Number::MIN_VALUE > 0.0 && Number::MIN_VALUE < f64::MIN_POSITIVE);
assert!(Number::NAN.is_nan());
assert_eq!(Number::POSITIVE_INFINITY, f64::INFINITY);
assert_eq!(Number::NEGATIVE_INFINITY, f64::NEG_INFINITY);
// 2. Number::try_from rejects integers outside the safe 53-bit range
let boundary_pos_i64: i64 = 1i64 << 53;
let boundary_neg_i64: i64 = -(1i64 << 53);
let boundary_pos_u64: u64 = 1u64 << 53;
let boundary_pos_i128: i128 = 1i128 << 53;
let boundary_neg_i128: i128 = -(1i128 << 53);
let boundary_pos_u128: u128 = 1u128 << 53;
let err_i64_boundary: TryFromIntError = Number::try_from(boundary_pos_i64).unwrap_err();
assert!(Number::try_from(boundary_neg_i64).is_err());
assert!(Number::try_from(i64::MAX).is_err());
assert!(Number::try_from(i64::MIN).is_err());
assert!(Number::try_from(boundary_pos_u64).is_err());
assert!(Number::try_from(u64::MAX).is_err());
assert!(Number::try_from(boundary_pos_i128).is_err());
assert!(Number::try_from(boundary_neg_i128).is_err());
assert!(Number::try_from(i128::MAX).is_err());
assert!(Number::try_from(i128::MIN).is_err());
assert!(Number::try_from(boundary_pos_u128).is_err());
assert!(Number::try_from(u128::MAX).is_err());
// 3. TryFromIntError trait implementations
let err_copied = err_i64_boundary;
let err_cloned = err_i64_boundary.clone();
assert_eq!(err_i64_boundary, err_copied);
assert_eq!(err_i64_boundary, err_cloned);
assert_eq!(
err_i64_boundary.to_string(),
"out of range integral type conversion attempted"
);
assert_eq!(format!("{err_i64_boundary:?}"), "TryFromIntError(())");
let dyn_err: &dyn std::error::Error = &err_i64_boundary;
assert_eq!(
dyn_err.to_string(),
"out of range integral type conversion attempted"
);
assert!(dyn_err.source().is_none());
// 4. Base64Alphabet and Base64LastChunkHandling option enums
let std_alphabet = Base64Alphabet::Base64;
let url_alphabet = Base64Alphabet::Base64Url;
assert_eq!(std_alphabet, std_alphabet.clone());
assert_ne!(std_alphabet, url_alphabet);
assert_eq!(format!("{std_alphabet:?}"), "Base64");
assert_eq!(format!("{url_alphabet:?}"), "Base64Url");
let modes = [
Base64LastChunkHandling::Loose,
Base64LastChunkHandling::Strict,
Base64LastChunkHandling::StopBeforePartial,
];
assert_ne!(modes[0], modes[1]);
assert_ne!(modes[1], modes[2]);
assert_ne!(modes[0], modes[2]);
assert_eq!(format!("{:?}", modes[0]), "Loose");
assert_eq!(format!("{:?}", modes[1]), "Strict");
assert_eq!(format!("{:?}", modes[2]), "StopBeforePartial");
println!("js-sys 0.3.107 contract passed");
}
오리진 시더
익명