Code
Artist requirements
The gm.studio platform supports artwork code created in Processing (the java app) or Javascript (including p5js).
Javascript
Artists should provide a script adhering to the following spec:
A single minified js file.
We recommend p5.js, but we can also support any non-WebGL based libraries.
Your script should contain a standalone function that reads parameters from
window.params
and draws the artwork in a canvas in the current window.The window params type is described in the code block below.
Your script should write the attributes to
window.metadata
Upon completion your script should set
document.complete = true
Notes:
All metadata values should be output as
String
types.You should tell us the aspect ratio of the output so that we can display the pieces optimally in our gallery.
The currently supported version of p5 is
1.4.0
Processing
Code archival
Storing in contract bytecode
This step is usually performed by the studio team
generate a gzipped tarball of all files
tar -czf archive.tar.gz sketch.min.js desc.json
get the blob's hex string e.g. by
echo "0x"$(hexdump archive.tar.gz -v -e '/1 "%02X"')
store blob using
repo.store(blob)
an event containing the storage address will be emitted during the transaction
Code verification
Please make sure that the stored code matches the one used for rendering the tokens.
Connect a wallet (needed to get a connection to the blockchain)
Make sure to select the correct collection address
Click
Download Blob
to download the code archiveUnpack the archive
Please verify that the stored script is correct e.g. by rerendering the genesis token using the downloaded code.
You can fetch the seed for a given token directly from the collection contract on etherscan:
Fetch the seed using
contract.tokenSeed(tokenId)
Code signature
If the stored code is correct, you can proceed to sign your code (this step is optional but we highly encourage to do so).
Connect the wallet that you want to use to sign your code. The wallet will be associated with your code.
Click
Sign
Metamask will pop up and prompt you to sign something - please do so.
Even though some of the characters might seem weird, this is totally fine because we are signing the raw binary hash of the repository entry while Metamask tries to interpret it as a string.
Please communicate the output appearing below the buttons to the studio team.
Last updated
Was this helpful?