This document defines the requirements, constraints, and step-by-step procedures for building and deploying the YieldVault-RWA smart contracts to the Stellar network.
To ensure reproducible builds and prevent contract size optimization issues or unexpected runtime anomalies (e.g., protocol version mismatches, transaction resource exhaustion, or deserialization failures), the toolchain versions are strictly pinned:
| Component | Target Version | Check Command |
|---|---|---|
| Stellar CLI | v23.0.1 |
stellar --version (or soroban --version) |
| Rust Toolchain | 1.79.0 |
rustc --version |
| WASM Target | wasm32-unknown-unknown |
rustup target list | grep installed |
- Verify Tool Versions: Run the deployment script or verify manually that your environment matches the target versions listed above.
- Build Contracts: Compile the contracts using the correct target:
cargo build --target wasm32-unknown-unknown --release
- Optimize WASM: Optimize the compiled contract to reduce gas costs and meet size limitations:
soroban contract optimize --wasm target/wasm32-unknown-unknown/release/vault.wasm
- Funding: Ensure the deployer account has sufficient XLM to cover deployment fees.
Run the deploy script or execute the commands manually:
# This returns the CONTRACT_ID
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/vault.optimized.wasm \
--source deployer \
--network testnetInvoke the initialize function on the newly deployed contract:
soroban contract invoke \
--id <CONTRACT_ID> \
--source deployer \
--network testnet \
-- \
initialize \
--admin <ADMIN_ADDRESS> \
--token <TOKEN_ADDRESS>To upgrade the contract code:
- Build and Optimize the new WASM as described in the checklist.
- Install the new WASM on the network to obtain its hash:
soroban contract install --wasm <NEW_WASM> --network testnet
- Pause the Vault (Critical Safety Check):
soroban contract invoke --id <CONTRACT_ID> --source admin --network testnet -- set_pause --paused true
- Execute Upgrade:
soroban contract invoke --id <CONTRACT_ID> --source admin --network testnet -- upgrade --new_wasm_hash <WASM_HASH>
- Verify Version:
soroban contract invoke --id <CONTRACT_ID> --network testnet -- version
- Resume Operations:
soroban contract invoke --id <CONTRACT_ID> --source admin --network testnet -- set_pause --paused false