Skip to main content

Prerequisites

Before deploying Vowena, ensure you have the following installed:
  • Rust (latest stable) - rustup.rs
  • wasm32 target - rustup target add wasm32-unknown-unknown
  • Stellar CLI - cargo install stellar-cli or via Stellar docs
  • A funded Stellar account (mainnet XLM for fees, or testnet faucet for testing)

Build and Deploy

1

Clone the repository

2

Build the WASM binary

Compile the Soroban smart contract to WebAssembly:
This produces the optimized WASM binary at target/wasm32v1-none/release/vowena.wasm.
The compiled WASM is approximately 18.5 KB - well within Soroban’s size limits. The contract exports 17 functions.
3

Deploy to the network

Mainnet deployment costs real XLM. Ensure your account is funded and double-check the WASM binary before deploying. Contract upgrades are possible but require the admin key.
4

Initialize the contract

After deployment, initialize the contract with an admin address:
The admin address is used only for TTL management (extend_ttl). It cannot access funds, modify plans, or interfere with subscriptions. See Security for details.
5

Verify the deployment

Confirm the contract is live by calling a read-only function:
This should return an error like Plan not found - which confirms the contract is deployed and responding. No plans exist yet because none have been created.
6

Create your first plan

Test the full flow by creating a plan:
On testnet, you can get test USDC from the Stellar Laboratory. Use the test token address for the --token parameter.

Testing

The Vowena contract includes a comprehensive test suite:
The test suite includes 29 tests covering:
  • Plan creation and validation
  • Subscription lifecycle (create, cancel, expire)
  • Billing flow (charge, trial periods, grace periods)
  • Failed charge handling and pre-check logic
  • Migration request, accept, and reject flows
  • Refund processing
  • TTL extension
  • Edge cases (double charge, early charge, unauthorized access)

Contract Specifications


Environment Variables Reference

For convenience, set these in your shell when working with the contract:
Never commit secret keys to version control. Use environment variables or a secrets manager. The values above are examples only.

What’s Next

TypeScript SDK

Install the SDK and start building integrations.

Keeper Setup

Set up a keeper bot to automate billing.

API Reference

Complete reference for every contract function.

Architecture

Review the contract architecture and data models.