From 435e3269252029eccab9034e30633ed540470a78 Mon Sep 17 00:00:00 2001 From: devprom6 Date: Mon, 13 Jul 2026 14:32:12 +0100 Subject: [PATCH] fix(ci): align wasm target to wasm32v1-none across deploy, docs, and CI Fixes #6. Deploy scripts and README/CONTRIBUTING docs referenced the legacy wasm32-unknown-unknown target while CI and Makefile already used wasm32v1-none. Aligns all files to wasm32v1-none and adds a contributor note explaining the difference between the two targets. --- CONTRIBUTING.md | 10 ++++++++-- README.md | 10 +++++----- scripts/deploy.sh | 4 ++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1529cb..2e1f80f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,13 @@ To build and test the smart contracts, you will need: - [Rust](https://www.rust-lang.org/tools/install) (latest stable version, at least 1.75+) - [Soroban CLI](https://soroban.stellar.org/docs/getting-started/setup#install-the-soroban-cli) -- `wasm32-unknown-unknown` target: `rustup target add wasm32-unknown-unknown` +- `wasm32v1-none` target: `rustup target add wasm32v1-none` + +> **Note:** This project uses `wasm32v1-none` (not the legacy `wasm32-unknown-unknown`). +> The `wasm32v1-none` target is required by Soroban SDK v20+ and produces smaller WASM +> binaries with lower deployment costs. If you are using an older Soroban CLI (< v20), +> you will need `wasm32-unknown-unknown` instead. CI and local builds must use the same +> target for artifact compatibility. ## How Can I Contribute? @@ -55,7 +61,7 @@ Enhancement suggestions are welcome! Please open an issue using the Feature Requ Build all contracts to WASM: ```bash -cargo build --target wasm32-unknown-unknown --release +cargo build --target wasm32v1-none --release ``` ### Testing diff --git a/README.md b/README.md index 9cc5cd6..1f298b6 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Get up and running in minutes: 1. **Install Prerequisites**: ```bash - rustup target add wasm32-unknown-unknown + rustup target add wasm32v1-none cargo install --locked soroban-cli ``` 2. **Clone & Build**: @@ -146,7 +146,7 @@ ecotask-contracts/ cargo install --locked soroban-cli # Add the WebAssembly target -rustup target add wasm32-unknown-unknown +rustup target add wasm32v1-none ``` ### Build @@ -157,11 +157,11 @@ git clone https://github.com/ecotask-network/ecotask-contracts.git cd ecotask-contracts # Build all contracts -cargo build --target wasm32-unknown-unknown --release +cargo build --target wasm32v1-none --release # Build a specific contract cd contracts/eco-token -cargo build --target wasm32-unknown-unknown --release +cargo build --target wasm32v1-none --release ``` ### Test @@ -186,7 +186,7 @@ soroban network add testnet \ # Deploy the ECO token contract soroban contract deploy \ - --wasm target/wasm32-unknown-unknown/release/eco_token.wasm \ + --wasm target/wasm32v1-none/release/eco_token.wasm \ --network testnet \ --source YOUR_SECRET_KEY diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 1a05d48..2dc84cd 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -3,11 +3,11 @@ set -euo pipefail CONTRACT_NAME="${1:?Usage: deploy.sh }" NETWORK="${2:-testnet}" -WASM="target/wasm32-unknown-unknown/release/${CONTRACT_NAME//-/_}.wasm" +WASM="target/wasm32v1-none/release/${CONTRACT_NAME//-/_}.wasm" if [ ! -f "$WASM" ]; then echo "Error: WASM file not found at $WASM" - echo "Build first: cargo build --target wasm32-unknown-unknown --release -p $CONTRACT_NAME" + echo "Build first: cargo build --target wasm32v1-none --release -p $CONTRACT_NAME" exit 1 fi