Skip to content

feat(cast): add ability to specify --solc-version for manually defining version to compile with #9939

Open
@maxweisspoker

Description

@maxweisspoker

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

cast Version: 1.0.0-nightly Commit SHA: c609884 Build Timestamp: 2025-02-23T00:22:54.429897389Z (1740270174) Build Profile: maxperf

What version of Foundryup are you on?

N/A manual download of nightly

What command(s) is the bug in?

cast storage

Operating System

Linux

Describe the bug

When attempting to analyze the ByBit hack, I ran the following command to check its storage prior to the hack:

$ cast storage 0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4 --block 218952370

This produces the following error:

Contract at 0x1Db92e2EeBC8E0c075a02BeA49a2935BcD2dFCF4 is a proxy, trying to fetch source at 0x34CfAC646f301356fAa8B21e94227e3583Fe3F5F...
Error: Compiler run failed:
Error (2314): Expected '(' but got ','
Contract.sol:136:40: ParserError: Expected '(' but got ','
            let success := call(sub(gas, 10000), token, 0, add(data, 0x20), mload(data), 0, 0)
                                       ^

I believe that error is occuring because the Gnosis Safe Mastercopy contract was written in Solidity version 0.5, but cast is attempting to parse the assembly with a newer version, and the Yul for the gas variable is slightly different. I don't actually know Yul so I might be incorrect, but that's my guess based on the error.

I also have not tried specifying an older compiler version, so this may in fact not be a "bug" if specifying a 0.5 compiler is the correct solution.

Metadata

Metadata

Labels

C-castCommand: castT-featureType: featurefirst issueA good way to start contributing

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions