From b34c034bc40ff889c250661bbf1b62fd5d650457 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 4 May 2022 01:40:41 +0200 Subject: [PATCH] chore(etherscan): update VerifyArgs (#1212) --- ethers-etherscan/src/contract.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ethers-etherscan/src/contract.rs b/ethers-etherscan/src/contract.rs index a2d497d9..b390a5ab 100644 --- a/ethers-etherscan/src/contract.rs +++ b/ethers-etherscan/src/contract.rs @@ -10,7 +10,7 @@ use crate::{ }; /// Arguments for verifying contracts -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct VerifyContract { #[serde(rename = "contractaddress")] pub address: Address, @@ -26,13 +26,15 @@ pub struct VerifyContract { pub compiler_version: String, /// applicable when codeformat=solidity-single-file #[serde(rename = "optimizationUsed", skip_serializing_if = "Option::is_none")] - optimization_used: Option, + pub optimization_used: Option, + /// applicable when codeformat=solidity-single-file #[serde(skip_serializing_if = "Option::is_none")] pub runs: Option, /// NOTE: there is a typo in the etherscan API `constructorArguements` #[serde(rename = "constructorArguements", skip_serializing_if = "Option::is_none")] pub constructor_arguments: Option, - #[serde(rename = "evmversion")] + /// applicable when codeformat=solidity-single-file + #[serde(rename = "evmversion", skip_serializing_if = "Option::is_none")] pub evm_version: Option, #[serde(flatten)] pub other: HashMap, @@ -114,7 +116,7 @@ impl VerifyContract { } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum CodeFormat { #[serde(rename = "solidity-single-file")] SingleFile,