Skip to main content
This companion contract (OnChainBrewsRenderer) is responsible for composing SVG art on-chain and serving standard ERC‑721 metadata via tokenURI. Below is a section‑by‑section walkthrough of how images are generated, layered, and hosted entirely from contract storage.

Linking to the Core Contract

The renderer is linked to the main (core) contract via IOnChainBrews core and queries the core contract for:
  • tokenIdToAuction(tokenId) → which auction produced a token
  • getAuctionSeed(auctionId) → deterministic per‑auction seed for traits

Data Model

The metadata (description and traits) for On-Chain brews are stored in the core contract, which queries the renderer for the SVG image of each brew.

Admin: Authoring & Maintaining the Art

Because the owner can add/update/remove traits, the art set is mutable until ownership is renounced. This is a conscious choice to allow live curation.
The SVG layers are managed by upsert and remove functions on the renderer contract. This is to allow for continued updates until the renderer contract is renounced. This allows the contract owner to:
  • Publish new traits over time (e.g., seasonal backgrounds).
  • Tweak rarity weight without changing deployed code.
  • Patch/iterate on SVG fragments (fix a pixel, adjust a color) by overwriting svg for that name.