lovable skill · lovable-ousd

The OUSD skill, in full.

How to build OUSD payments on Base, Ethereum, Solana and Tempo with Privy wallets, plus the fixes. Lovable uses it automatically on OUSD builds. Add it under Settings → Skills, then type / in chat to call it up.

Download .zip

Chains

Base

  • import { base } from "viem/chains" → Privy defaultChain and supportedChains.
  • OUSD is an ERC-20. Send transfer(to, amount) encoded with viem erc20Abi, value: 0n, to the OUSD contract.
  • Cheapest EVM option. Enable Base in Privy → Gas Sponsorship and pass { sponsor: true }.

Ethereum

  • import { mainnet } from "viem/chains".
  • Same ERC-20 pattern as Base. Gas is expensive: sponsor it or show the estimated fee in USD before confirm.
  • Public RPCs rate-limit. Keep an Alchemy/Infura URL in a server-only secret and proxy reads.

Solana

  • OUSD mint: ousd2mJsPEckLHcSCDxyKD7NDGARZcfLbDZkKiatYHB.
  • Fetch the mint account and use its owner as the token program id (classic Token or Token-2022).
  • Transfer: getAssociatedTokenAddressSync(mint, owner, false, programId) for both sides, prepend createAssociatedTokenAccountIdempotentInstruction for the recipient, then createTransferCheckedInstruction(src, mint, dst, owner, amount, decimals, [], programId).
  • The public RPC is rate-limited — use SOLANA_RPC_URL (Helius/Alchemy) on the server.

Tempo

import { defineChain } from "viem";
export const tempo = defineChain({
  id: 4217,
  name: "Tempo",
  nativeCurrency: { name: "USD", symbol: "USD", decimals: 6 },
  rpcUrls: { default: { http: ["https://rpc.tempo.xyz"] } },
  blockExplorers: { default: { name: "Tempo Explorer", url: "https://explore.tempo.xyz" } },
});
  • Confirm the RPC URL at docs.tempo.xyz before shipping.
  • Native value transfers revert. OUSD is TIP-20: transfer(to, amount) on the OUSD address, value: 0n.
  • Explorer path is /receipt/<hash>, not /tx/<hash>.
  • Pass the same defineChain object to Privy defaultChain and supportedChains — a stub breaks the wallet.