Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Unsupported Opcode PUSH0 in solidity 0.8.20 for deployment on Arbitrum Chain

Summary

The contract is set to be deployed on Arbitrum chain but the solidity version 0.8.20 has opcode PUSH0 which is not supported on Arbitrum, thus it cannot be deployed.

Vulnerability Details

Solc compiler version 0.8.20 switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not support PUSH0, otherwise deployment of your contracts will fail.

Impact

The impact of using the solidity version 0.8.20 is that it comes with the PUSH0 opcode and this opcode is not supported on Arbitrum causing the smart contract to malfunction and the contract may not execute correctly.

Tools Used

Aderyn

Recommendations

PUSH0 opcode comes with 0.8.20 and higher versions, therefore switching to 0.8.19 will make the smart contract fully compatible to be deployed on Arbitrum chain.

- pragma solidity 0.8.20;
+ pragma solidity 0.8.19;
Updates

Lead Judging Commences

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

PUSH0 not available on Arb

Support

FAQs

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