PolicyEngine
ThePolicyEngine is the central contract that stores policy configurations and coordinates rule evaluation. It serves as the registry for all account policies and the dispatcher for rule evaluation.
Overview
Policy Set Structure
Functions
setPolicySet
Register or update the caller’s policy set.
removePolicySet
Remove the caller’s policy set and stop enforcement.
evaluate
Evaluate a transaction against the caller’s registered policy. Called by PolicyGuard or PolicyKit7579Module.
Returns:
bool — Whether the transaction is allowed.
getPolicySet
Read the policy set for an account.
Events
Encoding Format
On-chain rules are encoded using thePolicyCodec library into a compact binary format:
PolicyEncoder handles encoding and decoding automatically.
