![]()
Hello again…
According to my basic dune query there’s total ~5.5 million contracts on mainnet with embedded metadata, I’m not sure what % of that is resolvable using IPFS… Almost all swarm metadata are dead end.
*.GetCode.eth
Solidity compiler by default appends CBOR-encoded metadata to contract bytecode containing IPFS/Swarm hashes with ABI, metadata & contract’s source code.
*getcode.eth is a minimal ERC-3668 wildcard ENS resolver that extracts Solidity compiler metadata from contract bytecode and returns that as ENS contenthash.
Basic UI and Metadata parsing :
Source code (verified on etherscan) :
0x7661a4705F10d828B7d9FAB680c6E9559faEABB0
- I’ve added IPFS/Helia client in browser/service worker to help with metadata storage and propagation. UI also supports downloading source code as IPFS Content Archive (CAR) & ZIP files. You can read more about this in https://playground.sourcify.dev/,
*.getcode.ethis same as sourcify playground but 100% onchain using ENS wildcard resolver.
3 modes
Direct mode :
0x<addr>.getcode.eth --> IPFS contenthash (0xe3010170...) of metadata.json
CBOR mode :
0x<addr>.cbor.getcode.eth --> Returns Raw dag-cbor CID of metadata.json
Proxy Mode :
0x<addr>.proxy.getcode.eth --> Tries to detect proxy & resolve implementation's metadata.json
Example :
https://0xbd3531da5cf5857e7cfaa92426877b022e612cf8.getcode.eth.limo/
https://0x07880d44b0f7b75464ad18fc2b980049c40a8bc3.getcode.eth.limo/
Limitations :
a) old contracts don’t have embedded metadata in bytecode
b) contracts with swarm metadata are almost useless as nobody’s paying postage stamps for that metadata storage
c) bad proxies like USDC return blank implementation() address
d) lots of contracts don’t have their IPFS metadata pinned
// cc @ethlimo.eth
plz giv us wildcard ssl for *.cbor.getcode.eth & *.proxy.getcode.eth
Back to building another thing…