Skip to main content
The call policy filters transactions by calldata and ETH value. In v2 sessions, you express it as ABI-driven parameter rules on a permission’s function — the SDK reads the function selector and parameter offsets from the ABI for you.

Conditions

Available conditions:
  • equal (x=Ax = A)
  • greater than (x>Ax > A)
  • less than (x<Ax < A)
  • greater than or equal (xAx \geq A)
  • less than or equal (xAx \leq A)
  • not equal (xAx \neq A)
A param rule takes one of three shapes:
  • { condition, value, usageLimit? } — a single comparison, using one of the conditions above.
  • { min, max, usageLimit? } — inclusive bounds, compiling to two comparisons the param must pass together.
  • { anyOf: [...] } — an allowlist of accepted values. See the migration guide for the rules it expands to.

Usage

To restrict an ERC20 transfer to a single recipient: Examples on this page use @rhinestone/sdk, where rhinestone is the RhinestoneSDK instance from Create a session with a custom setup.
Reference parameters by name — the SDK looks them up in the ABI. Only static types are supported (address, bool, uint*, int*, bytes1bytes32). To bound a param on both sides, give min and max instead of a condition:
This allows transfers between 1 and 10 USDC inclusive.

Param accumulator

Cap the total accumulated value of a param across all session uses with usageLimit. Useful for capping cumulative spend across calls.
This caps each transfer at 10 USDC and the total across the session lifetime at 50 USDC.

Value limit

To cap the ETH value sent on a single call, use valueLimitPerUse at the function level:
This limits the value per call to 0.1 ETH.