# createERC20TransferVoucher

Utility to create a `Voucher` to transfer ERC-20 from the application to a destination address on the base layer.

## Usage

The example below shows how to create a `Voucher` to withdraw 1 CTSI to the `msgSender` of the an input.

```ts twoslash
import { Rollup } from "@cartesi/rollup";
import { createERC20TransferVoucher } from "@deroll/wallet";
import { parseUnits } from "viem";

// open the rollup device
const rollup = new Rollup();

const token = "0x491604c0FDF08347Dd1fa4Ee062a822A5DD06B5D"; // CTSI address
rollup.run({
    advance: ({ msgSender }) => {
        const value = parseUnits("1", 18);
        const voucher = createERC20TransferVoucher( // [!code focus]
            token, // [!code focus]
            msgSender, // [!code focus]
            value, // [!code focus]
        ); // [!code focus]
        rollup.emitVoucher(voucher);
        return true;
    },
});
```

## Returns

Type: `Voucher`

## Parameters

Type: `Address`

ERC-20 token address.

Type: `Address`

Destination address.

Type: `bigint`

Amount to transfer.
