Signature
IPolicyRegistry.sol
Description
Creates a composite policy that combines two to four existing simple policies (ALLOWLIST or BLOCKLIST) under a single logic gate:
The registry stores references to the children, not a snapshot of their members. Every call to
isAuthorized reads each child’s current member set, so updates to a child policy are immediately visible through the composite.
A child policy ID may carry the invert flag (bit 63, set via invertedPolicyId). The registry validates and stores the base policy ID while preserving the invert flag. At authorization time, the inverted child returns the opposite of its base’s result. An inverted composite child is not valid and reverts InvalidChildPolicy. Across the whole child set, PolicyNotFound takes precedence over InvalidChildPolicy.
Creation is permissionless. The admin you supply is the only address that can later call updateComposite, stageUpdateAdmin, or renounceAdmin on this policy.
On success, emits PolicyCreated(newPolicyId, creator, policyType), PolicyAdminUpdated(newPolicyId, address(0), admin), and CompositePolicyUpdated(newPolicyId, creator, childPolicyIds).
Parameters
Returns
Reverts
Access Control
Permissionless, any caller may create a composite policy.Example
Create a KYC-and-sanctions composite
KYC and not on an exclusion list
Updating a child policy’s membership (via
updateAllowlist or updateBlocklist) takes effect on the next isAuthorized call through any composite that references it. No second updateComposite is needed on the token. This applies to inverted children too — updating the base updates the inverse.