Solidity version 0.8.20 may not work on other chains due to PUSH0
#584
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-c
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/ArbitrumBranchBridgeAgent.sol#L2
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/ArbitrumBranchPort.sol#L3
https://github.com/code-423n4/2023-05-maia/blob/main/src/ulysses-omnichain/ArbitrumCoreBranchRouter.sol#L2
Vulnerability details
Impact
The compiler for Solidity 0.8.20 switches the default target EVM version to Shanghai, which includes the new
PUSH0
opcode. This opcode is not yet implemented on some L2s including Arbitrum, meaning contracts deployed on those chains will be non-functional (see proof of concept section). Many in scope contracts use a floating pragma (^0.8.0), which may result in compiler version 0.8.20 being used for deployment to Arbitrum.Although this is fairly unlikely, the impact is high as the contracts would be completely unusable and funds could be sent to those addresses by unaware users, which would be irretrievable.
Proof of Concept
Relevant issue from solidity github:
Recommended Mitigation Steps
Ensure pragma does not include Solidity version 0.8.20 for contracts that will be deployed to other chains, for example like so:
Assessed type
Other
The text was updated successfully, but these errors were encountered: