Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

Incompatibility of Solidity 0.8.23 with Arbitrum: Deployment Failures Due to Unsupported PUSH0 Opcode

Summary

According to the documentation, the contract is intended to be deployed on the Arbitrum network using version 0.8.23.

## Compatibilities
- Solc Version: 0.8.23
- Chain(s) to deploy contract to:
-- Arbitrum
- Tokens
-- None

The Solidity files use pragma solidity 0.8.23;, which, when compiled, utilizes the opcode PUSH0. This opcode is not supported on the Arbitrum network.

https://docs.arbitrum.io/for-devs/concepts/differences-between-arbitrum-ethereum/solidity-support

Vulnerability Details

SOLIDITY 0.8.23

The following POC demonstrates the deployment issue using 0.8.23.

Use the Arbitrum testnet by claiming free Arbitrum Sepolia ETH on Alchemy and use their RPC for testing this POC. We will also use a fork to avoid spending testnet ETH.

Setup a fork:

anvil --fork-url 'https://arb-sepolia.g.alchemy.com/v2/<API_KEY>' --gas-limit 100000000000
forge create ./src/VotingBooth.sol:VotingBooth --constructor-args "[$ADDRESS LIST]" --private-key $TEST_NET_SECU_PUB --rpc-url http://127.0.0.1:8545 --value 1000000000000000000
[⠢] Compiling...
No files changed, compilation skipped
Error:
(code: -32000, message: intrinsic gas too high -- CallGasCostMoreThanGasLimit, data: None)

As observed, the deployment fails. To confirm it's related to Arbitrum, let's test on the Ethereum Sepolia network.

Deploy on ETH Sepolia testnet

Setup a fork

anvil --fork-url 'https://eth-sepolia.g.alchemy.com/v2/<API_KEY>' --gas-limit 100000000000
forge create ./src/VotingBooth.sol:VotingBooth --constructor-args "[$ADDRESS LIST]" --private-key $TEST_NET_SECU_PUB --rpc-url http://127.0.0.1:8545 --value 1000000000000000000
[⠆] Compiling...
No files changed, compilation skipped
Deployer: ***
Deployed to: 0x37A9115fdaBfD1fE0B426b78132582B51840f2d0
Transaction hash: 0x0b37abd75d4fbf3f268a269eafdac6eccfd92c541bf83d6b863859d181e93808

Impact

The impact is high for the following reasons:

Deployment Failure: This issue directly prevents the deployment of the contract on the Arbitrum network using Solidity 0.8.23, which is a significant obstacle for the project planning to deploy on Arbitrum.

Requirement of Version Downgrade: The need to downgrade the Solidity version to avoid this issue necessitates additional work, including re-auditing the contract. This adds time, cost, and complexity to the development process.

Potential for Unnoticed Deployment Issues: Developers might not immediately recognize this incompatibility, leading to wasted resources and potentially delayed project timelines.

Tools Used

Manual review and official documentation

https://docs.arbitrum.io/for-devs/concepts/differences-between-arbitrum-ethereum/solidity-support

Recommendations

Downgrade the contract's pragma version and test the implementation to ensure it works after the downgrade.

Always test your contract on a testnet before releasing it to ensure full functionality as expected.

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

PUSH0 not supported for solidity solidity ^0.8.20

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.