pub fn to_verification_request(self) -> Result<VerificationIncomingRequest, anyhow::Error> {
        Ok(VerificationIncomingRequest {
            contract_address: self.contract_address,
            source_code_data: match self.code_format {
                EtherscanCodeFormat::SingleFile => SourceCodeData::SolSingleFile(self.source_code),
                EtherscanCodeFormat::StandardJsonInput => {
                    SourceCodeData::StandardJsonInput(serde_json::from_str(&self.source_code)?)
                }
            },
            contract_name: self.contract_name,
            compiler_versions: CompilerVersions::Solc {
                compiler_solc_version: {
                    let compiler_version = self.compiler_version;
                    if compiler_version.starts_with("zkVM") {
                        // Return as is for zkVM compiler versions
                        compiler_version
                    } else {
                        // Otherwise, extract short solc version from the full version string
                        // e.g. "v0.8.24+commit.e11b9ed9" -> "0.8.24"
                        compiler_version
                            .strip_prefix('v')
                            .unwrap_or(&compiler_version)
                            .split_once('+')
                            .map(|(version, _)| version.to_string())
                            .unwrap_or(compiler_version)
                    }
                },
                compiler_zksolc_version: self.zksolc_version,
            },
            optimization_used: self.optimization_used.map(|x| x.to_bool()).unwrap_or(false),
            optimizer_mode: self.optimizer_mode,
            constructor_arguments: Bytes::from(
                hex::decode(self.constructor_arguments)
                    .map_err(|_| anyhow::anyhow!("Invalid constructor arguments"))?,
            ),
            is_system: self.is_system.map(|x| x.to_bool()).unwrap_or(false),
            force_evmla: self.force_evmla.map(|x| x.to_bool()).unwrap_or(false),
            evm_specific: VerificationEvmSettings {
                evm_version: self.evm_version,
                optimizer_runs: self.runs.map(|x| x.parse().unwrap()),
            },
        })
    }
Converts the Etherscan verification request to a `VerificationIncomingRequest` which can be processed by the
verifier in a usual way.
Returns result with VerificationIncomingRequest or an error if the source code is not valid JSON.
core/lib/types/src/contract_verification/etherscan.rs