Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add etherscan client crate #486

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Oct 4, 2021

Motivation

Add etherscan.io client,
Ref #485

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@mattsse mattsse mentioned this pull request Oct 4, 2021
12 tasks
Comment on lines +428 to +430
#[ignore]
async fn can_verify_contract() {
// TODO this needs further investigation
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working now or does it still require more investigation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still get this response instantly, so I think I messed up the payload somehow, but tried various, alternatives like numbers as strings, etc.., will need to take a closer look at dapptools itself or any other etherscan client

    Response {
        status: "0",
        message: "NOTOK",
        result: "Error!",
    },

.parse()
.unwrap();
let compiler_version = "v0.5.17+commit.d19bba13";
let constructor_args = "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000000000007596179537761700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035941590000000000000000000000000000000000000000000000000000000000";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should move BaseContract to ethers-core now to encode constructor arguments in a nice way

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that'd be useful, I think we touched on abstracting functions as a trait via abigen! some time ago, I think it makes sense to follow up on this and move all general abstractions to core.

ethers-etherscan/src/lib.rs Outdated Show resolved Hide resolved
ethers-etherscan/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +197 to +198
#[serde(flatten)]
other: T,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart. never thought about that.

Comment on lines +165 to +167
/// let meta = client
/// .contract_source_code("0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413".parse().unwrap())
/// .await?;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also compile this with Solc? Or provide some helper way to convert this to a CompiledContract

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the etherscan api doesn't seem to provide the bytecode directly, however it is present in the html reponse with div[id=verifiedbytecode2] -.-
Additional tooling to instantly compile this is probably useful, I'll add this to the tracking issue

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gg

@gakonst gakonst merged commit 7d5ea2c into gakonst:master Oct 4, 2021
meetmangukiya pushed a commit to meetmangukiya/ethers-rs that referenced this pull request Mar 21, 2022
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