EIP-712 Domain & Types

Domain
{
  "name": "Gasyard",
  "version": "1",
  "chainId": 8453,
  "verifyingContract": "0x6a2A5B7D0434CC5b77e304bc9D68C20Dee805152"
}
Types
{
  "PaymentIntent": [
    { "name": "user", "type": "address" },
    { "name": "amount", "type": "uint256" },
    { "name": "nonce", "type": "uint256" },
    { "name": "validUntil", "type": "uint256" },
    { "name": "restrictions", "type": "bytes32" }
  ]
}
Most developers should use SDK helpers to create and sign intents. Direct struct construction is only recommended for protocol contributors.

Required Fields

  • user: address
  • amount: uint256 (or 0 for variable, controlled by maxPerTx)
  • nonce: uint256 (global revocation)
  • validUntil: uint256 (unix epoch)

Restrictions Encoding (bytes32)

  • Bitmask / hashed struct for: recipients allowlist, networks allowlist, geofence, time windows, categories

Validation Rules

  • EIP-712 signature must match user
  • Nonce must equal current user nonce
  • validUntil >= block.timestamp
  • amount and rules must satisfy policy constraints

Best Practices

  • Prefer Stableyard offchain intents for consumer UX; use onchain intents for protocol‑level control
  • Use unique nonces per user and rotate if compromise is suspected
  • Keep validUntil bounded (e.g., hours to days) to minimize risk

Examples

{
  "user": "0x742d...",
  "amount": 0,
  "nonce": 12,
  "validUntil": 1735689600,
  "restrictions": "0x..."
}