Smart Contracts Overview
DolphinPay's on-chain logic is a single Move package (contract/) on Sui. It
implements a deliberately small surface: USDC payment lifecycle, merchant
registration, and admin governance.
What the contracts do
- Accept payments in native Circle USDC only (6 decimals). The allowed
coin type is stored in the shared
AdminConfigand enforced on every payment creation and execution. - Apply a global, admin-managed platform fee, currently 0 bps by policy. A non-zero fee requires a configured treasury and is capped at 1000 bps (10%) by the contract. Merchants have no fee configuration.
- Provide no on-chain refunds (ADR-004). The
Paymentstruct retainsrefundable/refund_windowfields for layout compatibility; they are alwaysfalse/0.
Modules
Exactly four modules exist, all under contract/sources/core/:
| Module | File | Responsibility |
|---|---|---|
dolphinpay::payment | payment.move | Payment creation, execution, cancellation, queries |
dolphinpay::merchant | merchant.move | Merchant registration, receiving addresses, status |
dolphinpay::admin | admin.move | AdminCap-gated fee, treasury, allowed-currency policy, merchant overrides, platform stats |
dolphinpay::events | events.move | Event structs and emit helpers for off-chain indexing |
There is no token registry, batch payment, payment splitting, subscription, DeFi/DEX, risk-management, or refund module.
contract/sources/
└── core/
├── payment.move
├── merchant.move
├── admin.move
└── events.move
Key objects
AdminConfig(shared) — platform fee bps, treasury address, the single allowed currency (Option<TypeName>), and platform statistics. Created inadmin::initat publish time.AdminCap(owned by deployer) — required for all governance functions.Merchant(shared) +MerchantCap(owned) — merchant record and the capability that authorizes changes to it.Payment(key, store) — one object per payment, holding amount (USDC base units), currencyTypeName, status, expiry, and metadata.
Security model
- Capability-based authorization:
AdminCapfor governance,MerchantCapfor merchant settings. Payment cancellation is restricted to the payment's merchant address. - Currency policy:
admin::assert_currency_allowedaborts payment creation and execution until the admin sets the allowed currency, and whenever the coin type differs from it. - Checks-effects-interactions: payment status, payer, and completion timestamp are written before any coin transfer.
- Overflow-safe fees: fee math is done in
u128(amount * fee_bps / 10000). - Input validation: non-zero merchant address, amount in
(0, 1_000_000_000_000]base units (max 1,000,000 USDC), description ≤ 500 chars, ≤ 10 metadata entries, expiry ≤ 1 year.
Deployment status
The current Sui Testnet deployment is live. Current deployment IDs live
only in DEPLOYMENT.md at the repository root; the previously published
testnet package is defunct and must not be used. There is no mainnet
deployment.
On the live project deployment, the allowed currency is already configured
to testnet native Circle USDC. If you self-publish your own package, the admin
must call admin::set_allowed_currency<USDC> — payments abort until the
allowed currency is set. Testnet native Circle USDC:
0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC
Building and testing
cd contract
sui move build
sui move test
Reference pages
- Core Modules — structs, lifecycle, and fee model
- Payment API —
dolphinpay::payment - Merchant API —
dolphinpay::merchant - Admin API —
dolphinpay::admin