Verify token URI permanence
tokenURI can be http, ipfs, ar, or data: — only some survive the loss of a server, and a mutable baseURI behind an owner setter keeps every token hostage.
Procedure
Read the raw URI and the base construction:
cast call $NFT "tokenURI(uint256)(string)" 1 --rpc-url $RPC cast call $NFT "baseURI()(string)" --rpc-url $RPCClassify the scheme.
data:application/json;base64,is fully on-chain;ipfs:///ar://is content-addressed;https://depends on a domain that can lapse or be seized.For an
https://URI, resolve DNS and record registrar expiry:dig +short example.com whois example.com | grep -iE 'expiry|expiration'Find the setter and its access control:
cast call $NFT "owner()(address)" --rpc-url $RPC grep -nE 'function setBaseURI|function setTokenURI|function updateBaseURI|function freezeMetadata' src/*.solAn
onlyOwnersetBaseURImeans the owner can swap all metadata; a one-wayfreezeMetadata()with an event is the durable pattern.For
data:URIs, decode and confirm the media is embedded, not linked:cast call $NFT "tokenURI(uint256)(string)" 1 --rpc-url $RPC \ | sed 's/^data:application\/json;base64,//' | base64 -d | jq -r '.image' | head -c 80Check whether the URI is stored per token or computed from
tokenId. A computed URI is compact but still depends on whatever the derivation reads on-chain.
Pitfalls
ipfs://ipfs/Qm...(double scheme) resolves in some wallets and silently fails in others.- A
baseURIwith no trailing/concatenates wrongly and 404s every token. renounceOwnership()does not freeze an already-mutable URI if the store sits behind a proxy admin with upgrade rights.- A
data:JSON that references an external font or image URL is not actually on-chain. - Explorers show a cached metadata image; always read
tokenURIfrom the contract, never from the marketplace page.
Verification
cast call $NFT "tokenURI(uint256)(string)" 1 --rpc-url $RPC
cast call $NFT "baseURI()(string)" --rpc-url $RPC
Pass: the scheme is data:, ipfs: or ar: AND no reachable setter can change it, or the setter is one-way and already called. Report the scheme, the storage model (per-token vs computed), and who holds the change key.