IPcl.registerPolicyTemplate

registerPolicyTemplate(string calldata templateId) external

Registers a built-in policy template into the active PCL template registry by templateId. The seven V1 templates (DENYLIST_POLICY, VOLUME_POLICY, PERIODIC_VOLUME_POLICY, EAS_POLICY, OKRW_EAS_TRANSFER_LIMIT_POLICY, OKRW_EAS_PERIODIC_VOLUME_LIMIT_POLICY, AGENT_OKRW_TRANSFER_LIMIT_POLICY) are shipped with the chain; this call makes one of them available for use in PolicyConfigs. Admin-only: the caller must be the PolicyAdmin (set via consortium governance). External dApp builders do not call this directly — surfaced here for protocol auditability and to clarify how a PolicySet's templateId refers back to a registered template.

Parameters

Name Type Required Description
templateId string The exact name of one of the seven built-in templates. Must match a known template ID — invented strings revert.

Returns

Type: void

No return value. Emits PolicyTemplateRegistered(string templateId) on success.

Examples

Admin-only: register a built-in template

// Caller must be PolicyAdmin. Reverts otherwise.
IPcl constant PCL = IPcl(0x1000000000000000000000000000000000000005);

PCL.registerPolicyTemplate("DENYLIST_POLICY");
PCL.registerPolicyTemplate("VOLUME_POLICY");
// ... and the other five built-in template IDs
ESC
Type to search