This is not a tutorial. It is an incident log. We wanted a 43-second (BOB) Dobbscoin radio spot to live entirely on-chain, play on Gnosisscan, and show live what its sales had locked. It took three tries in public. These are the parts nobody had written down, so you only have to break them once.
Everything below was learned by pressing PLAY on the real Gnosisscan page, which is where the lessons were hiding. Nothing here is theory.
animation_urlGnosisscan is run by Blockscout, and for most people it is the only place a Gnosis NFT gets seen. The frame it loads your HTML into is gnosisscan.io/nft-html-embed.html. Opened directly it is a blank page, because it is an empty frame; use View Source and read the comment at the top before you build. Between that and pressing PLAY:
sandbox="allow-scripts" and nothing else. Scripts run. Popups, new tabs, navigation and storage do not. A link inside your NFT will never open there.data: URL fails there (media error 4). The same bytes as a blob: URL play.fetch to public RPC endpoints works, so the NFT can read the chain while you watch.crypto.subtle is not there. Don't plan an in-player SHA-256 check.display_type and max_value are ignored, so write "37 of 1000" as plain text.<audio src="data:audio/mpeg;base64,…">. Every local test played it. Gnosisscan refused it with media error 4. The item had already been opened, which in that contract meant frozen for good.It had passed fuzzing, invariants, static analysis and two code reviews. Code review reads code. It does not press PLAY. An earlier test version had played fine, because it handed the sound over as a blob:. The later version "simplified" that into a data: URL and nobody pressed the button again.
Fix: build a Blob from the bytes and give <audio> a URL.createObjectURL address. The failed collection was pulled from our portfolio. It is still on chain, as these things are.
A comment inside the script explained that each copy ends with <script>go(…)</script>. The HTML parser does not know what a JavaScript comment is. It saw </script>, ended the script there, and printed the rest of the program onto the page.
The byte-for-byte checks passed, because the bytes were exactly what we wrote. Only the real page showed it. We now refuse to deploy any player whose script contains </script or <!--.
BatchMetadataUpdate for every copy, as the standard says to. Gnosisscan kept showing the old version.Gnosisscan did not act on that event in the time we waited. What does work is the "…" menu on a token's page, then Refresh metadata. Press it on every copy people are going to look at. Our own check passed once while the explorer was still showing the old player, so it now also confirms that Gnosisscan is playing the current version.
Dobbscoin Promo #1 is the version that survived. The design, in parts:
audioChunk(i) through public RPCs, falling over between nodes with a timeout, then plays it as a blob:. The record itself costs about 28M gas to read, under the usual 50M node cap.Only then does anything get opened or locked. The rehearsal caught Incident 2. A code review would not have.
Sources that helped: OpenSea metadata standards, Zellic on sandboxed NFT iframes. There is no guide to a good NFT experience on Gnosis. Now there is this.
The spot is 43 seconds long. Getting it to play took most of a week. "Bob" would call that Slack well spent, and "Bob" has never been wrong about Slack.