Skip to main content

Precompiles reference

ArbOS provides L2-specific precompiles with methods smart contracts can call the same way they can solidity functions. This reference page exhaustively documents the specific calls ArbOS makes available through precompiles. For a more conceptual description of what precompiles are and how they work, please refer to the precompiles conceptual page.

This reference page is divided into two sections. The first one lists all precompiles in a summary table with links to the reference of the specific precompile, along with the address where they live, their purpose and links to the go implementation and solidity interface. The second one details the methods available in each precompile with links to the specific implementation.

General information of precompiles

This section is divided into two tables. We first list precompiles we expect users to most often use, and then the rest of precompiles. However, both tables display the same information: name and purpose of the precompile, address, and links to the solidity interface and the go implementation.

Common precompiles

PrecompileAddressSolidity interfaceGo implementationPurpose
ArbAggregator0x6dInterfaceImplementationConfiguring transaction aggregation
ArbGasInfo0x6cInterfaceImplementationInfo about gas pricing
ArbRetryableTx0x6eInterfaceImplementationManaging retryables
ArbSys0x64InterfaceImplementationSystem-level functionality

Other precompiles

PrecompileAddressSolidity interfaceGo implementationPurpose
ArbAddressTable0x66InterfaceImplementationSupporting compression of addresses
ArbBLS0x67--Disabled (Former registry of BLS public keys)
ArbDebug0xffInterfaceImplementationTesting tools
ArbFunctionTable0x68InterfaceImplementationNo longer used
ArbInfo0x65InterfaceImplementationInfo about accounts
ArbOwner0x70InterfaceImplementationChain administration, callable only by chain owner
ArbOwnerPublic0x6bInterfaceImplementationInfo about chain owners
ArbosTest0x69InterfaceImplementationNo longer used
ArbStatistics0x6fInterfaceImplementationInfo about the pre-Nitro state

Precompiles reference

ArbAddressTable

ArbAddressTable (Interface | Implementation) provides the ability to create short-hands for commonly used accounts.

MethodSolidity interfaceGo implementationDescription
addressExists(address addr)InterfaceImplementationAddressExists checks if an address exists in the table
compress(address addr)InterfaceImplementationCompress and returns the bytes that represent the address
decompress(bytes calldata buf, uint256 offset)InterfaceImplementationDecompress the compressed bytes at the given offset with those of the corresponding account
lookup(address addr)InterfaceImplementationLookup the index of an address in the table
lookupIndex(uint256 index)InterfaceImplementationLookupIndex for an address in the table by index
register(address addr)InterfaceImplementationRegister adds an account to the table, shrinking its compressed representation
size()InterfaceImplementationSize gets the number of addresses in the table

ArbAggregator

ArbAggregator (Interface | Implementation) provides aggregators and their users methods for configuring how they participate in L1 aggregation. Arbitrum One's default aggregator is the Sequencer, which a user will prefer unless SetPreferredAggregator is invoked to change it.

Compression ratios are measured in basis points. Methods that are checkmarked are access-controlled and will revert if not called by the aggregator, its fee collector, or a chain owner.

MethodSolidity interfaceGo implementationDescription
⚠️getPreferredAggregator(address addr)InterfaceImplementationDeprecated: Do not use this method.
⚠️getDefaultAggregator()InterfaceImplementationDeprecated: Do not use this method.
getBatchPosters()InterfaceImplementationGetBatchPosters gets the addresses of all current batch posters
addBatchPoster(address newBatchPoster)InterfaceImplementationAdds newBatchPoster as a batch poster
getFeeCollector(address batchPoster)InterfaceImplementationGetFeeCollector gets a batch poster's fee collector
setFeeCollector(address batchPoster, address newFeeCollector)InterfaceImplementationSetFeeCollector sets a batch poster's fee collector (caller must be the batch poster, its fee collector, or an owner)
⚠️getTxBaseFee(address aggregator)InterfaceImplementationDeprecated: returns 0
⚠️setTxBaseFee(address aggregator, uint256 feeInL1Gas)InterfaceImplementationDeprecated: does nothing

Note: methods marked with ⚠️ are deprecated and their use is not supported.

ArbBLS

Disabled

This precompile has been disabled. It previously provided a registry of BLS public keys for accounts.

ArbDebug

ArbDebug (Interface | Implementation) provides mechanisms useful for testing. The methods of ArbDebug are only available for chains with the AllowDebugPrecompiles chain parameter set. Otherwise, calls to this precompile will revert.

MethodSolidity interfaceGo implementationDescription
becomeChainOwner()InterfaceImplementationCaller becomes a chain owner
events(bool flag, bytes32 value)InterfaceImplementationEmit events with values based on the args provided
eventsView()InterfaceImplementationTries (and fails) to emit logs in a view context
customRevert(uint64 number)InterfaceImplementationThrows a custom error
legacyError()InterfaceImplementationThrows a hardcoded error
EventSolidity interfaceGo implementationDescription
BasicInterfaceImplementationEmitted in Events for testing
MixedInterfaceImplementationEmitted in Events for testing
StoreInterfaceImplementationNever emitted (used for testing log sizes)

ArbFunctionTable

ArbFunctionTable (Interface | Implementation) provides aggregators the ability to manage function tables, to enable one form of transaction compression. The Nitro aggregator implementation does not use these, so these methods have been stubbed and their effects disabled. They are kept for backwards compatibility.

MethodSolidity interfaceGo implementationDescription
upload(bytes calldata buf)InterfaceImplementationUpload does nothing
size(address addr)InterfaceImplementationSize returns the empty table's size, which is 0
get(address addr, uint256 index)InterfaceImplementationGet reverts since the table is empty

ArbGasInfo

ArbGasInfo (Interface | Implementation) provides insight into the cost of using the chain. These methods have been adjusted to account for Nitro's heavy use of calldata compression. Of note to end-users, we no longer make a distinction between non-zero and zero-valued calldata bytes.

MethodSolidity interfaceGo implementationDescription
getPricesInWeiWithAggregator(address aggregator)InterfaceImplementationGetPricesInWeiWithAggregator gets prices in wei when using the provided aggregator
getPricesInWei()InterfaceImplementationGetPricesInWei gets prices in wei when using the caller's preferred aggregator
getPricesInArbGasWithAggregator(address aggregator)InterfaceImplementationGetPricesInArbGasWithAggregator gets prices in ArbGas when using the provided aggregator
getPricesInArbGas()InterfaceImplementationGetPricesInArbGas gets prices in ArbGas when using the caller's preferred aggregator
getGasAccountingParams()InterfaceImplementationGetGasAccountingParams gets the rollup's speed limit, pool size, and tx gas limit
getMinimumGasPrice()InterfaceImplementationGetMinimumGasPrice gets the minimum gas price needed for a transaction to succeed
getL1BaseFeeEstimate()InterfaceImplementationGetL1BaseFeeEstimate gets the current estimate of the L1 basefee
getL1BaseFeeEstimateInertia()InterfaceImplementationGetL1BaseFeeEstimateInertia gets how slowly ArbOS updates its estimate of the L1 basefee
getL1GasPriceEstimate()InterfaceImplementationGetL1GasPriceEstimate gets the current estimate of the L1 basefee
getCurrentTxL1GasFees()InterfaceImplementationGetCurrentTxL1GasFees gets the fee paid to the aggregator for posting this tx
getGasBacklog()InterfaceImplementationGetGasBacklog gets the backlogged amount of gas burnt in excess of the speed limit
getPricingInertia()InterfaceImplementationGetPricingInertia gets the L2 basefee in response to backlogged gas
getGasBacklogTolerance()InterfaceImplementationGetGasBacklogTolerance gets the forgivable amount of backlogged gas ArbOS will ignore when raising the basefee
getL1PricingSurplus()InterfaceImplementationReturns the surplus of funds for L1 batch posting payments (may be negative)
getPerBatchGasCharge()InterfaceImplementationReturns the base charge (in L1 gas) attributed to each data batch in the calldata pricer
getAmortizedCostCapBips()InterfaceImplementationReturns the cost amortization cap in basis points
getL1FeesAvailable()InterfaceImplementationReturns the available funds from L1 fees

ArbInfo

ArbInfo (Interface | Implementation) provides the ability to lookup basic info about accounts and contracts.

MethodSolidity interfaceGo implementationDescription
getBalance(address account)InterfaceImplementationGetBalance retrieves an account's balance
getCode(address account)InterfaceImplementationGetCode retrieves a contract's deployed code

ArbosTest

ArbosTest (Interface | Implementation) provides a method of burning arbitrary amounts of gas, which exists for historical reasons. In Classic, ArbosTest had additional methods only the zero address could call. These have been removed since users don't use them and calls to missing methods revert.

MethodSolidity interfaceGo implementationDescription
burnArbGas(uint256 gasAmount)InterfaceImplementationBurnArbGas unproductively burns the amount of L2 ArbGas

ArbOwner

ArbOwner (Interface | Implementation) provides owners with tools for managing the rollup. Calls by non-owners will always revert.

Most of Arbitrum Classic's owner methods have been removed since they no longer make sense in Nitro:

  • What were once chain parameters are now parts of ArbOS's state, and those that remain are set at genesis.
  • ArbOS upgrades happen with the rest of the system rather than being independent
  • Exemptions to address aliasing are no longer offered. Exemptions were intended to support backward compatibility for contracts deployed before aliasing was introduced, but no exemptions were ever requested.
MethodSolidity interfaceGo implementationDescription
addChainOwner(address newOwner)InterfaceImplementationAddChainOwner adds account as a chain owner
removeChainOwner(address ownerToRemove)InterfaceImplementationRemoveChainOwner removes account from the list of chain owners
isChainOwner(address addr)InterfaceImplementationIsChainOwner checks if the account is a chain owner
getAllChainOwners()InterfaceImplementationGetAllChainOwners retrieves the list of chain owners
setL1BaseFeeEstimateInertia(uint64 inertia)InterfaceImplementationSetL1BaseFeeEstimateInertia sets how slowly ArbOS updates its estimate of the L1 basefee
setL2BaseFee(uint256 priceInWei)InterfaceImplementationSetL2BaseFee sets the L2 gas price directly, bypassing the pool calculus
setMinimumL2BaseFee(uint256 priceInWei)InterfaceImplementationSetMinimumL2BaseFee sets the minimum base fee needed for a transaction to succeed
setSpeedLimit(uint64 limit)InterfaceImplementationSetSpeedLimit sets the computational speed limit for the chain
setMaxTxGasLimit(uint64 limit)InterfaceImplementationSetMaxTxGasLimit sets the maximum size a tx (and block) can be
setL2GasPricingInertia(uint64 sec)InterfaceImplementationSetL2GasPricingInertia sets the L2 gas pricing inertia
setL2GasBacklogTolerance(uint64 sec)InterfaceImplementationSetL2GasBacklogTolerance sets the L2 gas backlog tolerance
getNetworkFeeAccount()InterfaceImplementationGetNetworkFeeAccount gets the network fee collector
getInfraFeeAccount()InterfaceImplementationGetInfraFeeAccount gets the infrastructure fee collector
setNetworkFeeAccount(address newNetworkFeeAccount)InterfaceImplementationSetNetworkFeeAccount sets the network fee collector to the new network fee account
setInfraFeeAccount(address newInfraFeeAccount)InterfaceImplementationSetInfraFeeAccount sets the infra fee collector to the new network fee account
scheduleArbOSUpgrade(uint64 newVersion, uint64 timestamp)InterfaceImplementationScheduleArbOSUpgrade to the requested version at the requested timestamp
setL1PricingEquilibrationUnits(uint256 equilibrationUnits)InterfaceImplementationSets equilibration units parameter for L1 price adjustment algorithm
setL1PricingInertia(uint64 inertia)InterfaceImplementationSets inertia parameter for L1 price adjustment algorithm
setL1PricingRewardRecipient(address recipient)InterfaceImplementationSets reward recipient address for L1 price adjustment algorithm
setL1PricingRewardRate(uint64 weiPerUnit)InterfaceImplementationSets reward amount for L1 price adjustment algorithm, in wei per unit
setL1PricePerUnit(uint256 pricePerUnit)InterfaceImplementationSet how much ArbOS charges per L1 gas spent on transaction data.
setPerBatchGasCharge(int64 cost)InterfaceImplementationSets the base charge (in L1 gas) attributed to each data batch in the calldata pricer
setAmortizedCostCapBips(uint64 cap)InterfaceImplementationSets the cost amortization cap in basis points
releaseL1PricerSurplusFunds(uint256 maxWeiToRelease)InterfaceImplementationReleases surplus funds from L1PricerFundsPoolAddress for use
EventSolidity interfaceGo implementationDescription
OwnerActsInterfaceImplementationEmitted when a successful call is made to this precompile

ArbOwnerPublic

ArbOwnerPublic (Interface | Implementation) provides non-owners with info about the current chain owners.

MethodSolidity interfaceGo implementationDescription
isChainOwner(address addr)InterfaceImplementationIsChainOwner checks if the user is a chain owner
getAllChainOwners()InterfaceImplementationGetAllChainOwners retrieves the list of chain owners
getNetworkFeeAccount()InterfaceImplementationGetNetworkFeeAccount gets the network fee collector
getInfraFeeAccount()InterfaceImplementationGetInfraFeeAccount gets the infrastructure fee collector

ArbRetryableTx

ArbRetryableTx (Interface | Implementation) provides methods for managing retryables. The model has been adjusted for Nitro, most notably in terms of how retry transactions are scheduled. For more information on retryables, please see the retryable documentation.

MethodSolidity interfaceGo implementationDescription
redeem(bytes32 ticketId)InterfaceImplementationRedeem schedules an attempt to redeem the retryable, donating all of the call's gas to the redeem attempt
getLifetime()InterfaceImplementationGetLifetime gets the default lifetime period a retryable has at creation
getTimeout(bytes32 ticketId)InterfaceImplementationGetTimeout gets the timestamp for when ticket will expire
keepalive(bytes32 ticketId)InterfaceImplementationKeepalive adds one lifetime period to the ticket's expiry
getBeneficiary(bytes32 ticketId)InterfaceImplementationGetBeneficiary gets the beneficiary of the ticket
cancel(bytes32 ticketId)InterfaceImplementationCancel the ticket and refund its callvalue to its beneficiary
getCurrentRedeemer()InterfaceImplementationGets the redeemer of the current retryable redeem attempt
submitRetryable()InterfaceImplementationDo not call. This method represents a retryable submission to aid explorers. Calling it will always revert.
EventSolidity interfaceGo implementationDescription
TicketCreatedInterfaceImplementationEmitted when creating a retryable
LifetimeExtendedInterfaceImplementationEmitted when extending a retryable's expiry date
RedeemScheduledInterfaceImplementationEmitted when scheduling a retryable
CanceledInterfaceImplementationEmitted when cancelling a retryable
RedeemedInterfaceImplementationDEPRECATED in favour of new RedeemScheduled event after the nitro upgrade.

ArbStatistics

ArbStatistics (Interface | Implementation) provides statistics about the chain as of just before the Nitro upgrade. In Arbitrum Classic, this was how a user would get info such as the total number of accounts, but there are better ways to get that info in Nitro.

MethodSolidity interfaceGo implementationDescription
getStats()InterfaceImplementationGetStats returns the current block number and some statistics about the rollup's pre-Nitro state

ArbSys

ArbSys (Interface | Implementation) provides system-level functionality for interacting with L1 and understanding the call stack.

MethodSolidity interfaceGo implementationDescription
arbBlockNumber()InterfaceImplementationArbBlockNumber gets the current L2 block number
arbBlockHash(uint256 arbBlockNum)InterfaceImplementationArbBlockHash gets the L2 block hash, if sufficiently recent
arbChainID()InterfaceImplementationArbChainID gets the rollup's unique chain identifier
arbOSVersion()InterfaceImplementationArbOSVersion gets the current ArbOS version
getStorageGasAvailable()InterfaceImplementationGetStorageGasAvailable returns 0 since Nitro has no concept of storage gas
isTopLevelCall()InterfaceImplementationIsTopLevelCall checks if the call is top-level (deprecated)
mapL1SenderContractAddressToL2Alias(address sender, address unused)InterfaceImplementationMapL1SenderContractAddressToL2Alias gets the contract's L2 alias
wasMyCallersAddressAliased()InterfaceImplementationWasMyCallersAddressAliased checks if the caller's caller was aliased
myCallersAddressWithoutAliasing()InterfaceImplementationMyCallersAddressWithoutAliasing gets the caller's caller without any potential aliasing
withdrawEth(address destination)InterfaceImplementationWithdrawEth send paid eth to the destination on L1
sendTxToL1(address destination, bytes calldata data)InterfaceImplementationSendTxToL1 sends a transaction to L1, adding it to the outbox
sendMerkleTreeState()InterfaceImplementationSendMerkleTreeState gets the root, size, and partials of the outbox Merkle tree state (caller must be the 0 address)
EventSolidity interfaceGo implementationDescription
L2ToL1TxInterfaceImplementationLogs a send transaction from L2 to L1, including data for outbox proving
L2ToL1TransactionInterfaceImplementationDEPRECATED in favour of the new L2ToL1Tx event above after the nitro upgrade
SendMerkleUpdateInterfaceImplementationLogs a new merkle branch needed for constructing outbox proofs