Allow ABI-specific contract call parameters
For contract interactions, use Smart Contract Interfaces (ABI upload) rather than raw calldata slicing. ABI-based policies use named arguments (eth.tx.contract_call_args['arg_name']) instead of byte offsets — they’re more readable, less
error-prone, and won’t silently break if the contract encoding changes. Raw eth.tx.data[...]
slicing is a fallback for contracts where no ABI is available.
Restrict a transfer call to a maximum amount and a specific recipient:
Allow ERC-20 transfers for a specific token smart contract (raw calldata fallback)
Use this pattern only when an ABI is unavailable. The selector0xa9059cbb is the 4-byte keccak256
hash of transfer(address,uint256).
Allow anyone to sign transactions for testnet (Sepolia)
Allow ETH transactions with a specific nonce range
Allow signing of EIP-712 payloads for Hyperliquid ApproveAgent operations
Inspect nested fields in EIP-712 message payloads
Theeth.eip_712.message map supports nested field access using bracket notation, allowing policies
to inspect typed data contents beyond just the domain and primary type.
Syntax:
- Nested struct fields:
eth.eip_712.message['outerField']['innerField'] - Array element fields:
eth.eip_712.message['arrayField'][0]['innerField']
HyperliquidTransaction:Order message contains an orders array of Order structs.
Each Order uses short field names: a (asset index), b (isBuy), p (price), s (size), r
(reduceOnly).
3):
Array access is index-based (
[0], [1], etc.). The condition
message['orders'][0]['a'] == '3' only checks the first order — any
additional orders in the array are not evaluated. To restrict all orders in a
known-size batch, add a condition for each index: message['orders'][0]['a'] == '3' && message['orders'][1]['a'] == '3'.