Skip to main content

extract_source_files

Function extract_source_files 

Source
pub fn extract_source_files(source: &ContractSource) -> Vec<SourceFile>
Expand description

Extract individual source files from Etherscan’s source code response.

Etherscan returns source code in different formats:

  1. Single file: plain Solidity source
  2. Multi-file: JSON object wrapped in {{...}} with “sources” key
  3. Standard JSON input: JSON with “language”, “sources”, “settings”