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: 68/283
Findings: 1
Award: $111.68
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: abhishek_thaku_r
Also found by: 0xAlix2, 0xDetermination, 0xShitgem, Draiakoo, Fulum, Greed, MrPotatoMagic, PoeAudits, Tychai0s, ahmedaghadi, alexzoid, dimulski, fnanni, givn, iamandreiski, immeas, kartik_giri_47538, kiqo, klau5, korok, ktg, maxim371, offside0011, pontifex, sashik_eth, stakog, swizz, yotov721
111.676 USDC - $111.68
reRoll
function accepts below parameters
/// @notice Rolls a new fighter with random traits. /// @param tokenId ID of the fighter being re-rolled. /// @param fighterType The fighter type. function reRoll(uint8 tokenId, uint8 fighterType) public {}
In programming uint8
is described as 8-bit unsigned integer and the maximum value of this integer is 255
. That means that any number above 255
passed as parameter would revert.
Impact: Users with NFTs above 255 won't be able to execute this function
You can paste following into FigherFarm.t.sol
:
function testTokenId() public { _fighterFarmContract.reRoll(256, 0); }
And it wouldn't even compile throwing this error:
Invalid type for argument in function call. Invalid implicit conversion from int_const 256 to uint8 requested. Literal is too large to fit in uint8.
Manual Review
Consider changing from uint8
to uint256
.
Error
#0 - c4-pre-sort
2024-02-21T23:58:05Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-02-21T23:58:12Z
raymondfam marked the issue as duplicate of #68
#2 - c4-judge
2024-03-05T01:55:48Z
HickupHH3 marked the issue as satisfactory