Repository navigation
fix(erc8004): read agent URI via ERC-721 tokenURI - #35
Merged
Merged
Conversation
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>
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.
Problem
The canonical ERC-8004 IdentityRegistry serves the agent URI as ERC-721
tokenURIand defines nogetAgentURI(EIP-8004;erc-8004/erc-8004-contractsIdentityRegistryUpgradeable.sol). The SDK's shared ABI (src/types/erc8004.ts),ERC8004Bridge, and the migration inventory reader all calledgetAgentURI(uint256)(selector0xce91aede), so every registry read reverted against the deployed contract — first live run ofactp erc8004 inventoryon Base Sepolia wasobserved:0, failures:1for real identities (seeWORK_LOGS/2026-08-20-erc8004-inventory-first-live-run.mdin the workspace; thread in #proposals).Change
src/types/erc8004.ts: shared canonical ABIgetAgentURI→tokenURI.src/erc8004/ERC8004Bridge.tsandsrc/erc8004/inventory.ts: interfaces + read callers aligned totokenURI.getAgentURIhas been identified; a broad call-failure fallback would mask RPC/provider failures (per Argus's review constraint).inventory.test.tsandERC8004Bridge.test.ts: Proxy mock servingtokenURI/ownerOf/getAgentWalletthat throws on anygetAgentURIaccess. Atbc98492both fail withdeployed 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
tscclean, eslint 0 errors.https://sepolia.base.org, registry0x8004A818BFB912233c491871b3d84c89A494BD9e):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},currentAgentURIpreserved asipfs://QmZyX8UyJLA5u6stQ9sFyuvz3Mqisak7XpNwTBEwVtGRL6, artifact resolved (6,999 bytes).observed:2, failures:0; 6747 URIipfs://QmVLo8PCyXwk8vhhh1RRHDnvLL5S49HiAM4AsdqmfuXT4Hresolved (3,384 bytes). Owners/wallets match the 2026-08-20 cast probes.🤖 Generated with Claude Code