✅Code Checker
Last updated
Last updated
If you followed the Kodahash template, and you finished with your art, its time to test it. Your art should include everything that is needed to be deployed on KodaDot. To be sure that you did not miss anything, we created our KodaDot Code Checker to help you find any missing details in the code.
Open https://koda.art/code-checker and prepare your zip file to be uploaded. once you upload it, wait a few moments. Your code validation will appear on the screen.
CanvasSize: if its dynamic, then its ok
Name of the collection: doublecheck if the collection name is right
Local p5js: testing if the p5js code is in the folder or its using it from the internet
There are other categories we are evaluating. Read below to understand what each category means and what to change in your code in case you are not fulfilling it.
An issue in this category means that the HTML should have a title tag, and the title should be different from kodaHash. Like this:
Once the rendering of art is done, a message needs to be sent signaling the end of the render. This message is necessary for art to work properly on KodaDot. More details can be found in the Kodahash template. This message should look like this:
Kodahash Render Called Once should be called only once, make sure that its not calling more than that.
This check ensures that your artwork doesn't rely on external resources that might not be available when the NFT is rendered. All necessary files (such as images, scripts, or styles) should be included in your project folder. For example, instead of linking to an online p5.js library, you should include the p5.min.js file in your project. This ensures that your artwork will always render correctly, regardless of internet connectivity or the availability of external resources.
To pass this check: - Include all necessary JavaScript libraries in your project folder. - Use relative paths to reference local files instead of URLs to external resources. - Ensure all images, fonts, or other assets used in your artwork are included in the project folder.
Your artwork is expected to use hash url param. Like this:
This check verifies that a valid image is being sent to the Kodahash render process. The image should be in a supported format (typically PNG) and should accurately represent your artwork.
To pass this check: - Ensure your code correctly captures the canvas content. - Convert the canvas content to a valid data URL. - Include this data URL in the postMessageKoda function.
Example code:
This check ensures that your artwork renders consistently across different instances. When using the same hash input, your artwork should produce the same output every time.
To pass this check: - Use a deterministic random number generator seeded with the hash. - Avoid using JavaScript's built-in Math.random() function. - Ensure all variable aspects of your artwork are controlled by the hash-seeded random number generator.
Example implementation:
By implementing these features correctly, you can ensure your artwork passes these important checks in the KodaDot Code Checker, making it ready for deployment on the platform.
Failure means the art is not responsive to screen size changes. In order to fix need to use resizeCanvas like this:
The time between the start of render and message kodahash/render/completed is measured. As we mentioned in the documentation, art should be quick to improve the user experience. Loading time check could fail if:
Artwork is not rendered in the checker.
Takes too long to render, no clear way to fix that, the artist needs to find a way to cut down time.
Your art is animated or it is in infinite loop - which is acceptable
You may get a question mark if when the item cannot be determined: For example, if the art doesn't use kodahash render, loading time and art consistency cannot be determined.
Under the image, you can also find tests for Performance and Capture Service
Performance test: Time Per Variation. Select a number of outputs, and it will test the average time needed to create one variation.
Capture Service test is very important test (especially if you are using WebGL). It tests how the preview of the NFT will look like. It is also important if you have a loop or animated NFT to test this so you can see what the final previews of the NFTs will look like. If previews are not working, you need to adjust the code.
Under the picture, you should see an option to export art. You can select several art pieces you want to download (1x, 3x, 5x, 10x, 15x, 20x).
Use this option to export the maximum amount of NFTs - this will help you to see more variations at once, and you can assess if your art has enough variations. Keep in mind the size of your collection. The bigger the collection, the more variations it should have. So everyone can get their unique NFT!
If you followed the Kodahash template, your code should pass all tests. This is our first version of code checker, so there may be something you need help with. In case you are having any issues, questions, or suggestions on how to improve our Code Checker, please connect with the team on Telegarm or GitHub.