Architecture, tokenomics, math, deploy steps, and the contract surface - meant to be read in one sitting beside a window.
uniFARM is a fully on-chain farming game on BNB Smart Chain. A wallet claims a plot - a BEP-721 NFT with traits that affect yield. The plot's on-chain SVG is dynamic: it changes block by block as your crop grows. You plant a seed, the timer starts, you come back later, you harvest $FARM. Your neighbors can water your plots for a tip. $FARM trades on PancakeSwap V2 against BNB.
The browser does no simulation of its own. State lives in the contract, art is generated on every read, and the rules are immutable from deploy.
$FARM is a reflection-style BEP-20 with 9 decimals and a hard cap of 1,000,000,000. The token never inflates beyond this initial mint. The 100M harvest pool is part of the 1B, not in addition to it.
Reflection mechanics. The token has buy/sell fees that default to 0% at deploy. The owner can adjust them via setTax(redBuy, redSell, devBuy, devSell). Standard launch-template safety: _maxTxAmount is 3,500,000 $FARM and _maxWalletSize is 20,000,000 $FARM. Owner-tunable via setmaxTxAmount / setMaxWalletsSize. The owner is excluded from these limits, which is what lets initial LP add and harvest-pool top-ups go through.
Game mechanics stay well under both limits - the most expensive plot is plot #10000 at ~5,000 $FARM, and the largest single harvest is ~660 $FARM (heirloom × max multipliers).
Plots are BEP-721 NFTs. Hard cap of 10,000 ever. First plot per wallet is free (lifetime). Subsequent plots cost 0.5 × total_minted $FARM, paid into the farm contract.
Each plot rolls four traits at mint, sealed forever:
The plot's tokenURI() returns a dynamic SVG. Every time wallet apps, marketplaces, or our own UI reads it, the SVG re-renders from current state - what's planted, growth %, weather, watering count. The NFT is alive.
32 crop types across 4 rarity tiers (yields and pack prices in $FARM, 9 decimals):
Seed cost roughly tracks the minimum of the crop's yield range. An average plot in average weather is near break-even; profit comes from good traits, neighbor watering, and lucky weather. The harvest pool drains at a sustainable rate, not a faucet.
Seeds live as a mapping inside the farm contract, not separately tokenized. Buy seed packs at the market with $FARM. Planting consumes one seed of that type and starts the grow timer.
When you harvest, there's a 10% chance to drop a fresh seed of the same type back into your inventory - the cozy loop closes on its own without forcing market visits.
Weather is posted by an oracle (initially the owner) every 6 hours via post_weather(uint8). Four states: Sunny / Rainy / Windy / Foggy. On BSC, weather affects one thing - in-game crop yields:
Each crop has a slight weather preference baked into the contract. Best weather for a crop = up to +20% yield. Worst = up to -25%. The plant-time weather and the harvest-time weather are averaged together, so timing your harvest matters but cannot dominate the outcome.
This BSC build does not modulate any swap fees from weather - PancakeSwap V2 has no hooks. Weather lives entirely inside the game.
yield = base × weather_avg × soil × sun × water × pest × (1 + 0.04 × waters)
base is sampled uniformly from the crop's yield range using on-chain entropy. weather_avg averages plant-time weather and current weather (small protection against last-second harvest timing). All trait multipliers are sealed at plot mint. waters caps at 10 (max +40%).
A perfectly-traited plot (Black Earth · Sunny · Spring-fed · Hardy) reaches 1.20 × 1.10 × 1.15 × 1.10 ≈ 1.67×. Weather + waters can push that to ~3.3× of base.
The 100M starter pool sits inside the farm contract from the moment you call top_up_pool after deploy. It pays out as crops are harvested. Inflows that keep the pool alive:
0.5 × total_minted $FARM, paid to the farm contract. Plot #5000 alone returns 2,500 $FARM to the pool.top_up_pool(amount) lets anyone (including the owner via marketing wallet) push fresh $FARM into the pool. Useful when activity outpaces seed-and-mint inflows.If the pool ever runs to zero between top-ups, harvests pay only what's available - the contract caps the payout to the contract balance. No revert, no lost work; the harvested crop still resets and the seed-drop chance still rolls. The valley simply slows down until the pool is refilled.
- end of manual -