Expand description
Arbitrum precompile contracts.
Implements the system contracts at addresses 0x64+ that provide
on-chain access to ArbOS state, gas pricing, retryable tickets,
Stylus WASM management, and node interface queries.
Re-exports§
pub use arbsys::ARBSYS_ADDRESS;pub use arbsys::create_arbsys_precompile;
Modules§
Enums§
- ArbPrecompile
Error - Errors raised by Arbitrum precompiles.
Constants§
- ARBADDRESSTABLE_
ADDRESS - ArbAddressTable precompile address (0x66).
- ARBAGGREGATOR_
ADDRESS - ArbAggregator precompile address (0x6d).
- ARBBLS_
ADDRESS - ArbBLS precompile address (0x67).
- ARBDEBUG_
ADDRESS - ArbDebug precompile address (0xff).
- ARBFILTEREDTXMANAGER_
ADDRESS - ArbFilteredTransactionsManager precompile address (0x74).
- ARBFUNCTIONTABLE_
ADDRESS - ArbFunctionTable precompile address (0x68).
- ARBGASINFO_
ADDRESS - ArbGasInfo precompile address (0x6c).
- ARBINFO_
ADDRESS - ArbInfo precompile address (0x65).
- ARBNATIVETOKENMANAGER_
ADDRESS - ArbNativeTokenManager precompile address (0x73).
- ARBOSACTS_
ADDRESS - ArbosActs precompile address (0xa4b05).
- ARBOSTEST_
ADDRESS - ArbosTest precompile address (0x69). Burns arbitrary amounts of L2 gas.
- ARBOWNERPUBLIC_
ADDRESS - ArbOwnerPublic precompile address (0x6b).
- ARBOWNER_
ADDRESS - ArbOwner precompile address (0x70).
- ARBRETRYABLETX_
ADDRESS - ArbRetryableTx precompile address (0x6e).
- ARBSTATISTICS_
ADDRESS - ArbStatistics precompile address (0x6f).
- ARBWASMCACHE_
ADDRESS - ArbWasmCache precompile address (0x72).
- ARBWASM_
ADDRESS - ArbWasm precompile address (0x71).
- NODE_
INTERFACE_ ADDRESS - NodeInterface virtual contract address (0xc8).
- NODE_
INTERFACE_ DEBUG_ ADDRESS - NodeInterfaceDebug virtual contract address (0xc9).
- P256VERIFY_
ADDRESS - RIP-7212 P256VERIFY precompile address (ArbOS v30+).
Functions§
- build_
fake_ tx_ bytes - Build the EIP-2718 envelope of a fake EIP-1559 tx used to size the calldata payload for gas estimation (hard-coded random nonce/tip/feeCap/gas/sig fields).
- charge_
computation - Charge precompile gas attributed to pure computation: constant per-method
work, the framework
resultCostfor encoding return data, and any other non-resource-bound costs. Mirrors the reference framework’sBurn(Computation, ...)calls. - charge_
history_ growth - Charge precompile gas for emitting a log, recording it as
HistoryGrowth. - charge_
l2_ calldata - Charge precompile gas for calldata processing (the framework
argsCostand any per-call copy fees on caller-supplied data), recording it asL2Calldata. The single-gas total is unchanged; only the resource breakdown is recorded. - charge_
params_ read - Charge the warm StylusParams read. The params slot is read frequently and
billed to
Computation, not as a storage read; centralized so every reader attributes it to the same resource. - charge_
precompile_ gas - charge_
storage_ read - Charge precompile gas for an ArbOS state read, recording it as
StorageAccessReadfor the v60 multi-dimensional pricing backlog (mirrors the reference, which dimensions every stateGetas a storage read). The single-gas total is unchanged; only the resource breakdown is recorded. - charge_
storage_ write - Charge precompile gas for an ArbOS state write, recording it as
StorageAccessWrite. Seecharge_storage_read. - compute_
l1_ gas_ for_ estimate - L1 gas estimate: brotli-compress a fake EIP-1559 tx, pad units by
(units + 256) * 1.01, multiply bypricePerUnit, pad posterCost by1.10, then divide bymax(basefee * 7/8, minBaseFee). - create_
arbaddresstable_ precompile - create_
arbaggregator_ precompile - create_
arbbls_ precompile - create_
arbdebug_ precompile - create_
arbfilteredtxmanager_ precompile - create_
arbfunctiontable_ precompile - create_
arbgasinfo_ precompile - create_
arbinfo_ precompile - create_
arbnativetokenmanager_ precompile - create_
arbosacts_ precompile - create_
arbostest_ precompile - create_
arbowner_ precompile - create_
arbownerpublic_ precompile - create_
arbretryabletx_ precompile - create_
arbstatistics_ precompile - create_
arbwasm_ precompile - create_
arbwasmcache_ precompile - create_
nodeinterface_ debug_ precompile - create_
nodeinterface_ precompile - decode_
estimate_ args - Decode
gasEstimateComponents(address,bool,bytes)calldata into(to, contractCreation, data). - init_
precompile_ gas - Initialize gas tracking for a precompile call: charge
argsCostasL2Calldataand theOpenArbosStateread (1 SLOAD = 800) asStorageAccessRead, mirroring the reference framework’s per-call dimensioned framework gas. - init_
precompile_ gas_ pure - Initialize gas tracking for a
pureprecompile method: likeinit_precompile_gasbut skips theOpenArbosStateSLOAD, matching the reference framework’s pure-method path which does not open ArbOS state. - redeem_
scheduled_ topic - register_
arb_ precompiles - Registers Arbitrum precompiles into
mapand applies the per-ArbOS-version adjustments to the standard Ethereum precompile set. - reject_
delegate_ nonpure - Reject a non-
puremethod invoked via DELEGATECALL, reverting and consuming all forwarded gas.is_delegateis true when acting as an address other than the precompile;purelists the stateless selectors. - reject_
nonpayable_ value - Reject call value sent to a non-payable method, reverting and consuming all
forwarded gas.
payablelists the selectors that may receive value. Call only once the precompile is active for the current ArbOS version. - reject_
static_ unless_ read - Like
reject_static_writebut for a mostly-writing precompile: under read-only, reject every method except the listed read-only (view/pure) selectors. - reject_
static_ write - Reject a state-modifying method invoked under STATICCALL, reverting and
consuming all forwarded gas.
writelists the state-modifying selectors. - sol_
error_ revert - Emit a pre-encoded Solidity custom-error payload (selector + ABI args)
as a revert. Adds the copy cost for the payload to the accumulated gas,
attributed to
Computationto mirror the reference framework’sresultCostburn. - ticket_
created_ topic