Submitted by hakunamatata, also found by zhaojohnson (1, 2), waydou, 0x3b, _karanel, oxwhite, emerald7017, Abdessamed, 0xDazai, dontonka, Tigerfrake, _thanos1, x0t0wt1w, jesjupyter, almurhasan, Shubham, D_Auditor, MinhTriet, Ruhum, stanchev, FastChecker, 0xHash, 0xlookman, ABAIKUNANBAEV, samuraii77, LeFy, Tomas0707, erike1, onthehunt11, Trooper, ogKapten, pep7siup, EaglesSecurity, shikhar229169, VulnViper, cryptomoon, CyberscopeInterns, kutugu, vinica_boy, inzinko, BajagaSec, nikhil840096, 0x0bserver, franfran20, yaioxy, DigiSafe, Nihavent, perseus, Udsen, smbv-1923, Coinymous, Abhan, AvantGard, Night, Shahil_Hussain, den-sosnowsky, LonelyWolfDemon, amaron, bhavya0911, dhank, denzi_, turvy_fuzz, rbserver, 0rpse, KupiaSec (1, 2), klau5, al88nsk, Zac, ilchovski, 0xJoyBoy03, dimulski, ke1caM, shaka, shaflow2, nnez, and ZdravkoHr
Increment generation function sets the count of the entites of the new generation to 0, which could lead to incorrect calculations of the entities in new generation. What can happen is that users will forge entities that will belong to the next generation, and then via the mintToken function the generation will be incremented and genMintCount will be reset for the next generation, which means that all forged entities will not be counted.
Create new test file, paste the code below and run it. The tests show incorrect calculation of the number of entities of a given generation.
The main invariant of the protocol is broken, thus potentially breaking the economy of the game.
Do not reset the genMintCount of the generation.
TForge1 (TraitForge) confirmed
