Build a checkout button that charges a user in USDSC. Inside the Startale App, the host paymaster sponsors gas, so the user pays only the stablecoin amount. Standalone dapps configure their own paymaster throughDocumentation Index
Fetch the complete documentation index at: https://docs.startale.com/llms.txt
Use this file to discover all available pages before exploring further.
paymasterOptions for the same gasless UX.
What you’ll build
A single button that:- Connects the user (if not yet connected).
- Sends a USDSC
transferfrom the smart account to a recipient address. - Reads the on-chain receipt to confirm the payment.
Prerequisites
- A working connect button.
- A recipient address controlled by your app. For testing, your own EOA on Soneium Minato is fine.
- A smart account funded with USDSC. On Minato, request testnet USDSC from the Startale team in Discord; there is no public USDSC faucet today.
Steps
1. Define constants
src/constants.ts
2. Build the pay button
src/PayButton.tsx
3. Render it
src/App.tsx
4. Verify the receipt
useWaitForTransactionReceipt from wagmi resolves once the transaction lands. The isSuccess flag flips when the receipt is available with status 'success'. For a deeper verification, read the recipient’s USDSC balance after the receipt:
Reading decimals dynamically
Hardcoding6 works today, but if Startale ever upgrades USDSC to use different decimals, the math breaks. The defensive pattern reads them at runtime:
What you’ve learned
- How to send an ERC-20 transfer from the user’s smart account.
- That the user pays no gas, sponsorship is automatic.
- How to confirm settlement on-chain with viem and wagmi.