MCPcopy Create free account
hub / github.com/ChainSecurity/deployment_validation / get_deployment_tx_from_etherscan

Function get_deployment_tx_from_etherscan

lib/web3.rs:314–341  ·  view source on GitHub ↗
(
    config: &DVFConfig,
    address: &Address,
)

Source from the content-addressed store, hash-verified

312}
313
314fn get_deployment_tx_from_etherscan(
315 config: &DVFConfig,
316 address: &Address,
317) -> Result<EtherscanCreationTransaction, ValidationError> {
318 let url = format!(
319 "{}?module=contract&action=getcontractcreation&contractaddresses={:?}&apikey={}",
320 config.get_etherscan_api_url()?,
321 address,
322 config.get_etherscan_api_key()?
323 );
324 debug!("Etherscan URL: {}", url);
325
326 // Send the GET request
327 let mut response = get(&url)?;
328
329 // Read the response into a string
330 let mut buffer = String::new();
331 response.read_to_string(&mut buffer)?;
332
333 let result: EtherscanResult = serde_json::from_str(&buffer)?;
334 debug!("Etherscan contract creation response: {}", buffer);
335 // Parse the response as a JSON list
336 let mut transactions: Vec<EtherscanCreationTransaction> =
337 serde_json::from_value(result.result)?;
338 let transaction = transactions.remove(0);
339
340 Ok(transaction)
341}
342
343fn send_blocking_web3_post(
344 config: &DVFConfig,

Callers 1

get_deploymentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected