# withdraw\_public\_fee

An entrypoint that allows the administrator of the contract to withdraw public fee that was accrued during the input of tokens to the this contract from [DexCore](https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract) contract (see [***withdraw\_auction\_fee***](https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/entrypoints-overview/dex-entrypoints/withdraw_auction_fee) entrypoint).

{% hint style="danger" %}
Only whitelisted tokens can be withdrawn (see [***update\_whitelist***](https://docs.quipuswap.com/smart-contracts/dex-2.0/auction-contract/entrypoints-overview/admin-entrypoints/update_whitelist) entrypoint).
{% endhint %}

### Call parameters

```pascaligo
type tez_t              is unit

type fa12_token_t       is address

type fa2_token_t        is [@layout:comb] record [
  token                   : address;
  id                      : nat;
]

type token_t            is
| Tez                     of tez_t
| Fa12                    of fa12_token_t
| Fa2                     of fa2_token_t

type withdraw_fee_t     is [@layout:comb] record [
  token                   : token_t;
  receiver                : address;
]
```

<table><thead><tr><th width="150">Field</th><th width="202">Type</th><th>Description</th></tr></thead><tbody><tr><td>token</td><td>token_t</td><td>FA1.2/FA2/TEZ token</td></tr><tr><td>receiver</td><td>address</td><td>Receiver of withdrawn tokens</td></tr></tbody></table>

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```javascript
const auctionAddress = "KT1...";
const params = {
    token: {
        token: "KT1...",
        id: 0,
    },
    receiver: "KT1.../tz1...",
};
const auction = await tezos.contract.at(auctionAddress);
const operation = await auction.methodsObject.withdraw_public_fee(params).send();

await operation.confirmation();
```

{% endtab %}
{% endtabs %}

### Errors

* `306` - token for withdrawing is NOT whitelisted.
* `400` - `sender` of the transaction is not current administrator.
* `412` - non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).
