> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending OUSD (or other ERC-20s)

Sending OUSD, or other ERC-20 tokens, is one of the most common actions taken by wallet users on Ethereum-based chains. This guide will walk you through how to format the transaction input data for these tokens, using OUSD as an example.

## 1. Get the OUSD contract address

OUSD is an ERC-20-compatible token on Tempo. Its contract address on Tempo mainnet is `0x20c0000000000000000000006a37da5c996874be`.

The examples below use Tempo mainnet (chain ID `4217`). For network setup, refer to [Using Tempo with Privy](/recipes/tempo/send-transactions).

## 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 the `transfer` function on the contract, which takes in two parameters:

* `to`: The address of the recipient
* `value`: The amount of tokens to send

When formatting the transaction input data, you must define the expected interface of the function you're calling by providing an ABI. You can use helper packages like `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.

<View title="Typescript" icon="terminal">
  First, install the `viem` package if it is not installed yet.

  ```bash theme={"system"}
  npm install viem
  ```

  Then, build the transaction input data.

  ```typescript theme={"system"}
  import {encodeFunctionData, erc20Abi} from 'viem';

  const recipientAddress = '0x...';
  const amountToSend = 1; // Sender wants to send 1 OUSD
  const decimals = 6; // OUSD has 6 decimals

  const encodedData = encodeFunctionData({
    abi: erc20Abi,
    functionName: 'transfer',
    args: [recipientAddress, BigInt(amountToSend * 10 ** decimals)]
  });
  ```
</View>

## 3. Send the transaction

You can send the transaction using the Privy API. Below are examples for React, React Native, and NodeJS; you can find other SDKs' send transaction examples in the [Send a transaction](/wallets/using-wallets/ethereum/send-a-transaction) guide.

<View title="React" icon="react">
  ```typescript theme={"system"}
  import {useSendTransaction} from '@privy-io/react-auth';
  const {sendTransaction} = useSendTransaction();

  const {hash} = await sendTransaction({
    to: '$OUSD_CONTRACT_ADDRESS',
    data: '0x', // from the previous step
    chainId: 4217 // Tempo's chainId
  });
  ```
</View>

<View title="React Native" icon="react">
  ```typescript theme={"system"}
  import {useEmbeddedEthereumWallet} from '@privy-io/expo';

  const {wallets} = useEmbeddedEthereumWallet();
  const wallet = wallets[0];

  const provider = await wallet.getProvider();
  const accounts = await provider.request({
    method: 'eth_requestAccounts'
  });

  // Send transaction (will be signed and populated)
  const response = await provider.request({
    method: 'eth_sendTransaction',
    params: [
      {
        from: accounts[0],
        to: '$OUSD_CONTRACT_ADDRESS',
        chainId: '0x1079', // Tempo's chainId (4217) in hex
        data: '0x' // from the previous step
      }
    ]
  });
  ```
</View>

<View title="NodeJS" icon="node-js">
  ```typescript {skip-check} theme={"system"}
  import {PrivyClient} from '@privy-io/node';

  const privy = new PrivyClient({
    appId: 'insert-your-app-id',
    appSecret: 'insert-your-app-secret'
  });

  const ousdContractAddress = '0x20c0000000000000000000006a37da5c996874be'; // on Tempo

  const {hash} = await privy
    .wallets()
    .ethereum()
    .sendTransaction('insert-wallet-id', {
      caip2: 'eip155:4217', // Tempo's caip2
      params: {
        transaction: {
          to: ousdContractAddress,
          data: encodedData, // from the previous step
          chain_id: 4217 // Tempo's chainId
        }
      }
    });
  ```
</View>

<View title="Python" icon="python">
  ```python theme={"system"}
  ousd_contract_address = "insert-ousd-contract-address"

  response = client.wallets.ethereum.send_transaction(
      "insert-wallet-id",
      caip2="eip155:4217",
      params={
          "transaction": {
              "to": ousd_contract_address,
              "data": encoded_data,  # From the previous step
              "chain_id": 4217,
          }
      },
  )

  transaction_hash = response.hash
  ```
</View>

You've successfully sent OUSD!
