feat: automated ERC-1046 token indexing via Sourcify#450
Draft
feat: automated ERC-1046 token indexing via Sourcify#450
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automated indexing for ERC-1046 using Sourcify
feat(agent-erc1046): automated ERC-1046 token indexing via Sourcify
Feb 20, 2026
|
Please don't use the legacy api as it will be turned off. Use v2 API instead. See https://sourcify.dev/server/api-docs/swagger.json for the API spec :) |
Owner
Thanks! I was trying to one-shot this with Claude (didn't work either) and GH Co-Pilot. I'll do tackle it manually later and utilize the parquet format instead of hitting the APIs directly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
agent-erc1046package that discovers ERC-1046 tokens (EIP-1046) from Sourcify-verified contracts and creates xmatter entries for them.How it works
GET /server/contracts/full_match/{chainId}for 8 major EVM chainsmetadata.jsonfrom Sourcify and checks the ABI for a zero-argumenttokenURI()functiontokenURI()on-chain via viem → fetches the returned HTTP(S) URI → parses the ERC-1046 JSON metadata; falls back to on-chainname()/symbol()/decimals()for any missing fieldsREADME.mdwithstandards: ["erc20", "erc1046"], downloads the metadataimageas the iconState tracking
Progress is stored in
.state.jsonas a per-chain page cursor:{ "chains": { "1": 12, "137": 4 } }Updated after each page batch, allowing the agent to resume exactly where it left off on the next CI run — consistent with the
.fetch-ignore.jsonpattern used by other agents.Changes
packages/agent-erc1046/— new agent package (agent.ts,package.json,tsconfig.json,.state.json).github/workflows/agent.yml— addsagent-erc1046to the CI matrix (norepo/ref; pulls live from Sourcify API)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
sourcify.dev/home/REDACTED/.bun/bin/bun bun agent.ts --dry-run(dns block)/home/REDACTED/.bun/bin/bun bun agent.ts -m conntrack --ctstate INVALID,NEW -j DROP(dns block)/home/REDACTED/.bun/bin/bun bun agent.ts(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.