ArbOS provides L2-specific precompiles with methods smart contracts can call the same way they can solidity functions. This reference exhaustively documents the specific calls ArbOS makes available. For more details on the infrastructure that makes this possible, please refer to the ArbOS documentation. For an abbreviated reference on the precompiles we expect users to most often use, please see the common precompiles documentation.
From the perspective of user applications, precompiles live as contracts at the following addresses. Click on any to jump to their section.
Provides the ability to create short-hands for commonly used accounts.
Methods |
|
AddressExists (address) |
Checks if an address exists in the table |
Compress (address) |
Gets bytes that represent the address |
Decompress (buffer, offset) |
Replaces the compressed bytes at the given offset with those of the corresponding account |
Lookup (address) |
Gets the index of an address in the table |
LookupIndex (index) |
Gets the address at an index in the table |
Register (address) |
Adds an address to the table, shrinking its compressed representation |
Size () |
Gets the number of addresses in the table |
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.
Provides a registry of BLS public keys for accounts.
Methods |
|
RegisterAltBN128 (x0, x1, y0, y1) |
Associate an AltBN128 public key with the caller's address |
GetAltBN128 (account) |
Gets the AltBN128 public key associated with an address |
RegisterBLS12381 (key) |
Associate a BLS 12-381 public key with the caller's address |
GetBLS12381 (account) |
Gets the BLS 12-381 public key associated with an address |
Deprecated Methods |
|
Register (x0, x1, y0, y1) |
equivalent to registerAltBN128 |
GetPublicKey (account) |
equivalent to getAltBN128 |
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.
Methods |
|
BecomeChainOwner () |
Caller becomes a chain owner |
Events (flag, value) |
Emit events with values based on the args provided |
Events |
|
Basic |
Emitted in Events for testing |
Mixed |
Emitted in Events for testing |
Store |
Never emitted (used for testing log sizes) |
Provided aggregator's 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.
Methods |
|
Get (address, index) |
Reverts since the table is empty |
Size (address) |
Returns the empty table's size, which is 0 |
Upload (bytes) |
Does nothing |
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.
Provides the ability to lookup basic info about accounts and contracts.
Methods |
|
GetBalance (account) |
Retrieves an account's balance |
GetCode (account) |
Retrieves a contract's deployed code |
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.
Methods |
|
Nitro changes |
BurnArbGas (amount) |
unproductively burns the amount of L2 ArbGas |
Now pure |
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.
Events |
|
OwnerActs |
Emitted when a successful call is made to this precompile |
Provides non-owners with info about the current chain owners.
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.
Methods |
|
Nitro changes |
Cancel (ticket) |
Cancel the ticket and refund its callvalue to its beneficiary |
|
GetBeneficiary (ticket) |
Gets the beneficiary of the ticket |
|
GetLifetime () |
Gets the default lifetime period a retryable has at creation |
Reverts when not found |
GetTimeout (ticket) |
Gets the timestamp for when ticket will expire |
|
Keepalive (ticket) |
Adds one lifetime period to the ticket's expiry |
Doesn't add callvalue |
Redeem (ticket) |
Schedule an attempt to redeem the retryable, donating all of the call's gas |
Happens in a future tx |
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.
Methods |
|
GetStats () |
Returns the current block number and some statistics about the rollup's pre-Nitro state |
Provides system-level functionality for interacting with L1 and understanding the call stack.
Methods |
|
Nitro changes |
ArbBlockNumber () |
Gets the current L2 block number |
|
ArbBlockHash (blocknum) |
Gets the L2 block hash at blocknum, if blocknum is sufficiently recent |
|
ArbChainID () |
Gets the chain's ChainID |
|
ArbOSVersion () |
Gets the current ArbOS version |
Now view |
GetStorageGasAvailable () |
Returns 0 since Nitro has no concept of storage gas |
Now always 0 |
IsTopLevelCall () |
Checks if the caller is top-level (i.e. if the caller was called directly by an EOA or an L1 contract) |
|
MapL1SenderContractAddressToL2Alias (contract, unused) |
Gets contract's L2 alias |
2nd arg is unused |
WasMyCallersAddressAliased () |
Checks if the caller's caller was aliased |
|
MyCallersAddressWithoutAliasing () |
Gets the caller's caller without any potential address aliasing |
New outbox scheme |
SendTxToL1 (destination, calldataForL1) |
Sends a transaction to L1, adding it to the outbox; callvalue is sent to L1 attached to the sent transaction |
New outbox scheme |
SendMerkleTreeState () |
Gets the root, size, and partials of the outbox Merkle tree state |
New outbox scheme |
WithdrawEth (destination) |
Send callvalue to the destination address on L1 |
|
Events |
|
L2ToL1Transaction |
Logs a send tx from L2 to L1, including data for outbox proving |
SendMerkleUpdate |
Logs a new merkle branch needed for constructing outbox proofs |
Removed Methods |
|
GetStorageAt (account, index) |
Nitro doesn't need this introspection, and users couldn't call it |
GetTransactionCount (account) |
Nitro doesn't need this introspection, and users couldn't call it |