Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rhinestonewtf/warp-router/llms.txt
Use this file to discover all available pages before exploring further.
Overview
IntentExecutorAdapterGasRefund is a specialized adapter that extends the intent execution forwarding pattern to support gas refund functionality. It enables solvers to execute user intents while receiving compensation for gas costs directly from the user’s account.
Source: src/adapters/IntentExecutorAdapterGasRefund.sol
Inherits: AdapterBase
Key Features
- Gas Refund Support: Solvers receive gas compensation in user-specified tokens
- Multichain Support: Handles both multichain and single-chain operations with refunds
- Signature Protection: Gas refund terms must be included in user’s signature
- Memory-Safe Forwarding: Uses assembly for efficient calldata passthrough
This adapter expects exactly 20 bytes of relayer context containing the gas refund recipient address.
State Variables
EXECUTOR
src/adapters/IntentExecutorAdapterGasRefund.sol:38
Constructor
The address of the Router contract that will call this adapter via delegatecall
The address of the StandaloneIntentExecutor contract
src/adapters/IntentExecutorAdapterGasRefund.sol:49
Internal Functions
_gasRefundRecipient
src/adapters/IntentExecutorAdapterGasRefund.sol:60-65
Fill Functions
handleFill_intentExecutor_executeMultichainOps_gasRefund
The multichain operations structure containing:
account: User’s smart account addressoperations: Array ofTargetoperations to executenonce: Unique nonce for replay protectionsignature: User’s signature authorizing the execution and gas refund
The gas refund terms:
token: Address of ERC20 token (or address(0) for native ETH)amount: Amount of tokens to refund to the solver
this.handleFill_intentExecutor_executeMultichainOps_gasRefund.selector
Execution Flow:
- Extracts gas refund recipient from relayer context
- Forwards call to
StandaloneIntentExecutor.executeMultichainOps_gasRefund - Executor validates signature (must include gas refund terms)
- Executor processes operations across chains
- Executor transfers gas refund to the solver’s specified address
src/adapters/IntentExecutorAdapterGasRefund.sol:78-86
handleFill_intentExecutor_executeSingleChainOps_gasRefund
The single-chain operations structure containing:
account: User’s smart account addressoperations: Array ofTargetoperations to execute on this chainnonce: Unique nonce for replay protectionsignature: User’s signature authorizing the execution and gas refund
The gas refund terms (token and amount)
this.handleFill_intentExecutor_executeSingleChainOps_gasRefund.selector
Execution Flow:
- Extracts gas refund recipient from relayer context
- Forwards call to
StandaloneIntentExecutor.executeSingleChainOps_gasRefund - Executor validates signature (must include gas refund terms)
- Executor processes operations on the current chain
- Executor transfers gas refund to the solver’s specified address
src/adapters/IntentExecutorAdapterGasRefund.sol:95-103
Interface Support
handleFill_intentExecutor_executeMultichainOps_gasRefund.selectorhandleFill_intentExecutor_executeSingleChainOps_gasRefund.selector- All interfaces from
AdapterBase
src/adapters/IntentExecutorAdapterGasRefund.sol:107-115
Adapter Tag
src/adapters/IntentExecutorAdapterGasRefund.sol:117-119
Relayer Context Format
The adapter expects exactly 20 bytes of relayer context:Gas Refund Security Model
The signature validation ensures that:- Users explicitly authorize the gas refund amount
- Solvers cannot increase the refund amount
- Solvers cannot change the refund token
- The refund recipient is controlled by the solver (via relayer context)
- Account address
- Operations to execute
- Nonce for replay protection
- Gas refund token and amount
Usage Example
Comparison with IntentExecutorAdapter
| Feature | IntentExecutorAdapter | IntentExecutorAdapterGasRefund |
|---|---|---|
| Gas Refund Support | ❌ No | ✅ Yes |
| Relayer Context | None (skipped) | 20 bytes (gas refund recipient) |
| Signature Requirements | Operations only | Operations + gas refund terms |
| Use Case | Free execution or external compensation | On-chain solver compensation |
Related Contracts
- AdapterBase - Base adapter functionality
- IntentExecutorAdapter - Basic intent forwarding without gas refund
- StandaloneIntentExecutor - Target executor for standalone intents