Skip to content

fix(erc8004): read agent URI via ERC-721 tokenURI - #35

Merged
DamirAGI merged 1 commit into
mainfrom
fix/erc8004-tokenuri-read
Aug 20, 2026
Merged

DamirAGI merged 1 commit into
mainfrom
fix/erc8004-tokenuri-read

Conversation

@DamirAGI

Copy link
Copy Markdown
Collaborator

Problem

The canonical ERC-8004 IdentityRegistry serves the agent URI as ERC-721 tokenURI and defines no getAgentURI (EIP-8004; erc-8004/erc-8004-contracts IdentityRegistryUpgradeable.sol). The SDK's shared ABI (src/types/erc8004.ts), ERC8004Bridge, and the migration inventory reader all called getAgentURI(uint256) (selector 0xce91aede), so every registry read reverted against the deployed contract — first live run of actp erc8004 inventory on Base Sepolia was observed:0, failures:1 for real identities (see WORK_LOGS/2026-08-20-erc8004-inventory-first-live-run.md in the workspace; thread in #proposals).

Change

  • src/types/erc8004.ts: shared canonical ABI getAgentURI → tokenURI.
  • src/erc8004/ERC8004Bridge.ts and src/erc8004/inventory.ts: interfaces + read callers aligned to tokenURI.
  • No fallback: no deployment serving getAgentURI has been identified; a broad call-failure fallback would mask RPC/provider failures (per Argus's review constraint).
  • Deployed-shape regressions (red-first) in inventory.test.ts and ERC8004Bridge.test.ts: Proxy mock serving tokenURI/ownerOf/getAgentWallet that throws on any getAgentURI access. At bc98492 both fail with deployed registry does not serve getAgentURI; green at this head.

Python bridge (python-sdk-v2) has the same defect (src/agirails/types/erc8004.py:74, src/agirails/erc8004/bridge.py:187) — tracked separately, outside this PR's authorized scope.

Verification

  • Full jest suite: 136 suites / 3289 tests passed, 6 skipped, 0 failures. tsc clean, eslint 0 errors.
  • Live acceptance (RPC https://sepolia.base.org, registry 0x8004A818BFB912233c491871b3d84c89A494BD9e):
    • node dist/cli/index.js erc8004 inventory --network base-sepolia --agent-id 6732 → {"ok":true,"readOnly":true,"observed":1,"failures":0,"signaturesRequested":0,"transactionsGenerated":0}, currentAgentURI preserved as ipfs://QmZyX8UyJLA5u6stQ9sFyuvz3Mqisak7XpNwTBEwVtGRL6, artifact resolved (6,999 bytes).
    • Combined 6732+6747 → observed:2, failures:0; 6747 URI ipfs://QmVLo8PCyXwk8vhhh1RRHDnvLL5S49HiAM4AsdqmfuXT4H resolved (3,384 bytes). Owners/wallets match the 2026-08-20 cast probes.
  • Read-only throughout: no signer, no transaction, no executor.

🤖 Generated with Claude Code

The canonical IdentityRegistry serves the agent URI as ERC-721 tokenURI
and defines no getAgentURI; the shared ABI, ERC8004Bridge, and the
inventory reader all called getAgentURI (selector 0xce91aede), so every
registry read reverted against the deployed contract. Align the shared
ABI and both TypeScript read callers with tokenURI, with deployed-shape
regressions that fail loudly if getAgentURI is ever read again. No
fallback: no deployment serving getAgentURI has been identified.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@DamirAGI
DamirAGI requested a review from roosch269 as a code owner August 20, 2026 22:24
@DamirAGI
DamirAGI merged commit 789179c into main Aug 20, 2026
15 checks passed
@DamirAGI
DamirAGI deleted the fix/erc8004-tokenuri-read branch August 20, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant