A simply immutable image generator for The Signature Economies.
git clone https://github.com/andytudhope/meta-sign.git cd meta-sign npm i npm run start
It has been fun and games to figure out how to host a React app on IPFS that will return images dynamically in a way that OpenSea can read them.
The basic gist here is that we:
- build this app
- upload the
build/directory to IPFS using pinata
- use the hash that is returned there, but
https://ipfs.is/ipfs/rather than the pinata gateway, because it is severely rate-limited
- Put that gateway + hash in the contract
- deploy the contract
- mint an NFT and return base64 encoded json directly from the
tokenURIfunction, specifying that it overrides the general ERC721 route.
- In particular, the
%3Ffallback check in this app is what took us ages to figure out, because OpenSea encodes their urls when fetching content from IPFS and the double
?we use here is a strange construction.
- We did try to use
-, which would be a more usual use of url character, but for some reason, OpenSea could never fetch those and failed the show metadata entirely, so we could not reliably debug it.
- this is why we have stuck with the strange double
?and simply added fallback support for marketplaces that encode the urls they construct in their infra to fetch metadata from files provided to them.
Character Indices Version
- Functional on IPFS, with fallback for how OpenSea handles url encoding (? and ?, with %3F catch): https://ipfs.io/ipfs/QmaSN7PiDoBcJBdmpH4V2yQGzBYxCwNr5jb1tNt8widcuE/?0?517 (this is the one we are using, as it works with characters, not words)
Word Indices Versions
Functional on IPFS, with fallback for how OpenSea handles url encoding (? and ?, with %3F catch, but works with words): https://ipfs.io/ipfs/QmcsrZcaxdZE6AMJDNQTxeP5UdaFb1GBQJfud7noHmpe5M/?0?30 .
Functional on Arweave, with correct url encoding (# and -): https://arweave.net/hBga7aRMofD07-Yyb_vI-uaRnvRS9la8qqJkQ5fuSWc/
Functional on IPFS with weird encoding, no animation (? and -): https://ipfs.io/ipfs/QmUPtHYB7k6QDxFdo8qkLHmsywKgNo58RRBeUHRCbGtYEc/?0-25
Functional on IPFS without correct encoding or fallback: https://ipfs.io/ipfs/QmWZzAg52Xk5yxAjsL58X4HZDGKDWo67rqrDzArLm64LSA/?0?63