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 MERGE] Verification compatibility with zksync.io explorer #1

Draft
wants to merge 1 commit into
base: zksync-v0.2.3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl Client {
let response = self
.client
.post(self.etherscan_api_url.clone())
.form(form)
.json(form)
.send()
.await?
.text()
Expand Down
7 changes: 4 additions & 3 deletions src/verify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{Client, Response, Result};
use alloy_primitives::Address;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

/// Arguments for verifying contracts
Expand All @@ -10,7 +11,7 @@ pub struct VerifyContract {
#[serde(rename = "contractaddress")]
pub address: Address,
#[serde(rename = "sourceCode")]
pub source: String,
pub source: Value,
#[serde(rename = "codeformat")]
pub code_format: CodeFormat,
/// if codeformat=solidity-standard-json-input, then expected as
Expand Down Expand Up @@ -54,7 +55,7 @@ impl VerifyContract {
pub fn new(
address: Address,
contract_name: String,
source: String,
source: Value,
compiler_version: String,
) -> Self {
Self {
Expand Down Expand Up @@ -179,7 +180,7 @@ impl Client {
"checkverifystatus",
HashMap::from([("guid", guid.as_ref())]),
);
self.post_form(&body).await
self.get(&body).await.and_then(|res| self.sanitize_response(res))
}

/// Submit Proxy Contract for Verification
Expand Down