Helper scripts for local development and CI of the Creditra Soroban contracts. None of the files here are compiled into the contract WASM — they are operator-facing utilities only.
| Script | Purpose |
|---|---|
build_wasm.sh |
Compile both workspace contracts to target/wasm32-unknown-unknown/release/*.wasm. Asserts the reproducible-build policy (pinned toolchain + --verify-active) and builds --locked. |
check-wasm-size.sh |
Build (optional) and fail when any release WASM exceeds 100 KiB (THRESHOLD_BYTES=102400). |
test_check_wasm_size.sh |
Focused guard tests for check-wasm-size.sh (synthetic artifacts, no build). |
check-toolchain.sh |
Enforce the reproducible-build policy: exact toolchain pin in rust-toolchain.toml, required targets/components, CI workflow consumes the pin, lock files committed. --verify-active additionally fails when the active rustc does not match the pin. |
test_check_toolchain.sh |
Focused guard tests for check-toolchain.sh (synthetic fixtures, no toolchain install). |
clean_profraw.sh |
Remove stray *.profraw coverage files left over by cargo llvm-cov. |
check_workspace.sh |
Convenience wrapper around cargo check --workspace --locked. |
list_contract_errors.py |
Print every ContractError variant declared in contracts/credit/src/types.rs with its discriminant. |
gas-regression.sh |
Run per-entrypoint budget regression tests (or regenerate baselines with --regen). |
regen_budget_baseline.sh |
Regenerate contracts/credit/test_snapshots/budget.json via the budget_baseline example. |
- Shell scripts target
bashand useset -euo pipefail. - Python scripts target Python 3.9+ and have no third-party deps.
- Scripts must be runnable from any working directory; they cd to the repo root themselves.
Builds must be byte-for-byte repeatable across machines and over time.
Three invariants keep them that way, all enforced by check-toolchain.sh
and CI:
- Pinned compiler.
rust-toolchain.tomlpinschannelto an exactX.Y.Zversion. Floating channels (stable,beta,nightly) are rejected — they resolve to different compilers on different days. - Pinned dependencies. Every build uses
--lockedagainst committedCargo.lockfiles, so dependency resolution cannot drift. - One source of truth. CI derives its toolchain from
rust-toolchain.toml(never a floating action ref), and--verify-activefails when the activerustcdoes not match the pin (stray overrides,RUSTUP_TOOLCHAIN, rustup-less environments).
To upgrade the toolchain, bump channel deliberately and re-run the WASM
size baselines in the same commit.