Platform: Code4rena
Start Date: 09/02/2024
Pot Size: $60,500 USDC
Total HM: 17
Participants: 283
Period: 12 days
Judge:
Id: 328
League: ETH
Rank: 243/283
Findings: 1
Award: $0.56
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: haxatron
Also found by: 0xAlix2, 0xCiphky, 0xStriker, 0xaghas, 0xbranded, 0xlamide, 0xmystery, 0xvj, 14si2o_Flint, Aamir, AgileJune, Aymen0909, DanielArmstrong, DarkTower, Draiakoo, EagleSecurity, Giorgio, Krace, KupiaSec, MidgarAudits, MrPotatoMagic, PoeAudits, Ryonen, SpicyMeatball, Topmark, Tychai0s, VAD37, Varun_05, VrONTg, WoolCentaur, _eperezok, alexxander, alexzoid, aslanbek, blutorque, btk, cartlex_, d3e4, devblixt, evmboi32, fnanni, immeas, jesjupyter, juancito, ke1caM, klau5, ktg, lil_eth, merlinboii, nuthan2x, peter, petro_1912, pkqs90, pynschon, radin100, sandy, sashik_eth, shaka, sl1, soliditywala, t0x1c, ubl4nk, visualbits, vnavascues
0.5612 USDC - $0.56
Once the generation of a specific fighter type is increased,new fighter cannot be created for such fighter type
This issue occurs because numElement state for newly created generation is not updated https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L85 when the generation of a specific fighter type is incremented https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L129-L134 . This cause the numElement of the incremented generation to 0 by default, thereby causing _createFighterBase https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L462-L474 to always revert at this point https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L470 for such when creating a new fighter
Manual review
numElement[] of generation of fighter type should be updated when increment generation in the incrementGeneratiion()
Context
#0 - c4-pre-sort
2024-02-22T18:57:57Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-02-22T18:58:12Z
raymondfam marked the issue as duplicate of #45
#2 - c4-pre-sort
2024-02-22T18:58:40Z
raymondfam marked the issue as insufficient quality report
#3 - raymondfam
2024-02-26T01:52:23Z
Inadequate elaboration.
#4 - c4-judge
2024-03-08T03:16:44Z
HickupHH3 marked the issue as partial-50