> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-roethke-b20-upgrade-pages.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IB20.policyId

> Returns the policy ID currently bound to a given policy scope on a B20 token.

## Signature

```solidity IB20.sol theme={null}
function policyId(bytes32 policyScope) external view returns (uint64);
```

| Field | Value |
| - | - |
| Selector | `0xdb3de624` |
| Canonical signature | `policyId(bytes32)` |

## Description

Returns the policy ID stored for `policyScope`. If the scope has never been assigned, this returns `0`, which is the `ALWAYS_ALLOW` built-in sentinel, every address is authorized.

## Parameters

| Parameter | Description |
| - | - |
| `policyScope` | The policy scope slot to query (for example, `TRANSFER_RECEIVER_POLICY` or `MINT_RECEIVER_POLICY`). |

## Returns

The `uint64` policy ID currently bound to the scope. `0` means `ALWAYS_ALLOW`.

## Reverts

* `UnsupportedPolicyType(policyScope)`: when `policyScope` is not a slot this token supports.

## Access Control

View function. No role required.

## Policy Scopes

The following scopes are recognized by a B20 token. Pass one of these as `policyScope`:

| Scope | Checked on | Account checked |
| - | - | - |
| `TRANSFER_SENDER_POLICY` | `transfer`, `transferFrom`, and memo variants | `from` |
| `TRANSFER_RECEIVER_POLICY` | `transfer`, `transferFrom`, and memo variants | `to` |
| `TRANSFER_EXECUTOR_POLICY` | `transferFrom` and `transferFromWithMemo` when `msg.sender != from` | `msg.sender` |
| `MINT_RECEIVER_POLICY` | `mint`, `mintWithMemo`, `batchMint` | `to` |
| `SEIZE_EXEMPT_POLICY` | `seizeWithMemo` | `from` |
| `SEIZE_RECEIVER_POLICY` | `seizeWithMemo` | `to` |

An unset scope reads as `0` (`ALWAYS_ALLOW`). To bind a different policy, the token admin calls `updatePolicy(policyScope, newPolicyId)`.

## Example

```solidity Usage Example theme={null}
uint64 id = IB20(token).policyId(B20Constants.MINT_RECEIVER_POLICY);
// id == 0 means ALWAYS_ALLOW (no mint restriction)
```
