Skip to main content

Module source

Module source 

Source
Expand description

§Contract Source Code Retrieval

Fetches verified contract source code, ABI, compiler settings, and metadata from block explorer APIs (Etherscan getsourcecode).

§Etherscan Free Tier

The getsourcecode endpoint is available on the free tier (5 calls/sec). It returns: SourceCode, ABI, ContractName, CompilerVersion, OptimizationUsed, Runs, ConstructorArguments, EVMVersion, Library, LicenseType, Proxy, Implementation, SwarmSource.

Structs§

AbiEntry
A single ABI entry (function, event, or constructor).
AbiParam
An ABI parameter (input or output).
ContractSource
Full contract source information from a block explorer.
SourceFile
A source file extracted from multi-file source code.

Functions§

extract_source_files
Extract individual source files from Etherscan’s source code response.
fetch_contract_source
Fetch full contract source code and metadata from Etherscan.