Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Sourcify contract information lookup #1899

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

0237h
Copy link
Collaborator

@0237h 0237h commented Jan 10, 2025

Etherscan requires an API key for ABI lookup and other operations.
Sourcify (https://sourcify.dev/) is an open-source decentralized alternative.

Features

  • Contract name, ABI and creation transaction hash (start block) from Sourcify API.
  • Runs before the registry lookup and replaces default values (not interactive) if not provided by the user.
    This means priority for CLI parameters looks like:
    user submitted (env/CLI args) > Sourcify API > Default values > Registry fetch

Closes #1001.

Details

The getFromSourcify method returns all the information related to contracts that are normally fetch from registry URLs:

{ abi: ABI; startBlock: string; name: string }

It internally makes the RPC call for the startBlock using the creation transaction hash.

@0237h 0237h self-assigned this Jan 10, 2025
Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: f1746c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@0237h 0237h force-pushed the feat/support-sourcify-lookups branch from 6464dbd to e9206b6 Compare January 10, 2025 20:04
- Contract name, ABI and creation transaction hash (start block)
  from [Sourcify API](https://docs.sourcify.dev/docs/api/).
- Runs before the registry lookup and replaces default values
  (not interactive) if not provided by the user.
  This means priority for CLI parameters looks like:
  user submitted (env/CLI args) > Sourcify API > Default values > Registry fetch
@0237h 0237h force-pushed the feat/support-sourcify-lookups branch from e9206b6 to c5c9010 Compare January 13, 2025 21:08
@0237h 0237h marked this pull request as ready for review January 13, 2025 21:10
@0237h 0237h force-pushed the feat/support-sourcify-lookups branch from 5d4312f to 19cbd8a Compare January 13, 2025 21:19
@0237h 0237h requested a review from YaroShkvorets January 13, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Support for Sourcify
1 participant