Skip to main content

Signature

IPolicyRegistry.sol

Description

Creates a new composite policy that combines 2–4 existing simple (ALLOWLIST or BLOCKLIST) policies under a UNION (OR) or INTERSECT (AND) logic gate. The composite references its children live: isAuthorized reads current child membership on every call, so updating a child’s membership immediately affects what the composite authorizes. The new policy is assigned a uint64 ID whose top byte encodes PolicyType; the low 56 bits come from a global counter.

Parameters

Returns

Revert Conditions

Access Control

Permissionless creation, but this call reverts with FeatureNotActivated while the PolicyRegistry feature is inactive.

Events Emitted

On success, three events are emitted:
  • PolicyCreated(newPolicyId, creator, policyType)
  • PolicyAdminUpdated(newPolicyId, address(0), admin)
  • CompositePolicyUpdated(newPolicyId, creator, childPolicyIds)

Example

Usage Example