API
PolicyEnforcer
Off-chain 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: templateLiteral, callData: templateLiteral, context?: Context): EnforceResult;Parameters
| Name | Type | Description |
|---|---|---|
policy | templateLiteral | Binary policy blob as 0x-prefixed hex string. |
callData | templateLiteral | 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 failed group.
enforce
Enforce a policy against ABI-encoded call data, throwing on violation.
function enforce(policy: templateLiteral, callData: templateLiteral, context?: Context): void;Parameters
| Name | Type | Description |
|---|---|---|
policy | templateLiteral | Binary policy blob as 0x-prefixed hex string. |
callData | templateLiteral | ABI-encoded call data as 0x-prefixed hex string. |
context | Context | Optional execution context for context-scoped rules. |
Returns
void