Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scrogson
Copy link

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
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
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: "",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants