code-423n4 / 2024-02-ai-arena-findings

4 stars 3 forks source link

Upgraded Q -> 2 from #1504 [1710737062373] #2067

Closed c4-judge closed 8 months ago

c4-judge commented 8 months ago

Judge has assessed an item in Issue #1504 as 2 risk. The relevant finding follows:

In FighterFarm::_createFighterBase, a new set of weight, element and dna is created. According to the protocol, weight should lie in the range 65-95 with jumps of 10 between the 3 weight classes (Striker, Scraper, Slugger), such that the first class is 65-74, second one 75-84, and third one should be 85-94. But the code defines up to 95 as can be seen here:

https://github.com/code-423n4/2024-02-ai-arena/blob/cd1a0e6d1b40168657d1aaee8223dc050e15f8cc/src/FighterFarm.sol#L471

uint256 weight = dna % 31 + 65;

c4-judge commented 8 months ago

HickupHH3 marked the issue as duplicate of #1687

c4-judge commented 8 months ago

HickupHH3 marked the issue as satisfactory

c4-judge commented 8 months ago

HickupHH3 marked the issue as unsatisfactory: Invalid