# Each generation should have 1 "Golden God" NFT, but there could be 0

EntropyGenerator can place the Golden God entropy (999999) in the last 10 unmintable slots of a generation, permanently losing the guaranteed NFT.

- Payout: Audit contest
- Severity: medium
- Program: TraitForge
- Found by: Kalogerone
- Disclosed: 2024-09-13
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-07-traitforge-findings/issues/30
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-traitforge%3AM-19
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:fuzzing technique:source-review vuln:accounting-error

**Target:** EntropyGenerator / TraitForgeNft NFT minting contracts
**Root cause:** initializeAlphaIndices picks slotIndexSelection in [512,769] and numberIndexSelection in [0,12]; when slot 769 with index >2 is chosen, the 999999 entropy lands in the last 10 of 10,010 entropies, which are never minted since each generation caps at 10,000.
**Steps:**
1. Fuzz block.number and call `entropyGenerator.initializeAlphaIndices()` as TraitForgeNft
2. Find block where `slotIndexSelectionPoint()==769` and `numberIndexSelectionPoint()>2` (e.g. block 3307)
3. Mint 10,000 NFTs to reach generation limit; `_incrementGeneration` calls initializeAlphaIndices
4. Golden God entropy 999999 sits in slot 769 index 3-12, beyond the 10,000 mintable entropies, so it can never be minted
**How found:** Read the entropy slot math (770 slots x 13 = 10,010) versus the 10,000 mint cap, noticed the last 10 entropies are unreachable, then fuzzed block numbers to confirm initializeAlphaIndices can select that region.
**Insight:** When a contract derives a random index into a fixed-size array, compare the array's total capacity against the number of consumable entries; off-by-capacity gaps silently strand the special value.

