1. Get the OUSD contract address
OUSD is an ERC-20-compatible token on Tempo. Its contract address on Tempo mainnet is0x20c0000000000000000000006a37da5c996874be.
The examples below use Tempo mainnet (chain ID 4217). For network setup, refer to Using Tempo with Privy.
2. Format the transaction send input data
OUSD, and other ERC-20 tokens, are smart contracts. In order to send these tokens, your transaction needs to call thetransfer function on the contract, which takes in two parameters:
to: The address of the recipientvalue: The amount of tokens to send
viem to provide the ABI and encode the function parameters.
Additionally, each ERC-20 token defines a decimals value, which is the number of decimal places for the token. For OUSD, the decimals value is 6, but for most other ERC-20 tokens, it’s 18.
First, install the Then, build the transaction input data.
viem package if it is not installed yet.
