Skip to main content

How It Works

SodaPop consists of smart contracts deployed on each supported chain and an API for creating and tracking invoices.

Your backend ──POST /integration/invoices──► SodaPop API
│ returns paymentAddress + url
Payer ──USDC / native token──► Payment address (one per invoice)
│ balance ≥ amount
status: paid ─┤ webhook to your webhookUrl
│ funds withdrawn on-chain
Merchant payout address ◄────────────────────────┘ status: completed

Smart contracts​

ContractRole
PaymentFactoryComputes payment addresses, executes withdrawals, and stores each merchant's fee and payout address.
Payment walletA minimal proxy at a deterministic CREATE2 address derived from (owner, invoiceId). The address exists before the wallet is deployed, so payers can send funds immediately.

Both contracts have the same address on every supported chain. Addresses, the ABI summary and events are on the Smart contracts page.

Custody model​

  • Funds sit in a payment wallet controlled by the factory. Anyone can trigger a withdrawal, but it always pays the merchant's payout address (the owner wallet unless changed). The factory itself never holds funds.
  • SodaPop pays gas for withdrawals and setting changes but cannot redirect funds: the payout address can only be changed by the owner or with the owner's EIP-712 signature.
  • Only the owner can move funds anywhere else, using walletExecute on its own payment wallets, for example to recover NFTs sent to an invoice address.
  • SodaPop never stores merchant private keys.
  • Owner-only withdrawals. An owner can call setOwnerOnlyWithdraw(true) on the factory. From then on only the owner itself can withdraw its payment wallets, and SodaPop never withdraws them. This suits owners that are smart contracts and settle each deposit themselves. SodaPop still tracks the invoices, marks them paid and sends webhooks. See Smart contracts.

Fees​

Fees are set per merchant in basis points (100 bps = 1%) and stored on-chain:

  • Withdraw fee is deducted when a withdrawal is executed by someone other than the owner, for example by SodaPop on the owner's behalf. It is 10 bps (0.1%) by default; the owner can set any value from 0 to 500 bps (5%). Withdrawals the owner executes itself are free of this fee.
  • Platform fee is a share of the withdraw fee (up to 50% of it) that goes to the protocol treasury. It does not increase what the merchant pays.

Example: a balance of 1,000 USDC with a 200 bps fee and a 10% platform share pays 980 USDC to the merchant, 18 USDC to the executor and 2 USDC to the treasury.

To check the fee that applies to you, call getEffectiveWithdrawFeeBps(owner, executor) on the factory. See Fees and payout address to change the fee or payout address.

Dashboard​

At app.sodapopfi.com you sign in with your wallet to generate API keys, view invoices and withdrawals, and manage on-chain settings.