neu-fi / regen-bingo

Monorepo for both backend and contract developments of Regen Bingo!
https://regen.bingo
2 stars 1 forks source link

Refactor SVG generation in the contract #40

Closed hantuzun closed 1 year ago

hantuzun commented 1 year ago

We can take notes from Hypercerts' implementation: https://github.com/Network-Goods/hypercerts-protocol/blob/main/contracts

I suggest having a RegenBingoMetadata library with these external functions:

generateContractURI function generateContractURI() external view returns (string memory)

generateTokenURI function generateTokenURI(uint256 tokenId, uint256[9][3] numbers, bool[9][3] covered) external view virtual returns (string memory)

oytuncoban commented 1 year ago

We're going to need to change the implementation on the frontend after these changes. Please inform when done. :)

hantuzun commented 1 year ago

The frontend only needs to change the aspect ratio; which will be square. @oytuncoban you can assume that the images are going to be square and will have smaller numbers.