# withdrawERC721

Withdraw ERC-721 token from one user and returns a `Voucher` to the recipient on L1.
The voucher still needs to be emitted through an [emitVoucher](/app/outputs#vouchers) call.

## Usage

The following example withdraws the token 1 of the user who is submitting an input to the application.

```ts twoslash
import { Rollup, chain } from "@cartesi/rollup";
import { createWallet } from "@deroll/wallet";

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

// create wallet
const wallet = createWallet();

const token = "0xc6582A9b48F211Fa8c2B5b16CB615eC39bcA653B"; // NFT address
rollup.run({
    advance: chain(wallet.handler, ({ msgSender, appContract }) => {
        const user = msgSender;
        const dapp = appContract;
        const hasOne = wallet.erc721Has(token, user, 1n);
        if (hasOne) {
            const voucher = wallet.withdrawERC721(dapp, token, user, 1n); // [!code focus]
            rollup.emitVoucher(voucher);
        }
        return true;
    }),
});
```

## Returns

Type: `Voucher`

## Parameters

Type: `Address`

Address of ERC-721 token.

Type: `string`

User to withdraw from.

Type: `bigint`

Amount to withdraw.
