Skip to main content

Launch contract reference

This page is the Stellar factory and vault ABI. For the live production factory, start at Base factory.

The current Stellar workspace exposes LaunchpadFactory and BondingCurve. This reference describes the source ABI, not the older Testnet fixtures.

Factory configuration​

__constructor(settings: FactorySettings) stores:

platformAddressRequired
Platform recipient used by graduation preview.
platform_fee_bpsu32Required
Platform fee, at most 1,000 basis points.
curve_wasm_hashBytesN<32>Required
Uploaded vault code to deploy.
reputationAddressRequired
Fixed registry; its interface is checked at construction.

The Base factory is constructed with platform, platformFeeBps, and a pair token. On Base mainnet that pair is Circle USDC. It does not take a WASM hash or a reputation registry.

Launch parameters​

create_bonding_curve(params: LaunchParams) -> Result<Address, Error> requires the owner's authorization and returns the new vault address.

FieldTypeConstraints or purpose
ownerAddressSupplies the deposited asset and receives team claims
assetAddressProject asset SAC
pairAddressQuote asset SAC; must differ from asset
metadataMetadataname, description, logo, symbol
allocationsAllocationspool_bps, curve_bps, team_bps; sum to 10,000
vestingVestingcliff_seconds, duration_seconds, schedule
curveCurveSettingsReserve, target, and fee fields below
starts_atu64Unix seconds; no end timestamp
reputation_labelu640 for no gate; otherwise an existing label ID

Both assets must be host-verified seven-decimal SACs. The deposited balance must be positive and no greater than i64::MAX base units. Pool and curve buckets must be nonzero; a nonzero team share must produce a nonzero amount.

CurveSettings fieldConstraint
virtual_base_reserve: i128Positive, at most i64::MAX, and greater than the curve bucket
virtual_quote_reserve: i128Positive and at most i64::MAX
graduation_target: i128Positive and no greater than cumulative gross cost at full sale
creator_fee_bps: u32At most 1,000
creator_payout_bps: u32Sum with platform fee cannot exceed 10,000

Use the contract's validation and quotes. Derived reserve settings must remain valid after integer rounding and at the maximum sold amount.

Curve formula​

Let Vb be virtual base reserves, Vq virtual quote reserves, and s the sold asset amount, all in base units. Define:

Text
F(s) = ceil(Vq × s / (Vb - s))

buy gross(a) = F(s + a) - F(s)
sell gross(a) = F(s) - F(s - a)

current_price = ceil(Vq × Vb × 10^7 / (Vb - s)^2)

current_price is quote base units per whole project asset. Buy payment adds ceil(gross × creator_fee_bps / 10,000); sell receipt subtracts it. Zero-gross trades are rejected. Round the cumulative function as implemented rather than rounding each increment independently.

Factory reads​

MethodReturns
settings()FactorySettings
launch_count()u32
launch_at(index: u32)Option<Address>; stored indexes start at 1

Vault reads​

MethodResult
get_config()Factory, platform, registry, launch parameters, deposited supply, buckets
get_state()Sold amount, quote reserve, creator fees, team claimed, buyer count, graduated flag, busy flag
status()Scheduled, Open, or Graduated
current_price()Marginal price, including before open and after graduation
quote_buy(amount) / quote_sell(amount)Quote { gross, creator_fee, user_amount }; trading state required
buyer_count()Number of distinct direct buyers
sellable_balance(buyer)Recorded remaining direct-buy position
is_eligible(address)Reputation result only
claimable_team()Unlocked team amount minus previous claims
graduation_preview()Intended creator, platform, pool quote, pool asset, and unsold curve amounts

Vault writes​

MethodAuthorization and effect
buy(buyer, amount, max_payment)Buyer authorizes; exact asset amount; total payment cap; current reputation check
sell(seller, amount, min_receipt)Seller authorizes; position-limited sell-back; net receipt floor
claim_creator_fees(recipient)Owner authorizes; withdraws accrued fees to chosen recipient
claim_team()Owner authorizes; transfers claimable team assets to owner

Methods returning monetary results use Result<..., Error>. Monetary amounts are i128 base units. Timestamps and durations use u64 seconds. The busy flag protects state during external transfers; it is not a user-controlled pause function.

There is no auction, presale, graduation settlement, pool creation, parameter update, cancellation, or upgrade method in the current Stellar ABI. Those sale formats are live on Base.