Art Generators
Art generators are simple smart contracts that are responsible for generating raw SVG code and attributes for each edition/experiment. They are also used to create the initial seed for each token ID, as well as to modify the seed of a token ID. The raw SVG code is generated and returned 100% onchain.
all art generator contracts must implement the following interface:
interface IArtGenerator {
function getRawSvg(bytes32 seed) external view returns(string memory);
function getRawSvgAndAttributes(bytes32 seed) external view returns(string memory, string memory);
function modify(uint tokenId, bytes memory data) external view returns (bytes32);
function unPackSeed(bytes calldata seed) external pure returns(bytes memory);
function createSeed(uint tokenId, address minter) external view returns(bytes32);
function dimensions(bytes32 seed) external pure returns(uint,uint);
{
The SVG string that is returned looks roughly like this:
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" height="1000" width="1000">
...more svg code
</svg>'
The attributes string looks like this:
'{"trait_type": "background", "value": "red"}, {"trait_type": "eyes", "value": "blue"}'