Comment on page
Storing data onchain
Contracts deployed on Highlight automatically stores all assets and metadata on arweave. This is cheaper than storing data on the blockchain while still guaranteeing decentralization.
In the case that you want all your data on your contract, this article will walkthrough how you can store SVGs and text on the blockchain.
To upload your SVG-based NFT onto your contract, you'll need to convert it into a Uniform Resource Identifier (URI) so that your browser can render it.
Once you have your URI for your token, you can write this directly onto your contract via the applicable block explorer (for instance, if your contract is deployed on Ethereum, you can use Etherscan).
Instructions below on how to write your SVG directly on your contract:
- 1.Deploy contract on Highlight
- 2.Go to block explorer, then "Write as Proxy". You’ll need to “verify as proxy” which can be done by selecting “more options”
- 3.Write to contract One of one, limited edition, or open edition For any of the above collection styles, to change an entire edition's metadata to SVG, go to field 22 "setEditionURI" Enter the editionID of the collection. This can be found on the token management page. For open editions, it will always be 0. Reference image below. For "_uri (string)", enter in the URI pointing to the token metadata. Generative or series style collection For series and generative series, you can update a single token's metadata to SVG. Use field 30 "setTokenURIs". Under "ids", enter in the token ID for applicable token. For URIs, enter in the URI for the token SVG.Edition ID for one of ones, limited, and open editionsToken ID for generative and series collections