We continue our series of educational articles and today we’ll look at some professional tips in the auditing smart contracts on Arbitrum blockchain.
Everything you see below is based on our personal experience!
And today, dear readers, it will be made available to you! We also encourage you to read our earlier article, which contains a wealth of auditors’ and developers’ useful advice:
First and foremost, we would like to express our sincere gratitude to the creators of Arbitrum and its ecosystem projects, everyone who supports it, the Authors of all the resource materials, and of course our brilliant auditors who have helped us by revealing much-needed information and lifting the curtain of secrecy!
We can confidently say that such tips can be read publicly in a few places, and our blog is one of those places. The following will be our observations — only dry facts for auditors, tricks and the best life-hacks shared by our best auditors.
Essentially speaking, Arbitrum is a Layer 2 network on top of Ethereum mainnet, with much faster and cheaper transactions. It was created by Offchain Labs. The company raised $120 million in a Series B funding round in September 2021.
Here are some statistics:
Arbitrum average block time: ~0.26s;
Ethereum average block time: ~12.1s;
Arbitrum average transaction cost: $0.2–0.3.
The Ethereum Virtual Machine (EVM) is also supported by Arbitrum, allowing Ethereum DeFi developers to integrate their decentralized applications (dapps) with Arbitrum with almost no modifications required!
Please review the following framework, which is recommended by our team, in order to better understand what we will discuss next and to more clearly differentiate L2 from L1:
Let’s analyze why Arbitrum achieves such results!
Arbitrum relies on the Optimistic Rollup technology (used to scale Ethereum). A bundle of transactions from L2 (Arbitrum) is formed into a batch and sent to L1 (Ethereum), where it is then approved by validators.
Currently, both Arbitrum and Optimism operate with a single centralized Sequencer that is in charge of ordering all the transactions it receives and is assumed to work honestly in a first-come, first-serve manner. With it, there are plans to decentralize the sequencing role with whitelisted or community-voted L2 nodes:
The volume of gas per transaction in Arbitrum consists of two components:
Paid to cover the future batches on L1. It is the majority of the commission and depends on the calldata size of the transaction and the calldata value in L1.
At the time of the transaction, you can only estimate its approximate ratio to the size of the future batches. In other words, the L1 component is meant to compensate the Sequencer for the cost of posting transactions on L1 (but no more). (See L1 Pricing.)
Works similarly to commissions in Ethereum Mainnet — it is a transaction execution fee on L2. The L2 component covers the cost of operating the L2 chain; it uses Geth for gas calculation and thus behaves nearly identically to L1 Ethereum.
One difference is that unlike on Ethereum, Arbitrum chains enforce a gas price floor, currently 0.1 gwei on Arbitrum One and 0.01 gwei on Nova (See Gas). L2 Gas price adjusts responsively to chain congestion, ala EIP 1559. See 2-D fees for more information on this topic!
Because the main obstacles that the auditor may have while auditing projects on Arbitrum are logical, the first suggestion for any firm will be in competent development, which results in solid documentation and reliable tests.
It sounds too simple to be true, but be sure it works and it only proves itself over time!
We will not go into detail in this article because we assume you, dear reader, already have a sufficient understanding of the Arbitrum ecosystem, so we strongly advise you to visit their knowledge-base and study the project documentation for a better understanding:
In the Arbitrum network, block.number will return the approximate number in L1 at the time the sequencer receives the L2 transaction. To get the L2 block number (L2 has its own block numbers), you need to use ArbSys.arbBlockNumber()
block.timestamp is similar in behavior to L1, but two different blocks in L2 can have the same block.timestamp, unlike in L1. For details, see Block Numbers and Time.
Since the PUSH0 opcode is not yet supported, when using the 0.8.20 compiler and above you need to use an EVM version lower in block than the Shanghai update. Compilers starting from 0.8.19 and below are fully supported.
Arbitrum chains include a number of special precompiles not present on Ethereum; see Common Precompiles / All Precompiles. Of particular note is the ArbAddressTable, which allows contracts to map addresses to integers, saving calldata / fees for addresses expected to be reused as parameters; see Arb Address Table tutorial for example usage.
…And a few other minor differences! We will provide even more details in subsequent articles, but for now, let’s continue with our initial evaluation.
Another challenge that Arbitrum has faced is network congestion, which has resulted in delayed transaction processing times and higher gas fees. This issue is not unique to Arbitrum, as it is a common problem for many Layer 2 scaling solutions that rely on Ethereum’s network to function.
Since Arbitrum’s system is currently run by a centralized team of developers, there have also been some worries about its centralization. Even though this isn’t necessarily a problem in and of itself, some people are worried about the possibility of censorship or other types of network control.
Despite these challenges, Arbitrum has continued to gain traction as a scaling solution for Ethereum, and its developers are actively working to address these issues and improve the network’s performance and usability!
We hope that this article was informative and useful for you! Thank you for reading! What instruments should we review? What would you be interested in reading about in our blog?
If you still have questions, please feel free to ask! We will be happy to answer every question you have! The best answers and questions may be included in the next blog post!