⚙️

Section 02

Technology

The Sewer System

RatBastards is built on cutting-edge smart contract tech that pushes the boundaries of what's possible on-chain. Not hype. Just hard-core engineering.

On-Chain Rendering

Every rat is rendered entirely on-chain as SVG. No IPFS. No external servers. No dependencies. Just pure, immortal blockchain art.

  • >SVG generation directly in Solidity - yes, we're that crazy
  • >28x28 pixel art compositing at runtime
  • >5 trait layers: Background, Body, Head, Eyes, Earring
  • >Zero external dependencies - your rat survives nuclear winter

SSTORE2 Optimization

We use SSTORE2 to store trait data in contract bytecode. 60% gas savings compared to traditional storage. That's not a typo.

solidity
// Traditional storage: 20,000 gas per 32 bytes
// SSTORE2: ~200 gas per byte after deployment
// Yeah, we optimized the hell out of this
address dataPointer = SSTORE2.write(rleData);
bytes memory data = SSTORE2.read(dataPointer);

Trait Selection System

Not just random - smart random:

  • >Weighted random selection based on rarity tiers
  • >Generation-locked traits (Gen 1, Gen 2, etc.) - evolving meta
  • >Lucky Windows: Every 80 mints, guaranteed rare trait drops
  • >Pity Light: Safety net for the truly unlucky bastards

Special Heads

10% of rats spawn with special heads - merged body+head designs that are extra rare and extra filthy.

  • >3 types: Block Head, Rabbit Head, Dog Head
  • >Merged body+head designs (unique silhouettes)
  • >Stored at special reserved values (65533-65535)
  • >No earrings - these rats don't need accessories