PolicyEngine
GuardedWallet.executeUSDC rejects a zero amount and a frozen wallet before asking
PolicyEngine for a verdict. The engine then evaluates policy rules in this fixed order:
- A blocked vendor returns
FREEZEwhenfreezeOnBlockedVendoris true, otherwiseDENY. - A required but missing allowlist entry denies.
- A disabled category denies for registered vendors.
- The per-transaction cap denies.
- A registered vendor’s non-zero per-payment cap denies.
- The daily cap denies.
- A non-zero monthly cap denies.
- The escalation threshold returns
ESCALATE. - A transfer that reaches no earlier verdict returns
ALLOW.
Budget caps are evaluated before escalation, so council approval cannot override a cap.
The spend counters use fixed calendar indices: the daily counter resets when
block.timestamp / 1 days changes, and the monthly counter resets when
block.timestamp / 30 days changes. These are fixed UTC-aligned one-day and 30-day windows,
not trailing 24-hour or rolling monthly windows.
Release re-evaluation
An approval reaching quorum does not blindly execute the held transfer. The wallet calls
evaluateRelease against the current policy, vendor state, and spend counters.
evaluateRelease applies every rule above except the escalation threshold:
ALLOWexecutes and charges the current spend window.DENYleaves funds in the wallet and the manager recordsDENIED.FREEZEfreezes the wallet and the manager recordsDENIED.
This means a policy update, vendor block, or intervening spend can prevent a previously held transfer from being released.
const decision = await arc.simulate({
to: "0x0000000000000000000000000000000000000002",
amount: 50_000_000n,
})