Skip to main content

Signed Intents

A signed intent authorizes an executor to submit a Reserve Asset exchange on the payer’s behalf. The payer signs EIP-712 data; an executor calls multiswapWithSignature on the Dispatcher.

Domain and message​

The domain name is CavalRe Multiswap, version 1, with the selected chain ID and Dispatcher as verifyingContract.

const types = {
Amount: [
{ name: "tokenAddress", type: "address" },
{ name: "amount", type: "uint256" },
],
Allocation: [
{ name: "tokenAddress", type: "address" },
{ name: "allocation", type: "uint256" },
{ name: "minAmount", type: "uint256" },
],
MultiswapIntent: [
{ name: "pool", type: "address" },
{ name: "payer", type: "address" },
{ name: "recipient", type: "address" },
{ name: "executor", type: "address" },
{ name: "nonce", type: "uint256" },
{ name: "deadline", type: "uint256" },
{ name: "payReserveAssetsHash", type: "bytes32" },
{ name: "recReserveAssetsHash", type: "bytes32" },
],
};

Hash each pay Amount and receive Allocation, concatenate element hashes in array order, and bind the two resulting array hashes into MultiswapIntent. Use hashAmounts, hashAllocations, and hashMultiswapIntent to verify a client implementation against the contract.

Parties​

The payer supplies external ERC-20 pay assets and owns the Dispatcher allowance. The recipient receives output. A nonzero executor restricts who can submit; zero permits any submitter with the signature. Payer and recipient must be valid nonzero addresses.

For native pay assets, the executor supplies the exact msg.value. The signed payer remains the accounting payer.

Replay protection​

Read nonces(payer) before signing. Successful execution consumes the current sequential nonce. The deadline limits when the signature can be used.

A signature remains usable until its deadline or until its nonce is consumed. These are the current module’s signature-expiry paths. Signature validation supports EOAs and ERC-1271 contract wallets through SignatureChecker.

Submit​

await walletClient.writeContract({
account: executor,
address: dispatcher,
abi: intentAbi,
functionName: "multiswapWithSignature",
args: [intent, signature],
value: nativePayValue,
});

The example assumes the validated intent, signature, ABI, addresses, client, and native pay value are already available. Settlement recomputes the current quote and enforces the signed per-asset minimums.