wearenotabank Doku EN
Doku · Kosten
Doku

Gas und Kosten je Chain

Diese Seite nennt das Gas der Schritte, die ein Integrator sendet, je Chain und umgerechnet in USDC. Außerdem vergleicht sie, was der Router kostet, mit den anderen Fallback-Handlern, die ein Safe haben kann. Die Zahlen stammen aus Fork-Tests an einem festen Block je Chain; was sie nicht abdecken, steht am Ende der Seite.

Der Leitfaden unten steht auf Englisch, weil wir ihn unverändert aus dem Repository der SDKs übernehmen.

Costs

The gas of the steps an integrator sends, per chain, and what the router costs against the other handlers a Safe can have. Index: README.md. Every figure on this page is copied from docs/gas.md, which is generated from the fork suite's measurements (npm run read-gas -- render), and tools/test/integrator-docs.test.ts compares each table row here with the row of that file. No figure here comes from a live chain, and no release record exists yet to cite another.

What a figure is

Each figure is the gas of one call, measured against the real deployed contracts at the pin of its chain (docs/fork-tests.md, "Where the pins live"), cold: every account and slot the call touches is cold, as at the start of a transaction. A fork test holds each figure to the recorded value within 2 percent, so a change of a contract, of a pin or of a chain's proxies that moves one further fails the suite (docs/gas.md, "How the tables are kept true").

  • The tables of transaction gas include the 21,000 of intrinsic gas and the call data. The other tables give frame gas: the gas of the call's own frame, in a transaction of its own that starts cold, without the intrinsic gas and the call data (docs/gas.md, "What a figure is").
  • The cost in USDC is the transaction gas times the base fee of the pinned block, with no priority fee, times the price of one native token in USDC from the oracle's feeds. It is EVM gas only: Arbitrum One's L1 data charge and any other cost outside the EVM are not in it. A base fee changes from block to block.
  • A settlement is the real GPv2Settlement.settle by a solver added to the allow-list on the fork, with the buy token given to the settlement in place of an AMM route. A solver's route adds to every settlement figure, and a real batch's warm and cold mix differs from these cold figures.
  • The mint is the real receiveMessage with the attester replaced by a test key at a threshold of 1. A real mint checks Circle's attesters, two at the pin of Arbitrum One: one more signature.

Whoever sends a transaction pays its gas. The partner fees are separate, and are charged on sales (configuration.md).

The pins

The base fee and the price of the native token at the pinned block of each chain, from which the cost in USDC follows.

Value Base Ethereum Avalanche C-Chain Arbitrum One Polygon PoS Plasma
Base fee 0.005 gwei 0.336523462 gwei 5 gwei 0.02004 gwei 249.806542704 gwei 8 wei
One native token in USDC 2,477.864268 2,481.236781 10.002478 2,478.487181 0.097940 0.079851

Source: docs/gas.md, section "The pins".

The gas of each step

The steps in the tables, in the order an integrator meets them:

  • createProxyWithNonce: the Safe's deploy through the factory, with the setup helper's four modules and the router (setup.md).
  • applyConfiguration: the first apply, with each token of the oracle armed from nothing. It costs a fixed part plus a part for each token the oracle lists. A later apply, where the allowances are at the maximum and the orders are created again, is cheaper, and docs/gas.md ("The sweep module") has it.
  • sync: closes a lag of the documents, here with one token excluded and the others created again.
  • arm: the re-arm of one token that has nothing done for it, an approval and an order (running.md).
  • burn(safe) alone: a burn sent as a transaction of its own, once with the minter's USDC balance as the pin has it and once with that balance at zero, a write to an empty slot, which costs more. On the chains whose minter holds no USDC at the pin, the two rows are the same.
  • The settlements: a sweep's settlement with the burn hook running inside it, the carrier slice's, and the bootstrap order's with its two pre-hooks.
Step Base Ethereum Avalanche C-Chain Arbitrum One Polygon PoS Plasma
createProxyWithNonce, the product's Safe 378,973 378,937 379,024 378,984 379,007 379,047
applyConfiguration, all tokens armed from nothing 1,403,700 2,959,464 909,776 1,090,548 1,003,436 587,482
sync, one token excluded 537,708 1,082,751 351,654 431,332 389,574 234,490
arm, a token with nothing done for it 199,100 246,202 185,565 200,380 193,319 184,521
burn(safe) alone, the minter as the pin has it 219,005 219,421 236,156 219,005 236,139 238,687
burn(safe) alone, the minter empty 236,105 236,521 236,156 236,105 236,139 238,687
Settlement of the sweep, burn inside 467,011 468,687 485,505 481,791 485,668 488,088
Settlement of the carrier slice, burn inside 477,768 478,796 495,230 485,628 495,585 497,947
Settlement of the bootstrap order, burn inside 2,157,625 3,715,286 1,682,569 1,850,548 1,776,804 1,363,655

Source: docs/gas.md, section "Transaction gas".

The deploy ahead with arming (create the Safe, then apply) is, in frame gas, Base 1,732,053; Ethereum 3,287,793; Avalanche C-Chain 1,238,168; Arbitrum One 1,418,912; Polygon PoS 1,331,835; Plasma 915,897 (docs/gas.md, "Against section 3.4 of the architecture"). Arming one token inside the apply costs 82,071 to 86,065 gas on each chain, and the fixed part of the apply 303,288 to 316,395 (the same section), so the apply grows with the number of tokens the oracle lists at the pin: 13 on Base, 32 on Ethereum, 7 on Avalanche C-Chain, 9 on Arbitrum One, 8 on Polygon PoS and 3 on Plasma (docs/gas.md, "The pins"). The architecture note estimated about 65,000 gas to arm a token inside the apply; the measurement is higher, by about a third on Ethereum (docs/gas.md, "What the tables show").

The cost in USDC

At the base fee of the pin, with no priority fee:

Step Base Ethereum Avalanche C-Chain Arbitrum One Polygon PoS Plasma
createProxyWithNonce, the product's Safe 0.004695 0.316410 0.018955 0.018823 0.009272 below 0.000001 (3,032,376 wei)
applyConfiguration, all tokens armed from nothing 0.017390 2.471135 0.045500 0.054166 0.024550 below 0.000001 (4,699,856 wei)
sync, one token excluded 0.006661 0.904091 0.017587 0.021423 0.009531 below 0.000001 (1,875,920 wei)
arm, a token with nothing done for it 0.002466 0.205577 0.009280 0.009952 0.004729 below 0.000001 (1,476,168 wei)
burn(safe) alone, the minter as the pin has it 0.002713 0.183215 0.011810 0.010877 0.005777 below 0.000001 (1,909,496 wei)
burn(safe) alone, the minter empty 0.002925 0.197493 0.011810 0.011727 0.005777 below 0.000001 (1,909,496 wei)
Settlement of the sweep, burn inside 0.005785 0.391351 0.024281 0.023930 0.011882 below 0.000001 (3,904,704 wei)
Settlement of the carrier slice, burn inside 0.005919 0.399791 0.024767 0.024120 0.012125 below 0.000001 (3,983,576 wei)
Settlement of the bootstrap order, burn inside 0.026731 3.102242 0.084149 0.091914 0.043471 below 0.000001 (10,909,240 wei)

Source: docs/gas.md, section "Cost in USDC at the pin's base fee (no priority fee)".

On Plasma the base fee is 8 wei, so every transaction costs less than a millionth of a USDC. A sweep's whole settlement costs a fraction of a cent on Base and about two cents on Arbitrum One and Avalanche C-Chain. On Ethereum the bootstrap order costs about 3 USDC at the pin's base fee (docs/gas.md, "What the tables show"). These are the pins' base fees, and a different moment has a different fee.

The mint on the target chain

The mint a recovery sends (recovery.md). The sender pays it. Plasma is not a target, so it has none.

Step Base Ethereum Avalanche C-Chain Arbitrum One Polygon PoS Plasma
To an address with no Safe yet (a first balance) 178,950 196,251 178,945 178,962 178,950 none
Into the deployed Safe 161,826 162,063 161,838 161,838 161,838 none

Source: docs/gas.md, section "The mint on the target chain".

What the router costs

SETUP-REQ-020 asks the guide to state the router's gas cost against a Safe whose handler is Safe's 4337 module, and against a Safe with CoW's extensible handler, and the fork suite to measure it on all six chains. The suite measures it (test_TheRoutersCostToCreateASafeAgainstTheModuleKind, test_TheRoutersOrderCostsLessThanCowsHandlers and test_TheRoutersCostPerHookedSettlementAgainstTheModuleKind, run by ForkSuite<Chain>RouterGas; docs/gas.md, "The router (against Safe's 4337 module and against CoW's handler as the Safe's fallback handler)"). The router is the fallback handler of every Safe of this product, and the module kind is the Safe that has Safe's 4337 module as its handler.

The router costs more than the module kind to create and to run an op, and less than CoW's handler for the order the sweep uses. In frame gas, on all six chains (docs/gas.md, "The router against the other handlers"):

  • creating a Safe costs 26,086 more than the module kind, the same on each chain;
  • a settlement with an op as its post-hook costs 29,094 to 29,130 more than the module kind;
  • the same op through a bundler's handleOps costs 33,154 to 33,178 more than the module kind;
  • the signature check of the conditional order costs 4,875 less than with CoW's handler, and the settlement of the conditional order with no hook costs 6,571 to 6,583 less (all four from docs/gas.md, "The router against the other handlers").
Step Base Ethereum Avalanche C-Chain Arbitrum One Polygon PoS Plasma
Create a Safe: router kind, minus module kind +26,086 +26,086 +26,086 +26,086 +26,086 +26,086
Signature check of the conditional order: router, minus CoW's handler -4,875 -4,875 -4,875 -4,875 -4,875 -4,875
settle of the conditional order, no hook: router, minus CoW's handler -6,583 -6,583 -6,583 -6,583 -6,571 -6,583
settle with an op as post-hook: router kind, minus module kind +29,130 +29,106 +29,106 +29,118 +29,106 +29,094
handleOps of one op: router kind, minus module kind +33,178 +33,166 +33,178 +33,154 +33,166 +33,166

Source: docs/gas.md, section "The router against the other handlers".

The figures are for 1-of-1 Safes. A 2-of-2 Safe and larger owner sets were not measured on the six chains. The architecture note's figures were measured on Base only, as transaction gas with a real AMM route: +32,621 to +33,103 per hooked settlement and +26,016 to create, against the router's +29,094 to +29,130 and +26,086 here, and a sweep's settlement of 369,538 against the tables' 274,823 to 288,705 frame gas (docs/gas.md, "Against section 3.4 of the architecture"). Do not subtract one kind of figure from the other.

The burn hook's gas

The gas the source document declares for the burn hook is 200,000 on all six chains. The least gasLimit that burns inside a sweep's settlement is lower than that on each chain: 167,245 on Plasma, the worst, 164,585 on Polygon PoS and 164,515 on Avalanche C-Chain. The chains whose minter holds no USDC at the pin pay 17,100 more for the first write to an empty slot. The hook leaves the settlement standing when it runs out of gas, and anyone's later burn(safe) sends the proceeds on to the Safe on the target chain, so a limit that is too low is a delay and not a loss. DEC-017 (2026-10-20) ruled the hook gas to be 200,000 on all six chains, which is 19.59 % above the worst least. The code declares 200,000 (docs/gas.md, "The declared limits against the measurements" and "The constants the release candidate needs: the burn hook's gas").

What the figures do not cover

  • A real AMM route and the price a solver sets.
  • Arbitrum One's L1 data charge, and any other cost outside the EVM; state later than the pin; the base fee of another moment.
  • Tokens that cost more than the reviewed ones at the pin: an approve that costs more, a proxy with more indirection or a two-leg path in the oracle.
  • 2-of-2 Safes and larger owner sets.
  • Circle's side of the mint: the attestation and the forwarding fee. The forwarding fee is a recorded fixture (docs/fork-tests.md, "The forwarding fees").