Overview
There are no deployment scripts, configuration files, or documentation for deploying the contracts to Stellar testnet or mainnet. Developers must reconstruct the deployment sequence from the Stellar CLI docs and source code, which is error-prone and inconsistent across team members.
Required Deliverables
1. scripts/deploy.sh
A shell script that:
- Installs WASM for
farming-pool via stellar contract install
- Deploys the
factory contract via stellar contract deploy
- Calls
factory.initialize(admin, pool_wasm_hash)
- Saves deployed contract IDs to
.contract-ids.json
#!/usr/bin/env bash
set -euo pipefail
NETWORK=${NETWORK:-testnet}
ADMIN=${ADMIN:-$(stellar keys address default)}
echo "Installing farming-pool WASM..."
POOL_HASH=$(stellar contract install --wasm target/wasm32-unknown-unknown/release/farming_pool.wasm --network $NETWORK --source default)
echo "Deploying factory..."
FACTORY_ID=$(stellar contract deploy --wasm target/wasm32-unknown-unknown/release/factory.wasm --network $NETWORK --source default)
echo "Initializing factory..."
stellar contract invoke --id $FACTORY_ID --network $NETWORK --source default -- initialize --admin $ADMIN --pool_wasm_hash $POOL_HASH
echo "{\"factory\": \"$FACTORY_ID\", \"pool_wasm_hash\": \"$POOL_HASH\"}" > .contract-ids.json
2. stellar.toml
Network configuration for Stellar CLI:
[testnet]
rpc-url = "https://soroban-testnet.stellar.org"
network-passphrase = "Test SDF Network ; September 2015"
[mainnet]
rpc-url = "https://soroban-rpc.stellar.org"
network-passphrase = "Public Global Stellar Network ; September 2015"
3. Makefile
build:
cargo build --target wasm32-unknown-unknown --release
test:
cargo test
deploy-testnet:
NETWORK=testnet ./scripts/deploy.sh
deploy-mainnet:
NETWORK=mainnet ./scripts/deploy.sh
Acceptance Criteria
Overview
There are no deployment scripts, configuration files, or documentation for deploying the contracts to Stellar testnet or mainnet. Developers must reconstruct the deployment sequence from the Stellar CLI docs and source code, which is error-prone and inconsistent across team members.
Required Deliverables
1.
scripts/deploy.shA shell script that:
farming-poolviastellar contract installfactorycontract viastellar contract deployfactory.initialize(admin, pool_wasm_hash).contract-ids.json2.
stellar.tomlNetwork configuration for Stellar CLI:
3.
MakefileAcceptance Criteria
scripts/deploy.shdeploys and initializes factory end-to-end on testnetMakefilewithbuild,test,deploy-testnet,deploy-mainnettargets.contract-ids.jsongenerated and gitignoredstellar.tomlwith testnet + mainnet RPC configuration