Skip to content
nullislabsPublic

About

Gasless execution through CoW Protocol: same-token orders relay EIP-7702 account batches, paid in the user's own token

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Methane

Gasless execution through CoW Protocol, paid in the user's own token.

An EIP-7702 account signs a batch of calls. A CoW order that sells a token for the same token (WETH for WETH, say) carries that batch as a pre-hook. A solver settles the order, pays the gas and keeps its fee in the token. There is no relayer, paymaster, bundler, deposit or API key, and no change to CoW's contracts or services.

The first live relay

On 14 October 2026 an account wrapped its entire ETH balance into WETH without sending a transaction, and paid the fee in WETH. A normal wrap cannot do that, because it must keep ETH back for gas.

Account 0x6e17cAc0db135A5C6A9FA45758e2A314b399BF00, an EOA delegated to CowAccount7702
Order 0xf1bee6c7…bf006acf01f3, posted 03:46:09 UTC
Settlement 0x92b4ece312be368f97ced481bc46bfab283484198c497e9bc6216306c03ae4cf, block 26188140, 03:46:23 UTC (14 seconds later), CoW auction 14019695
What ran WETH.deposit of 0.09879939871467086 ETH, the whole balance, then WETH.approve(GPv2VaultRelayer, sell amount); the account's ETH balance went to exactly zero
Order sold 0.000453737 WETH, received 0.000425858 WETH
Fee 0.0000279 WETH (about 7 US cents): 0.0000237 to the solver, 0.0000042 CoW protocol fee
Solver's gas 180,561 gas at 0.0773 gwei, 0.0000139 ETH
Hook gas limit 72,061, used 63,230
Competition two solvers bid

The settlement was produced by examples/wrap-eth.

How it works

  1. The account signs an ERC-7821 Execute batch of its calls, with an unordered nonce and an expiry. The last call is approve(GPv2VaultRelayer, S) on the fee token.
  2. It signs a sell order of S of the fee token for at least S minus the max fee, of the same token, fill-or-kill. The order's appData carries one pre-hook: the account's execute with the signed batch.
  3. A solver settles the order. The HooksTrampoline calls the account, which checks the signature and runs the batch as itself. The settlement then pulls S and pays back S less the fee.

If the batch fails, its approval never happens, so the settlement cannot take the fee: no work, no fee. The examples refuse to run if a standing VaultRelayer allowance on the fee token already exists, since that would void this.

Examples

  • examples/wrap-eth: wrap the whole ETH balance into WETH, paying in WETH. This produced the live relay above.
  • examples/unwrap-eth: unwrap WETH, paying in WETH, as cheaply as a solver will accept, with a ladder of max fees and the smallest carrier CoW will quote.

Each has plan (read-only), simulate (an anvil fork through the real contracts) and run (real funds) modes, and needs foundry (cast, anvil), jq, curl and python3.

Contracts (Ethereum mainnet)

Contract Address
CowAccount7702 (the delegate) 0x15236F06922A288B68e57Ab42e397920a3F3Bb99 (verified; Sourcify)
GPv2Settlement 0x9008D19f58AAbD9eD0D60971565AA8510560ab41
GPv2VaultRelayer 0xC92E8bdf79f0507f65a392b0ab4667716BFE0110
HooksTrampoline 0x60Bf78233f48eC42eE3F101b9a05eC7878728006
WETH 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Limits

  • The account contracts are unaudited.
  • An account needs one setup transaction to delegate to CowAccount7702.
  • A small relayed action costs more gas than a direct transaction: the value is in not needing native gas.
  • Inclusion follows CoW's auction, so it is unsuited to time-critical actions.

Licence

GPL-3.0-or-later. See LICENSE.

About

Gasless execution through CoW Protocol: same-token orders relay EIP-7702 account batches, paid in the user's own token

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors