lidofinance / lidofinance/diffyscan

Blockscout `project:/` source-path prefix breaks GitHub source lookup

Open
#179 0 comments 1 reaction 2 assignees View on GitHub

@tamtamchik is already working on this.

Since Jun 29, 2026.

Dominant language
Python
Stars
142
Forks
20
Avg merge
1d 13h
Merged PRs (30d)
15

Description

When sources are fetched from a Blockscout explorer, multi-file verified contracts return source paths prefixed with project:/ (Blockscout's marker for the contract's own project sources). diffyscan passes these paths to the GitHub contents API unchanged, so the lookup 404s and verification aborts.

Repro

config.yaml:

contracts:
  "0x2b33CF282f867A7FF693A66e11B0FcC5552e4425": Kernel
explorer_hostname: eth.blockscout.com
explorer_chain_id: 1
github_repo:
  url: https://github.com/aragon/aragonOS
  commit: f3ae59b00f73984e562df00129c925339cd069ff
  relative_root: ""
diffyscan config.yaml

Set ETHERSCAN_EXPLORER_TOKEN to any value — Blockscout ignores it, but diffyscan still requires the env var to be present.

Actual

HTTP error: 404 Not Found for url:
https://api.github.com/repos/aragon/aragonOS/contents/project:/contracts/kernel/Kernel.sol?ref=f3ae59b00f73984e562df00129c925339cd069ff

Expected

Path resolved as contracts/kernel/Kernel.sol (prefix stripped).

Root cause

Blockscout returns file_path / additional_sources[].file_path as project:/<repo-relative-path>; diffyscan does not normalize this before the GitHub lookup. Etherscan returns the same sources as plain contracts/..., which works. Confirmed via the Blockscout API for 0x2b33CF28… (main project:/contracts/kernel/Kernel.sol, 26 additional sources, all project:/…).

Suggested fix

Strip a leading project:/ from Blockscout source paths before mapping to GitHub (and before applying relative_root).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.