diff --git a/CHANGELOG.md b/CHANGELOG.md index 87f32293..beb58c3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Infrastructure +- Added a `Makefile` with a `build-docker` target utilizing the `stellar/rs-soroban-sdk` image to guarantee WASM binary reproducibility, allowing anyone to verify that the deployed on-chain bytecode matches the source (#533). - Resolved pre-existing CI debt surfaced by the `fmt` and `clippy` gates added in #403: test fixture missing bindings restored in `src/test.rs` and `src/tests/test_init.rs`, `result` double-move fixed in `src/tests/test_admin.rs`, `cargo fmt --all` drift cleared across `src/issues_test.rs` and `src/lib.rs`, and clippy lints addressed (`manual_div_ceil` in `src/lib.rs`; `dead_code` suppressed on deferred storage helpers pending the DataKey audit in #409). All three CI jobs (`test`, `fmt`, `clippy`) now exit 0 on a clean checkout (#418). ### Refactored diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a3772c82..d8ed6ea5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,8 +43,11 @@ git remote add upstream https://github.com/Iris-IV/ProofOfHeart-stellar.git > **Heads up:** The first `cargo build` downloads and compiles all Rust dependencies. This can take **10–20 minutes** and use **1–2 GB** of disk space. Subsequent builds are much faster. ```bash -# Build WASM -cargo build --target wasm32-unknown-unknown --release +# Build WASM (Local development) +stellar contract build + +# Build reproducible WASM (Required for production deployment) +make build-docker # Run tests cargo test --features testutils @@ -60,7 +63,7 @@ CI runs these checks on every PR. Run locally before pushing: cargo fmt --check cargo clippy --all-targets --features testutils -- -D warnings cargo test --features testutils -cargo build --target wasm32-unknown-unknown --release +stellar contract build ``` All four must pass. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..26f1887a --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +default: build + +all: test + +build: + stellar contract build + +build-docker: + docker run --rm -v $(PWD):/workspace -w /workspace stellar/rs-soroban-sdk:20.1.0 stellar contract build + +test: + cargo test --features testutils + +fmt: + cargo fmt --all + +clean: + cargo clean diff --git a/README.md b/README.md index a1f14c2b..03fc7bdf 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,11 @@ This repository contains the **Soroban smart contract** that powers the on-chain git clone https://github.com/Iris-IV/ProofOfHeart-stellar.git cd ProofOfHeart-stellar -# Build the contract -cargo build --target wasm32-unknown-unknown --release +# Build the contract for local development +stellar contract build + +# Build a deterministic, reproducible WASM binary for deployment/verification +make build-docker ``` ### Test