> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-sync-code-change-6bb10a4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IB20.updatePolicy

> Generated B20 reference for updatePolicy(bytes32,uint64).

## Signature

```solidity theme={null}
function updatePolicy(bytes32 policyScope, uint64 newPolicyId) external;
```

| Field               | Value                          |
| ------------------- | ------------------------------ |
| Selector            | `0xadf9c4ea`                   |
| Canonical signature | `updatePolicy(bytes32,uint64)` |

## Description

Updates the policy ID assigned to `policyScope`. Takes effect immediately for the next operation that consults this slot. Emits `PolicyUpdated`.

## Parameters

| Parameter     | Description                      |
| ------------- | -------------------------------- |
| `policyScope` | Policy slot scope.               |
| `newPolicyId` | Policy ID to assign to the slot. |

## Reverts

* `AccessControlUnauthorizedAccount` when the caller does not hold `DEFAULT_ADMIN_ROLE`.
* `UnsupportedPolicyType` when `policyScope` is not recognized by this token.
* `PolicyNotFound` when `newPolicyId` is not a built-in sentinel and does not exist in the registry.

## Access control

`DEFAULT_ADMIN_ROLE` gates this call. Factory initCalls bypass the role gate during creation.

## Policy interaction

Reads or writes a token policy-scope pointer into the PolicyRegistry. The `newPolicyId` may reference a simple policy (`ALLOWLIST` or `BLOCKLIST`) or a composite policy (`UNION` or `INTERSECT`). B20 treats the value as an opaque `uint64` and delegates all authorization logic to the PolicyRegistry.

<Warning>
  Before storing a composite policy ID, call `policyExists(policyId)` on the PolicyRegistry. An invalid `INTERSECT` ID with no children returns `true` for every account, behaving like `ALWAYS_ALLOW`.
</Warning>

## Example

```solidity theme={null}
IB20(token).updatePolicy(B20Constants.MINT_RECEIVER_POLICY, policyId);
```
