# check\_is\_banned\_baker

This on-chain view checks if baker on the specific [Bucket](https://docs.quipuswap.com/smart-contracts/dex-2.0/bucket-contract) contract is banned or not. If baker is banned, voting for him is not possible.

### Call parameters

```pascaligo
type token_id_t         is nat

type is_banned_baker_t  is key_hash

type check_is_banned_t  is [@layout:comb] record [
  pair_id                 : token_id_t;
  baker                   : is_banned_baker_t;
]
```

<table><thead><tr><th width="150">Field</th><th width="202.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>pair_id</td><td>token_id_t (nat)</td><td>Pair ID for which you need to check if baker is banned or not</td></tr><tr><td>baker</td><td>is_banned_baker_t (key_hash)</td><td>Baker to check</td></tr></tbody></table>

### Return type

```pascaligo
bool
```

### Usage

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

```javascript
const dexCoreAddress = "KT1...";
const params = {
    pair_id: 1,
    baker: "tz1...",
};
const viewCaller = "tz1...";
const dexCore = await tezos.contract.at(dexCoreAddress);
const isBannedBaker = await dexCore.contract.contractViews.check_is_banned_baker(params).executeView({ viewCaller: viewCaller });
```

{% endtab %}
{% endtabs %}

### Errors

* `108` - pair (pool) with the specified `token_id` not listed.
* `113` - a [Bucket](https://docs.quipuswap.com/smart-contracts/dex-2.0/bucket-contract) contract not found (not TOK/TEZ LP pair).
* `125` - [***is\_banned\_baker***](https://docs.quipuswap.com/smart-contracts/dex-2.0/bucket-contract/on-chain-views-overview/is_banned_baker) view of [Bucket](https://docs.quipuswap.com/smart-contracts/dex-2.0/bucket-contract) contract isn't found.
