Pre-release — The API surface may change. Unaudited.
Callcium LogoCallcium
API

PolicyEnforcer

Enforces that `callData` complies with a `policy`.

Git Source

Functions

enforce

Reverts when callData violates policy.

Requires a structurally validated policy blob; behavior on an unvalidated blob is undefined.

Git Source

function enforce(bytes memory policy, bytes calldata callData) internal view;

Parameters

NameTypeDescription
policybytesThe policy blob with embedded descriptor.
callDatabytesThe calldata to validate.

check

Returns true if callData complies with policy.

Requires a structurally validated policy blob; behavior on an unvalidated blob is undefined. Reverts on abort violations and integrity errors; returns false for group-local violations.

Git Source

function check(bytes memory policy, bytes calldata callData) internal view returns (bool ok);

Parameters

NameTypeDescription
policybytesThe policy blob with embedded descriptor.
callDatabytesThe calldata to validate.

Returns

NameTypeDescription
okboolTrue if calldata complies with the policy.

Errors

PolicyViolation

Thrown when policy validation fails.

Git Source

error PolicyViolation(uint32 groupIndex, uint32 ruleIndex);

SelectorMismatch

Thrown when the function selector does not match the policy header.

Git Source

error SelectorMismatch(bytes4 expected, bytes4 actual);

UnknownOperator

Thrown when an unknown operator code is encountered.

Git Source

error UnknownOperator(uint8 opCode);

UnknownContextProperty

Thrown when an unknown context property ID is requested.

Git Source

error UnknownContextProperty(uint16 contextId);

MissingSelector

Thrown when calldata is too short to contain a selector.

Git Source

error MissingSelector();

QuantifierLimitExceeded

Thrown when array exceeds max length for quantified iteration.

Git Source

error QuantifierLimitExceeded(uint256 length, uint256 maxLength);

NonCanonicalValue

Thrown when a resolved word is not the canonical encoding of its declared type.

Git Source

error NonCanonicalValue(uint8 typeCode, bytes32 value);

Parameters

NameTypeDescription
typeCodeuint8The declared type of the target.
valuebytes32The raw 32-byte word.

On this page