Skip to content

[GF-11] [BACKEND] Deployment Scripts + Testnet Deployment #56

Description

@wumibals

Overview

⚠️ Depends on: #40 (GF-07 — VaultRouter: Full Implementation) — all 8 contracts must be complete before deployment scripts can be written or executed.

Write Soroban CLI deployment scripts for all 8 YieldLadder contracts and execute the testnet deployment so that deployments/testnet.json contains real addresses.

Problem

Both deployment files contain placeholder values:

  • deployments/testnet.json: all addresses are "CC_PENDING_TESTNET", deployedAt is "pending"
  • deployments/mainnet.json: all addresses are empty strings, deployedAt is null

No deployment scripts exist anywhere in the repo. The .env.example defines all required env vars (VAULT_ROUTER_ADDRESS, etc.) but there is no automated way to populate them.

Without deployed testnet addresses, the SDK (GF-08 / #41) and the data service layer (GF-12 / #44) cannot be wired to real contracts.

Proposed Solution

1. Create scripts/deploy.sh
A bash script that deploys all 8 contracts in dependency order using the Soroban CLI:

shared → vault_flex → vault_l3 → vault_l6 → vault_l12 → strategy_vault → harvester → governance → vault_router

For each contract, deploy with the Stellar CLI and capture the contract ID:

CONTRACT_ID=$(stellar contract deploy \
  --wasm target/wasm32-unknown-unknown/release/CONTRACT_NAME.wasm \
  --source DEPLOYER_KEY \
  --network $NETWORK)
echo "CONTRACT_NAME: $CONTRACT_ID"

After deploying, call the initialize function on each contract passing the correct addresses (e.g. VaultRouter needs the addresses of all tier vaults).

2. Create scripts/populate-env.sh
After deployment, write the contract addresses to a .env file in the correct format, populating all vars from .env.example.

3. Update deployments/testnet.json
After running the testnet deployment, update this file with real contract addresses and the deployment timestamp.

4. Add stellar.toml
Create a stellar.toml in the project root documenting the deployed contracts for Stellar ecosystem tooling.

5. Document the deployment process in CONTRIBUTING.md
Add a section explaining how to run scripts/deploy.sh locally against testnet.

Acceptance Criteria

  • scripts/deploy.sh deploys all 8 contracts to Stellar testnet in the correct dependency order
  • Each contract's initialize function is called automatically by the script with the correct addresses
  • deployments/testnet.json is updated with real contract addresses and a deployedAt timestamp
  • .env.example vars are all populated by scripts/populate-env.sh
  • stellar.toml created with contract addresses and network information
  • Deployment process documented in CONTRIBUTING.md
  • All 8 contracts respond to a basic read call (e.g. VaultRouter.position) after deployment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions