ERC-1271 Signing
ERC-1271 allows smart contracts to verify off-chain signatures, enabling gasless order creation from contracts like vaults, DAOs, and protocol treasuries.ERC-1271 vs PreSign
Use ERC-1271 when your contract needs to place orders frequently (trading vaults, automated strategies). Use PreSign when you need a simpler approach or can’t modify the contract code.
Implementing isValidSignature
Your contract must implement the EIP-1271 interface:
- Be a
viewfunction (no state changes) - Return
0x1626ba7e(the magic value) for valid signatures - Return any other value for invalid signatures
Example: Single-owner vault
Example: Multi-sig / threshold
Submitting ERC-1271 orders via SDK
Submitting via raw API
If not using the SDK, submit toPOST /api/v1/orders with:
signature field contains whatever bytes your contract’s isValidSignature expects. The protocol will call isValidSignature(orderDigest, signature) on your contract to verify.
EIP-712 domain separator
Your off-chain signer must produce the signature over the correct order digest. The EIP-712 domain is the same across all chains:Common errors
Token approvals
Your smart contract must approve the VaultRelayer (0xC92E8bdf79f0507f65a392b0ab4667716BFE0110) to spend the sell token. This approval must come from the contract itself (the order owner), not from an EOA.
Related resources
- Signing Schemes Reference — All four signing schemes explained
- Smart Contract Wallets (PreSign) — Simpler alternative for contracts
- Token Approvals — Approval patterns for the VaultRelayer
- Error Reference — Full error code reference