scripts/soroban-deploy-contract.sh. It builds the contract, deploys it, initializes it, and prints the values you need for .env.local.
Prerequisites
- Stellar CLI (
stellar) - Rust toolchain (
cargo) - A funded Stellar account on the target network
Quick start (Testnet)
From the repository root:1. Create Stellar CLI identities
You need two logical roles:
For local development, one identity is enough. Use the same name for both flags.
2. Fund the accounts
Fund whichever account pays fees on Testnet:initialize transaction fee.
3. Deploy and initialize
Single account (simplest):- Run
cargo test -p payoes - Build the contract WASM
- Deploy to the selected network (default:
testnet) - Call
initialize(admin, authorization_signer, fee_recipient)with the operator public key - Print:
4. Configure .env.local
Add the deploy output to .env.local at the repository root:
Copy the script output into your env file:
5. Verify the contract
register_payment, deposit, release_deposit_to_operator, record_settlement, and refund_held_deposit.
Script reference
Supported networks are any name from:
testnet, mainnet, futurenet, local.
Deploy fees are paid by
--source-account. initialize is signed by --operator-account because the contract requires admin authorization.QR deposits are received by muxed addresses on the Payoes operator account. The app automatically adds operator trustlines for each merchant accepted asset when payments are created, quotes are refreshed, or payment methods are enabled.
Common checkout errors
Redeploying after contract changes
When the Rust contract changes:- Re-run the deploy script (it creates a new contract ID)
- Update
SOROBAN_TESTNET_CONTRACT_IDin.env.local - Restart
npm run dev
Mainnet
Use the same script with--network mainnet and set the *_MAINNET_* env vars instead:
