Crate arb_precompiles

Crate arb_precompiles 

Source
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 storage_slot::ARBOS_STATE_ADDRESS;

Modules§

storage_slot

Structs§

ArbSysMerkleState
State changes from an ArbSys call for post-execution application.

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).
ARBOWNERPUBLIC_ADDRESS
ArbOwnerPublic precompile address (0x6b).
ARBOWNER_ADDRESS
ArbOwner precompile address (0x70).
ARBRETRYABLETX_ADDRESS
ArbRetryableTx precompile address (0x6e).
ARBSTATISTICS_ADDRESS
ArbStatistics precompile address (0x6f).
ARBSYS_ADDRESS
ArbSys precompile address (0x64).
ARBWASMCACHE_ADDRESS
ArbWasmCache precompile address (0x72).
ARBWASM_ADDRESS
ArbWasm precompile address (0x71).
NODE_INTERFACE_ADDRESS
NodeInterface virtual contract address (0xc8).

Functions§

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_arbowner_precompile
create_arbownerpublic_precompile
create_arbretryabletx_precompile
create_arbstatistics_precompile
create_arbsys_precompile
create_arbwasm_precompile
create_arbwasmcache_precompile
create_nodeinterface_precompile
get_arbos_version
Get the current ArbOS version.
get_block_timestamp
Get the current block timestamp.
get_cached_l1_block_number
Get the cached L1 block number for a given L2 block.
get_current_gas_backlog
Get the current gas backlog value.
get_current_l2_block
Get the current L2 block number.
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_tx_is_aliased
Check whether the current transaction uses address aliasing.
redeem_scheduled_topic
RedeemScheduled event topic0. keccak256(“RedeemScheduled(bytes32,bytes32,uint64,uint64,address,uint256,uint256)”)
register_arb_precompiles
Register all Arbitrum precompiles into a [PrecompilesMap].
set_arbos_version
Set the current ArbOS version for precompile version gating.
set_block_timestamp
Set the current block timestamp for precompile queries.
set_cached_l1_block_number
Set the cached L1 block number for a given L2 block.
set_current_gas_backlog
Set the current gas backlog value for the Redeem precompile.
set_current_l2_block
Set the current L2 block number for precompile use. In Arbitrum, block_env.number holds the L1 block number (for the NUMBER opcode), so precompiles that need the L2 block number read it from here.
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_tx_is_aliased
Mark the current transaction as an aliased L1→L2 type.
store_arbsys_state
Store ArbSys state changes for post-execution application.
take_arbsys_state
Take the stored ArbSys state (clears it).
ticket_created_topic
Backlog update cost: read + write. Write cost depends on whether the new value is zero (StorageClearCost=5000) or non-zero (StorageWriteCost=20000). This is computed dynamically in handle_redeem based on current backlog.