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::create_arbsys_precompile;pub use arbsys::get_cached_l1_block_number;pub use arbsys::get_current_l2_block;pub use arbsys::get_tx_is_aliased;pub use arbsys::set_cached_l1_block_number;pub use arbsys::set_current_l2_block;pub use arbsys::set_tx_is_aliased;pub use arbsys::store_arbsys_state;pub use arbsys::take_arbsys_state;pub use arbsys::ArbSysMerkleState;pub use arbsys::ARBSYS_ADDRESS;pub use storage_slot::ARBOS_STATE_ADDRESS;
Modules§
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§
- allow_
debug_ precompiles - 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).
- caller_
at_ depth - msg.sender of the frame at
depth(1-indexed).Noneoutside range. - charge_
precompile_ gas - clear_
tx_ scratch - 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). - emit_
log - get_
arbos_ version - Get the current ArbOS version.
- get_
block_ timestamp - Get the current block timestamp.
- get_
current_ gas_ backlog - Get the current gas backlog value.
- get_
current_ redeemer - get_
current_ retryable_ id - get_
current_ tx_ poster_ fee - Get the current tx poster fee.
- get_
current_ tx_ sender - Get the current tx sender.
- get_
evm_ depth - Get the current EVM call depth.
- get_
l1_ block_ number_ for_ evm - Get the L1 block number for the NUMBER opcode.
- get_
l2_ block_ hash - Get an L2 block hash from the arbBlockHash cache.
- get_
poster_ balance_ correction - Get the poster balance correction.
- get_
precompile_ gas - init_
precompile_ gas - Initialize gas tracking for a precompile call: reset accumulator, charge argsCost (CopyGas * input words) and OpenArbosState (1 SLOAD = 800).
- insert_
recent_ wasm - Insert a Stylus program codehash into the recent WASMs cache.
Returns
trueif the codehash was already present (cache hit). - pop_
caller_ frame - push_
caller_ frame - redeem_
scheduled_ topic - register_
arb_ precompiles - Registers Arbitrum precompiles into
mapand applies the per-ArbOS-version adjustments to the standard Ethereum precompile set. - reset_
caller_ stack - reset_
precompile_ gas - reset_
recent_ wasms - Reset the recent WASMs cache for a new block, with the given capacity.
- set_
allow_ debug_ precompiles - Set whether ArbDebug / ArbosTest debug precompiles are callable. Driven
by the chain spec’s
AllowDebugPrecompilesflag. - set_
arbos_ version - Set the current ArbOS version for precompile version gating.
- set_
block_ timestamp - Set the current block timestamp for precompile queries.
- set_
current_ gas_ backlog - Set the current gas backlog value for the Redeem precompile.
- set_
current_ redeemer - set_
current_ retryable_ id - set_
current_ tx_ poster_ fee - Set the current tx poster fee for ArbGasInfo.getCurrentTxL1GasFees.
- set_
current_ tx_ sender - Set the current tx sender for BALANCE correction.
- set_
evm_ depth - Set the EVM call depth to a specific value. Called by the precompile provider which reads the depth from revm’s journal.
- set_
l1_ block_ number_ for_ evm - Set the L1 block number for the NUMBER opcode.
- set_
l2_ block_ hash - Set an L2 block hash in the arbBlockHash cache.
- set_
poster_ balance_ correction - Set the poster balance correction for BALANCE opcode adjustment.
- set_
stylus_ activation_ data_ fee - set_
stylus_ activation_ request - set_
stylus_ keepalive_ request - 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.
- take_
pending_ precompile_ logs - take_
stylus_ activation_ data_ fee - take_
stylus_ activation_ request - take_
stylus_ keepalive_ request - ticket_
created_ topic