3 ms·
Maybe a stupid question, but where do I find the base64 encoded image in your linked token? The only thing I can see is a transaction moving it from one address
by dkersten 5y ago
Maybe a stupid question, but where do I find the base64 encoded image in your linked token? The only thing I can see is a transaction moving it from one address to another, the contract bytecode (which I guess might encode an image but its definitely not obvious[1]) and the "extra data" hex in the transaction (that doesn't appear to be an encoded image either, from what I can tell).
I'm probably missing something, so if you could let me know where to look, that'd be nice!
[1] I decompiled it here: https://rinkeby.etherscan.io/bytecode-decompiler?a=0x6b96751051cd25c29cdcea79c3625e749b0ed7f7 https://rinkeby.etherscan.io/bytecode-decompiler?a=0x6b96751...
- mcintyre1994 5y agoI'm not sure about that either TBH! If you copy the to address (0x22f542cd394fba213df8d1f6c46f454b74e05503) and paste it into testnets.opensea.io then you can see the collection here: https://testnets.opensea.io/0x22f542cd394fba213df8d1f6c46f454b74e05503 https://testnets.opensea.io/0x22f542cd394fba213df8d1f6c46f45... The contract has no mention of opensea, so they must be reading it from the blockchain somehow - but I guess etherscan doesn't display these tokens in a similar way for some reason. It's all pretty new to me and I definitely don't have a super joined up understanding of it all!
- miracle2k 5y agoTo query the URI of your tokens through your contract, you need to interact with its ABI through code; alternatively, you can upload the ABI to Etherscan, which will provide a UI to query it. You can use the URI to store base64 encoded image or svg data, and that is super cool; but will be too expensive for larger images, at which point you will link to an IPFS-hosted url.
- mcintyre1994 5y agoAh thankyou! In that course we did write a web frontend that interacts with the contract ABI to mint the NFTs, but we didn’t do the display side. I’m curious how opensea are doing it, because they can display NFTs from my contract without me ever giving them the ABI. Can you go from decompiled contract (like etherscan can generate) -> ABI maybe?
- miracle2k 5y agoWhen you are implementing an NFT, you are likely implementing either the ERC 721 or the ERC 1155 interfaces; as such, certain standard functions will be available using a standard ABI call. So OpenSea will just try to call `tokenURI`; if you have implemented the interface correctly, that will succeed, if not, OpenSea will not show a placeholder image.