sherlock-audit / 2023-05-ironbank-judging

2 stars 2 forks source link

0x52 - Pragma isn't specified correctly which can lead to nonfunction/damaged contract when deployed on Arbitrum #362

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

0x52

medium

Pragma isn't specified correctly which can lead to nonfunction/damaged contract when deployed on Arbitrum

Summary

Pragma has been set to ^0.8.0 allowing the contracts to be compiled with any 0.8.x compiler. The problem with this is that Arbitrum is NOT compatible with 0.8.20 and newer. Contracts compiled with those versions will result in a nonfunctional or potentially damaged version that won't behave as expected. The default behavior of compiler would be to use the newest version which would mean by defualt it will be compiled with the 0.8.20 version which will produce broken code.

Vulnerability Detail

See summary

Impact

Damaged or nonfunctional contracts when deployed on Arbitrum

Code Snippet

TxBuilderExtension.sol#L3

Tool used

Manual Review

Recommendation

Constrain pragma as follows:

pragma solidity >=0.8.0 <=0.8.19
ibsunhub commented 1 year ago

In foundry.toml, we specify the solc version to be 0.8.10.

0xffff11 commented 1 year ago

Yes, agree with sponsor, invalid. Even if it would not be specified, I would still think suits more as a low