After deploying Soroban contracts (acbu-smart-contract/scripts/deploy_testnet.sh), complete these steps so mint_from_demo_fiat, mint_from_usdc, and admin_drip_demo_fiat do not fail on oracle, reserve, or empty custody.
Record IDs in backend .env as CONTRACT_ORACLE_TESTNET, CONTRACT_RESERVE_TRACKER_TESTNET, CONTRACT_MINTING_TESTNET, CONTRACT_BURNING_TESTNET, or the generic CONTRACT_* keys (see ACBU-DOCUMENTATION/ENV_VARS.md).
- Ensure
initialize/ basket setup matches your basket currencies (same codes asacbu-backendBASKET_CURRENCIES). - For each basket currency, call
submit_rate(or your admin path) soget_ratesucceeds. - For each basket currency, call
set_s_token_addresswith the deployed demo SAC contract ID for that currency.
get_acbu_usd_rate returns a safe default (DECIMALS = 1:1 in fixed-point) when no weighted rates exist yet, but you should still seed real rates before relying on economics.
is_reserve_sufficient compares total on-chain USD reserves to minted supply. After deploy, run update_reserve per currency with non-zero value_usd (7-decimal fixed point, same as shared::DECIMALS) so the first mint passes. Example shape (invoke via stellar contract invoke or your admin script):
currency:CurrencyCodeas a single-element string vector in XDR (seeacbu-backend/scripts/initContracts.tsfor examples).value_usd: large enough vs expected ACBU supply ×min_reserve_ratio.
- Deploy one SAC / token contract per basket currency (cap supply per your policy, e.g. 1e9 whole units).
- Mint the entire demo supply to the minting contract’s contract address (custodial pool on the minter).
- Optionally call
set_operatoron the minting contract so the backend signing key matches the authorized operator formint_from_demo_fiat(defaults to admin if unset).
STELLAR_SECRET_KEY must be the key that signs custodial txs:
admin_drip_demo_fiat: must be admin on the minting contract.mint_from_demo_fiat: first argumentoperatoris the same account as the tx source; it must equalget_operator()(default admin).
admin_drip_demo_fiat→ user wallet receives demo SAC.POST /v1/fiat/onramp→mint_from_demo_fiatcompletes;Transactionrowstatus=completedwith realblockchain_tx_hash.- Horizon: user ACBU balance increases.
mint_from_usdc is unchanged. Ensure oracle + reserves are seeded and USDC SAC matches minting initialize as documented in ENV_VARS.md.
Error(WasmVm, MissingValue) — “trying to invoke non-existent contract function”, admin_drip_demo_fiat or mint_from_demo_fiat
The contract id in .env points at an old deployment whose WASM predates custodial entrypoints.
cargo build alone does not change testnet. After building (cargo build --release -p acbu_minting --target wasm32-unknown-unknown), you must upload the WASM and upgrade the contract with Soroban CLI (e.g. soroban contract build / install / invoke ... --update per your workflow), or deploy a new minting contract and point CONTRACT_MINTING_* at it. Then seed demo SAC supply to the minter address again if the contract id changed.