Skip to main content

Signature

Description

Replaces a composite policy’s entire child set with childPolicyIds. No partial update or clear-the-list operation is supported. The new child set must contain between MIN_COMPOSITE_CHILD_POLICIES (2) and MAX_COMPOSITE_CHILD_POLICIES (4) existing simple policies, subject to the same validation rules as createCompositePolicy. Authorization evaluates each child’s current membership live on every call — the update takes effect immediately.

Revert conditions

The canonical revert order is:
  1. PolicyNotFoundpolicyId does not exist.
  2. IncompatiblePolicyTypepolicyId is a simple policy, not a UNION or INTERSECT composite.
  3. Unauthorized — caller is not the current admin. A composite whose admin has been renounced (address(0)) can never be updated.
  4. ChildPoliciesOutsideOfRangechildPolicyIds.length is outside [2, 4].
  5. PolicyNotFound — a child policy ID does not exist.
  6. InvalidChildPolicy — a child policy is itself a composite or a built-in sentinel (ALWAYS_ALLOW or ALWAYS_BLOCK).

Events emitted

Emits only CompositePolicyUpdated(policyId, updater, childPolicyIds). The admin does not change, so no PolicyAdminUpdated event is emitted.

Access control

Callable by the current policy admin for the target composite policy.

Policy interaction

This is part of the singleton PolicyRegistry surface used by B20 policy scopes. A composite policy ID is passed to a B20 policy slot as an opaque uint64, identical to a simple policy ID — no B20 contract changes are required.

Example