I am working on an art project that I would like to integrate closely with the Nouns contracts.
I’ve written the contracts for new generative on-chain pixel SVG graphics and am trying to swap out the head trait for my custom svg. I am looking to connect with a smart contract developer on the nouns team that can help me understand how to replace the head traits with my own pieces.
Just to outline what I am thinking in terms of approach.
I am thinking I will implement the generateSVGImage and _getPartsForSeed functions from the NounsDescriptor in my own contract. This function will be called when a someone looks up the tokenURI.
For _getPartsForSeed in my contract (which is called by generateSVGImage), I would replace the heads part (_part[2]) with the head part that I created. I would have to encode this part using the custom Nouns RLE.
Does this seem like a good approach? Is there a more efficient way to do this?
One of the drawbacks of this approach is that I will need to replicate the NounsDescriptor traits (backgrounds, bodies, accessories, and glasses) as well as the color palatte (stored in palattes) in my own contract. This is redundant and would be expensive, but as far as i can tell is necessary
yes, there’s a descriptorV2 version deployed. you can see the code in the repo, and you can go on etherscan to the Nouns token and find the descriptor it’s using.
Wow that was really helpful, now what I need to know is how “14|17 14|17 14|17 14|17 02|17 01|00 11|17 02|17 01|00 11|17 02|17 01|00 11|17 02|17 01|00 11|17 02|17 01|00 11|17 02|17 01|00 11|17 02|17 01|00 11|17” is turned into a string and then hex coded.