> ## 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.

# IPolicyRegistry.updateComposite

> Replaces a composite policy's child-policy set in full with a new list of simple policy IDs.

## Signature

```solidity IPolicyRegistry.sol theme={null}
function updateComposite(uint64 policyId, uint64[] calldata childPolicyIds) external;
```

| Field | Value |
| - | - |
| Selector | `0xbfe142c0` |
| Canonical signature | `updateComposite(uint64,uint64[])` |

## Description

Replaces a composite policy's child-policy set in full with `childPolicyIds`. There is no partial edit, the entire child set is replaced in one call.

The write takes effect on the next `isAuthorized` call that references `policyId`. Every token that stores this policy ID sees the new result without a second `updatePolicy` call on the token.

## Parameters

| Name | Type | Description |
| - | - | - |
| `policyId` | `uint64` | Composite policy to update. Must exist and be a `UNION` or `INTERSECT` policy. |
| `childPolicyIds` | `uint64[]` | Complete new set of existing simple policy IDs. Count must be in `[MIN_COMPOSITE_CHILD_POLICIES, MAX_COMPOSITE_CHILD_POLICIES]` (2–4). |

## Reverts

| Error | Condition |
| - | - |
| `Unauthorized()` | Caller is not the current policy admin. |
| `PolicyNotFound()` | `policyId` does not exist, or any entry in `childPolicyIds` does not exist. |
| `IncompatiblePolicyType()` | `policyId` is not a composite (`UNION` or `INTERSECT`). |
| `ChildPoliciesOutsideOfRange()` | `childPolicyIds.length` is outside `[MIN_COMPOSITE_CHILD_POLICIES, MAX_COMPOSITE_CHILD_POLICIES]` (2–4). |
| `InvalidChildPolicy(childPolicyId)` | A child is a composite or a built-in sentinel (`ALWAYS_ALLOW`, `ALWAYS_BLOCK`) rather than a simple `ALLOWLIST` or `BLOCKLIST` policy. |

## Events

Emits `CompositePolicyUpdated(policyId, updater, childPolicyIds)` on success.

## Access Control

Callable only by the current admin of `policyId`. A composite whose admin has been renounced (via `renounceAdmin`) can never be updated.

## Example

```solidity Usage Example theme={null}
IPolicyRegistry(registry).updateComposite(gateId, newChildPolicyIds);
```
