This repository contains Healthy Stellar contracts and deployment tooling for both Testnet and Mainnet.
testnet— development and pre-production validation.mainnet— production deployment.
-
Install the Stellar CLI and make sure it is on your
PATH. -
Confirm
cargo testpasses for all contracts in the workspace:cargo test --workspace -
Build all contracts for the Stellar WASM target:
cargo build --target wasm32v1-none --release --workspace
-
Verify the
stellarCLI can connect to the target network and that your deployment identity is configured.
For Mainnet, never use a plain secret key in CI or automation.
- Prefer a hardware wallet or multi-sig Stellar account for admin operations.
- Use
STELLAR_IDENTITYor the Stellar CLI local identity configuration to reference the signer. - Protect any private signing keys and avoid embedding them in repository or pipeline secrets.
The repository deploys contracts in dependency order, but Mainnet must deploy governance contracts first:
multisig-governanceupgrade-governance- All other contracts
The governance contracts must be deployed before any other contract is used in production.
The repository includes scripts/deploy_all.sh for network-aware deployment and manifest generation.
-
To deploy to Testnet:
./scripts/deploy_all.sh --network testnet
-
To deploy to Mainnet:
./scripts/deploy_all.sh --network mainnet
-
To dry-run and validate the plan without submitting transactions:
./scripts/deploy_all.sh --network mainnet --dry-run
-
To skip rebuilding if WASM artifacts already exist:
./scripts/deploy_all.sh --network mainnet --skip-build
- The script writes deployed contract IDs to
deployments/<network>.json. - For Mainnet, record every deployed contract ID in
deployments/mainnet.jsonbefore any production interaction. - Do not proceed with administrative or application transactions until the manifest is complete and verified.
cargo test --workspacepasses.cargo build --target wasm32v1-none --release --workspacecompletes with no warnings or errors.- Admin identity is a hardware wallet or multi-sig account.
- Contracts
upgrade-governanceandmultisig-governanceare deployed first. deployments/mainnet.jsoncontains all contract IDs before any interaction.- After each contract deploy, verify the on-chain WASM hash matches the local build hash using Horizon or Stellar Expert.
- Run a post-deployment smoke test against Mainnet before announcing availability.
- Confirm deployed contract IDs are accurate in
deployments/mainnet.json. - Use Stellar Explorer / Horizon to compare the contract WASM hash with the local artifact.
- Run a simple transaction against each deployed contract to ensure the contract is callable.
- Invoke a no-op or read-only query on each deployed contract.
- Confirm governance contracts can be invoked by the configured admin identity.
- Check that shared and registry contracts return expected state values.
This section describes the upgrade lifecycle for an already-deployed contract using upgrade-governance.
Build the updated contract locally and calculate the WASM hash.
cargo build --target wasm32v1-none --release -p <contract-package>
NEW_HASH=$(sha256sum target/wasm32v1-none/release/<contract_name>.wasm | awk '{print $1}')Submit an upgrade proposal to the deployed upgrade-governance contract.
stellar contract invoke --id "$UPGRADE_GOVERNANCE_ID" -- propose_upgrade \
--new_wasm_hash "$NEW_HASH" \
--target_contract "$TARGET_ID"Each governance signer must vote for the proposal.
stellar contract invoke --id "$UPGRADE_GOVERNANCE_ID" -- vote --proposal_id "$PID"After the required votes are collected, execute the upgrade:
stellar contract invoke --id "$UPGRADE_GOVERNANCE_ID" -- execute_upgrade --proposal_id "$PID"- Confirm the target contract is now updated by checking its WASM hash on-chain.
- Run a smoke test against the upgraded contract.
- Update deployment records if needed.
- Build the new contract and compute
NEW_HASH. - Propose the upgrade with
propose_upgrade. - Collect votes from each authorized governance signer using
vote. - Execute the upgrade once quorum is reached.
- Verify the on-chain contract hash matches the new build and run a post-upgrade test.
- Use Testnet for development, validation, and smoke-testing changes before Mainnet.
- Testnet deployments can be performed with the same script and manifest pattern.
- Use a production-grade signer (hardware wallet or multi-sig).
- Verify every contract deployment with on-chain tooling.
- Maintain
deployments/mainnet.jsonas the authoritative source of deployed contract IDs. - Run Mainnet smoke tests before marking the deployment as available.
- Before your first Mainnet deployment, complete the production readiness checklist in MAINNET_READINESS.md and obtain sign-offs from lead developer, security lead, and legal counsel.