Traits + On-Chain Renderer
SOLIDITY · TYPESCRIPT · HARDHAT · WAGMI
Overview
Two connected 2022 prototypes explored swappable visual identities: an ERC-1155 trait inventory and a renderer that stores a 32×32, four-colour image in eight uint256 values.
Field notes
- Each image became two 1,024-bit planes, decoded with bitmasks. SVG assembly batched pixels into rows and blocks after recursive string concatenation proved too expensive.
- TraitsNFT compared signed off-chain updates, direct contract callbacks, and non-escrow staking that locked transfers while a trait was in use.
- The builder separated artist-assigned Intrinsic Value from randomized rarity, recolouring one base design across five rarity levels.
- Transferring a selected trait reset the dependent Blerg artwork; unstaking an active trait returned tokenURI to a blank composition.
- Supabase-backed metadata and SVG endpoints completed the prototype. Hardhat tests and gas estimates covered blank, composed, transferred, staked, and unstaked states.
System captures