Skip to main content
The Order is what a consumer signs. Its field order and types are authoritative: the off-chain ORDER_TUPLE in @caplane/shared mirrors this struct exactly, and the encoding of it produces the orderHash.
struct Order {
    address consumer; // payer + capability recipient; must equal the EIP-3009 signer
    address adapter;  // the ICapabilityAdapter the consumer authorizes by signing
    bytes   params;   // opaque, adapter-specific parameters
    address payToken; // the EIP-3009 token used to settle (TestUSDC on testnet)
    uint256 amount;   // total charged to the consumer, in payToken's smallest unit
    uint16  feeBps;   // relayer fee in basis points of amount; at most 10000
    address payee;    // the provider receiving amount minus fee
    uint256 nonce;    // a consumer-chosen uniqueness salt (NOT the EIP-3009 nonce)
}

Fields

#FieldTypeDescription
1consumeraddressThe payer and the capability recipient. Must equal the recovered EIP-3009 signer.
2adapteraddressThe ICapabilityAdapter the consumer authorizes. Signed into the hash, so a relayer cannot swap it.
3paramsbytesOpaque, adapter-specific parameters. Dynamic bytes; the encoding gotcha. Per-adapter schemas are in adapters.
4payTokenaddressThe EIP-3009 settlement token. TestUSDC on testnet.
5amountuint256Total charged to the consumer, in payToken’s smallest unit (TUSDC has 6 decimals).
6feeBpsuint16The relayer fee in basis points of amount. The broker reverts FeeTooHigh if it exceeds 10000.
7payeeaddressThe provider. Receives amount - fee after the grant.
8nonceuint256A consumer-chosen uniqueness salt. Not the EIP-3009 nonce.

order.nonce is not the EIP-3009 nonce

order.nonce (field 8) is a salt the consumer picks so two otherwise-identical orders hash differently. The EIP-3009 authorization nonce is the bytes32 orderHash = keccak256(abi.encode(order)). Both are called “nonce”; they are different values. See Order encoding.

See also

  • Order encoding: the byte-exact abi.encode(order) layout and a verifiable worked example.
  • brokerCapability: the entry point that takes this struct.
  • The binding: why signing this struct ties payment to the capability.