Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Do not error if the source code is not verified#17

Closed
scrogson wants to merge 1 commit intofoundry-rs:mainfrom
scrogson:remove-code-not-verified-error
Closed

Do not error if the source code is not verified#17
scrogson wants to merge 1 commit intofoundry-rs:mainfrom
scrogson:remove-code-not-verified-error

Conversation

@scrogson
Copy link
Copy Markdown

When fetching the source code for a proxy contract, the source code is most likely not verified. In the current implementation, the code returns an error and makes it impossible to detect the implementation address in order to make the same request against that address.

This change makes it possible to proceed with the request even if the source code is not verified, and allow the caller to control the flow from there.

I could see a potentially different implementation where we return a different error that contains the address of the implementation contract if that is preferred.

Wdyt?

@DaniPopes
Copy link
Copy Markdown
Member

DaniPopes commented Nov 23, 2023

If the source code is not verified, what would the object that source_code returns look like?

@scrogson
Copy link
Copy Markdown
Author

If the source code is not verified, what would the object that source_code returns look like?

Here's an example with my changes:

Metadata {
    source_code: SourceCode(""),
    abi: "Contract source code not verified",
    contract_name: "",
    compiler_version: "",
    optimization_used: 0,
    runs: 0,
    constructor_arguments: Bytes(0x),
    evm_version: "Default",
    library: "",
    license_type: "Unknown",
    proxy: 1,
    implementation: Some(0xa12dd5e3f3f1d932ecb2d6b7a3f22e1df5e3403c),
    swarm_source: "",
}

@scrogson scrogson closed this Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants