syjcnss/web3_skills · Archived

fetch-source

Fetches verified smart contract source code from Sourcify and Etherscan for any EVM-compatible chain.

First seen Mar 12, 2026

Installation

$ npx skills add syjcnss/web3_skills --skill fetch-source

Summary

  • Fetches verified smart contract source code from Sourcify and Etherscan for any EVM-compatible chain.
  • Use this skill whenever the user wants to download, retrieve, or inspect the source code of a smart contract at a given address, audit a contract, or analyze on-chain code — even if they don't say "Sourcify" or "Etherscan" explicitly.

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from syjcnss/web3_skills.

npx skills add syjcnss/web3_skills

Browse all from syjcnss/web3_skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Default branch master
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,646 B
  • docs SUMMARY.md 358 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Fetch Source

Fetches verified smart contract source code from Sourcify and Etherscan for any EVM-compatible chain.

Usage

./scripts/fetch_sources.sh -c <chain_id> [-o <output_dir>] <address>

Optional environment variable: ETHERSCANAPIKEY (enables Etherscan fallback if not found on Sourcify)

What it does

  1. Tries Sourcify first (no API key needed)
  2. Falls back to Etherscan v2 API if not found on Sourcify
  3. Saves all source files under sources_<address>/ (or custom -o dir)

Handles all Etherscan source formats: standard JSON input (with or without extra braces), and single flat files. Detects Vyper vs Solidity by compiler version.

Examples

# Fetch Uniswap V3 Factory on Ethereum (chain 1)
./scripts/fetch_sources.sh -c 1 0x1F98431c8aD98523631AE4a59f267346ea31F984

# Custom output directory
./scripts/fetch_sources.sh -c 137 -o ./uniswap_polygon 0x1F98431c8aD98523631AE4a59f267346ea31F984

Chain IDs

Common chain IDs: 1 (Ethereum), 10 (Optimism), 56 (BSC), 137 (Polygon), 8453 (Base), 42161 (Arbitrum)

Output

  • sources_<address>/sourcify.json or etherscan.json — raw API response
  • sources_<address>/<filepath>.sol — individual source files as returned by the verifier