This guide covers Soroban testnet deployment first, then production/mainnet readiness.
- Contract ID:
CB6HVHRQYILGNKW7RBB66BC6TDBIEWADOA2YUUV4I22RXRLA6DY6OAKT - Network: Stellar Testnet
- RPC URL:
https://soroban-testnet.stellar.org - Network passphrase:
Test SDF Network ; September 2015 - Deploy tx:
e3f88cee225bb5548e4640afe02c351373575469fb60dac6f5de670aa7687156 - Explorer:
https://stellar.expert/explorer/testnet/tx/e3f88cee225bb5548e4640afe02c351373575469fb60dac6f5de670aa7687156 - Lab contract:
https://lab.stellar.org/r/testnet/contract/CB6HVHRQYILGNKW7RBB66BC6TDBIEWADOA2YUUV4I22RXRLA6DY6OAKT
If you only need local/frontend development, set this contract ID in frontend/.env.local and skip sections 3-4.
Install and verify:
stellar --version
rustc --version
node --versionConfigure Stellar network profile (if missing):
stellar network add --global testnet \
--rpc-url https://soroban-testnet.stellar.org \
--network-passphrase "Test SDF Network ; September 2015"cp .env.example .env
cp .env.example frontend/.env.localSet:
NEXT_PUBLIC_SOROBAN_RPC_URLSTELLAR_NETWORK_PASSPHRASENEXT_PUBLIC_CONTRACT_ADDRESS(use current deployed ID or fill after deploy)
./scripts/fund-testnet.sh --alias copilot-deployerThis creates/uses the alias and funds it through Friendbot.
./scripts/deploy-contract.sh --network testnet --source copilot-deployerScript actions:
- Builds release Wasm (
wasm32-unknown-unknown) - Deploys via
stellar contract deploy - Writes contract ID to
frontend/.env.local - Prints explorer link and RPC reference
stellar contract inspect --id "$NEXT_PUBLIC_CONTRACT_ADDRESS" --network testnetExample with the current live contract:
stellar contract inspect \
--id CB6HVHRQYILGNKW7RBB66BC6TDBIEWADOA2YUUV4I22RXRLA6DY6OAKT \
--network testnetAlso validate:
- Contract ID in
frontend/.env.local - Frontend points to testnet RPC
- Donation/create/claim flows simulate and submit correctly
./scripts/sync-abi.sh --contract-id "$NEXT_PUBLIC_CONTRACT_ADDRESS" --network testnetOutputs:
frontend/src/lib/contract/abi.jsonfrontend/src/lib/contract/abi.ts
Rapid feedback requires robust preview environments. To configure Vercel with auto-deploying Pull Request (PR) previews using isolated testnet parameters:
- Log in to the Vercel Dashboard, click Add New > Project, and import your GitHub repository.
- Select Next.js as the Framework Preset.
- Keep the root directory set to
frontend.
Vercel allows assigning environment variables to specific target environments (Production, Preview, and Development). Use this isolation to ensure preview URLs point to Stellar Testnet contracts, while the main production site targets the Mainnet contract:
| Environment Variable | Target Environment | Value / Source |
|---|---|---|
NEXT_PUBLIC_CONTRACT_ID |
Preview & Development | Testnet Contract ID (e.g., CB6...) |
NEXT_PUBLIC_CONTRACT_ID |
Production | Mainnet Contract ID (e.g., CC...) |
NEXT_PUBLIC_SOROBAN_RPC_URL |
Preview & Development | Testnet RPC: https://soroban-testnet.stellar.org |
NEXT_PUBLIC_SOROBAN_RPC_URL |
Production | Mainnet RPC / custom production endpoint |
NEXT_PUBLIC_NETWORK_PASSPHRASE |
Preview & Development | Test SDF Network ; September 2015 |
NEXT_PUBLIC_NETWORK_PASSPHRASE |
Production | Public Global Stellar Network ; October 2015 |
Make sure to deselect the environments appropriately when adding each key to prevent preview URLs from pulling Mainnet configuration.
- In your Vercel project, go to Settings > Git.
- Under the Preview Deployments section, ensure auto-deployments are Enabled for all branch pushes except the production branch (
main).
To prevent merging un-verified PRs:
- In your GitHub repository, navigate to Settings > Branches.
- Click Add Rule under Branch Protection Rules (or edit the rule for
main). - Check Require status checks to pass before merging.
- Search for and check the Vercel - Preview status check.
- Save the protection rule. This requires any Pull Request to deploy successfully on Vercel before it can be merged.
If your contract architecture supports upgrade/admin patterns:
- Build new Wasm.
- Deploy new version to testnet.
- Run regression tests against old and new IDs.
- Update frontend env to new contract ID.
- Communicate migration plan for in-flight campaigns.
If upgrades are not supported in current design, deploy immutable new contract IDs and migrate state at application layer.
- Security checklist in
docs/SECURITY.mdcompleted - Final Mainnet Audit Checklist in
docs/MAINNET_AUDIT_CHECKLIST.mdcompleted - Independent review of auth, token validation, and deadlines
- CI pipelines green on protected
main - Mainnet network profile configured correctly
- Mainnet funding source secured and access-controlled
- Frontend env switched to mainnet RPC + contract ID
- Rollback and incident response plan documented