Trait Randomization
Traits can be common, uncommon, rare, epic, or legendary. For each category, we spin a deterministic on-chain wheel using the core contract’s per-auction seed.
- Seed source:
core.getAuctionSeed(auctionId) returns a per‑auction seed derived in the core contract from chain data.
getTrait(category, auctionId):
- Sums
weight across all traits in category.
- Computes
rand = H(category, auctionId, seed) % totalWeight.
- Scans cumulatively over traits; the bucket where
rand < acc is the selected trait name.
- Given the same
auctionIdand trait table, selection is reproducible across nodes and time. That means the artwork for an auction is fixed once the seed is set for a given auction in the core contract.
Layer Retrieval
The same auctionId + same trait tables = the same result forever. Everyone renders the same art because everything about the brew lives on-chain.
getSVGFragment(category, traitName): Looks up the stored SVG fragment string for the named trait.
getTraits(auctionId): Convenience that resolves the selected trait names for each category in canonical order (Background, Brew, Mug, Top).
SVG Composition (The Image Itself)
The renderer stitches the SVG, Base64-encodes it, and serves it inside the token’s tokenURI as a data URI—no IPFS pins to rot, no servers to trust. Metadata includes the four trait names so marketplaces can show attributes cleanly.
buildSVG(auctionId):
- Starts with an
<svg> root sized 1080×1080.
- For each category in
categories order, resolves the chosen name with getTrait and fetches its fragment with getSVGFragment.
- Concatenates fragments in order to form a single SVG document.
- Appends the closing
</svg> tag and returns the complete image string.
Layering matters: The array order is the z‑order. Background is written first, then Brew, then Mug, then Top.
Backgrounds
| Name | Rarity | Weight |
|---|
| Blue | Common | |
| Pink | | |
| Purple | | |
| Black | | |
Brews
| Name | Rarity | Weight |
|---|
| Miner Lite | Common | |
| Blockweiser | | |
| gweiness | | |
| HOLDweisen | | |
| Bandit IPA | | |
| Juicy Brew | | |
| Stoutoshi | | |
| Slime | | |
Mugs
| Name | Rarity | Weight |
|---|
| Glass | Common | |
| Ceramic | | |
| Ice | | |
| Wood | | |
| Steel | | |
| Charcoal | | |
| Rose Gold | | |
| Gold | | |
| Holographic | | |
| Earth | | |
Tops
| Name | Rarity | Weight |
|---|
| Regular Foam | Common | |
| Flat Foam | Common | |
| Tall Foam | Common | |
| Drippy Foam | | |
| Igloo | | |
| Fyre | | |
| Duck | | |
| Diamond | | |
| Rain | | |
| Red Trucker | | |
| Green Trucker | | |
| Rainbow | | |
| Poop | | |
| Skull | | |