Submitted by Trooper, also found by 0x3b (1, 2), Decap, cryptomoon, ABAIKUNANBAEV, desaperh, eta, nikhil840096, CyberscopeInterns, AuditGuy, shikhar229169, sl1, the_hunter, Nihavent (1, 2), hail_the_lord, anonymousjoe, Zac, ke1caM, and Kalogerone
The golden god is the special entropy of 999,999. This entropy is set at slotIndexSelectionPoint and numberIndexSelectionPoint here. These are in the third part of the entropy list. When forging two NFTs it increases the current generations generationMintCounts. This means that less NFTs of that generation can be minted, as there are only 10,000 NFTs per generation. Therefore, the golden god might not be reached and no golden god for that generation exists.
First mint all NFTs from generation one. The POC also lists any forger NFT and sends merger NFTs the merger address. To be able to read the new id, _tokenIds in TraitForgeNft must be changed to public.
Next increase the current generation by minting the first generation two NFT:
After that, forge all available generation one NFTs, that were tracked in the previous step:
After that there is the following state:
Now, mint all the remaining generation two NFTs using the same helper function (_mintGeneration) as before.
After that, there is the following state:
Reading the current currentSlotIndex and currentNumberIndex (see here), they were updated to be public so there are readable. For slotIndexSelectionPoint and numberIndexSelectionPoint (see here):
It shows that the generation 2 is fully minted without reaching the golden god of that generation.
Notice: While this is an extreme example (all gen 1 NFTs were forged), this can still happen if only a few are forged and the golden god is far back in the entropy list. Also consider that NFTs can be forged multiple times.
The POC is written in foundry:
There is always a chance that no golden god is minted, as the NFT contract in the current form cant predict when users use mint or forge. In theory, the users could call forge for the last 100s or 1000s NFTs.
Consider reverting on the last forge if the golden god is not yet minted and add a additional condition when minting, that the last NFT of a generation is guaranteed to be the golden god if not yet minted.
TForge1 (TraitForge) confirmed via duplicate Issue #220
