API
PolicyEnforcer
Offchain policy enforcement against ABI-encoded data.
PolicyEnforcer
Check and enforce policies against ABI-encoded call data.
Methods
check
Check a policy against ABI-encoded call data without throwing on violations.
function check(policy: `0x${string}`, callData: `0x${string}`, context?: Context): EnforceResult;Parameters
| Name | Type | Description |
|---|---|---|
policy | `0x${string}` | Binary policy blob as 0x-prefixed hex string. |
callData | `0x${string}` | ABI-encoded call data as 0x-prefixed hex string. |
context | Context | Optional execution context for context-scoped rules. |
Returns
EnforceResult — Pass with matched group index, or fail with one violation per evaluated failing group.
enforce
Enforce a policy against ABI-encoded call data, throwing on violation.
function enforce(policy: `0x${string}`, callData: `0x${string}`, context?: Context): void;Parameters
| Name | Type | Description |
|---|---|---|
policy | `0x${string}` | Binary policy blob as 0x-prefixed hex string. |
callData | `0x${string}` | ABI-encoded call data as 0x-prefixed hex string. |
context | Context | Optional execution context for context-scoped rules. |
Returns
void