Skip to main content

Signature

IPolicyRegistry.sol

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

Child Policy Inversion

A child ID may carry the invert flag (bit 63). The registry validates the base policy (the ID with bit 63 cleared) and stores the child ID with the invert bit set. At authorization time, the composite evaluates the inverted child as the logical NOT of its base result. Validity rules applied to each child:
  • The base (bit 63 cleared) must exist — PolicyNotFound if it does not.
  • The base must be a simple ALLOWLIST or BLOCKLIST, not a composite or built-in sentinel — InvalidChildPolicy if it is not.
  • PolicyNotFound takes precedence over InvalidChildPolicy across the whole child set (two-pass validation).

Reverts

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

Usage Example