Soroban smart contracts for the BettaPay payment infrastructure on Stellar.
BettaPay-Contract/
├── Cargo.toml # Rust workspace root (both contracts)
├── settlement_contract/ # Merchant registration, fee splits, payment references
│ ├── Cargo.toml
│ └── src/lib.rs
├── governance_contract/ # Fee config, anchor registry, system params
│ ├── Cargo.toml
│ └── src/lib.rs
└── scripts/
├── deploy_testnet.sh # Build + deploy both contracts + init admin
└── simulate.sh # Simulate contract calls locally
| Contract | Address |
|---|---|
| Settlement | CBGBGKJSUY7XYB6HWW4CVAU6MW2KD25FSF45E5KCP53TKUK374MBZNFB |
| Governance | CDPFWUTIXF5BC6BKNDLSQOZSDQCXAJNZFCZWHBE2RRHANRN25T3ILPZ7 |
| Admin | GCCHHKNI7GRA5QWC7RCTT3OHO7SKAUMKQA6IBWEQEO2SXI3GF376UHDD |
Network: Test SDF Network ; September 2015
# Run all tests
cargo test
# Build WASM release binaries
cargo build --target wasm32-unknown-unknown --release
# Deploy to testnet (requires soroban CLI)
bash scripts/deploy_testnet.shHandles the on-chain settlement layer:
init(admin)— one-time initialization, sets adminregister_merchant(merchant)— admin registers a merchant addressset_settlement_rule(merchant, rule)— admin sets fee BPS and settlement configstore_payment_reference(merchant, reference, amount)— merchant anchors a payment hash on-chain, emits events, calculates fee splitcalculate_fee_split(merchant, amount)— read-only fee split calculationget_payment_reference(reference)— fetch stored payment recordis_merchant_registered(merchant)— boolean check "all done" Handles protocol-level configuration:init(admin)— one-time initializationset_fee_config(config)— admin sets platform + network fee BPSget_fee_config()— read current fee configupdate_system_param(key, value)— generic key/value system configget_system_param(key)— read system paramupsert_anchor(asset, anchor)— register/update anchor for assetremove_anchor(asset)— remove anchorget_anchor(asset)— read anchor for asset
soroban-sdk = "21.7.7"
No cross-contract calls. Both contracts are independently deployable and stateless across each other. The backend services call them via Stellar RPC.