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: 106/283
Findings: 1
Award: $59.23
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: t0x1c
Also found by: 0xCiphky, 0xDetermination, Draiakoo, Greed, Kalogerone, MatricksDeCoder, MidgarAudits, MrPotatoMagic, PedroZurdo, Shubham, SpicyMeatball, VAD37, Velislav4o, ZanyBonzy, btk, cats, djxploit, forkforkdog, givn, ladboy233, lanrebayode77, lil_eth, visualbits, zaevlad
59.2337 USDC - $59.23
https://github.com/code-423n4/2024-02-ai-arena/blob/main/src/GameItems.sol#L158-L161
Whenever a game item is created, a daily allowance is set which allows a user to mint a specific amount tokens for that game item per day. Every 24 hours the allowance is reset for that user to mint again. Game items can be transferrable or non-transferrable depending on the admin.
In mint()
users can buy game items. There is check to ensure a user does not exceed its daily allowance.
File: GateItems.sol function mint(uint256 tokenId, uint256 quantity) external { ... require( dailyAllowanceReplenishTime[msg.sender][tokenId] <= block.timestamp || quantity <= allowanceRemaining[msg.sender][tokenId] ); ...
The safeTransferFrom()
only checks if the game item is transferrable.
File: GateItems.sol function safeTransferFrom( address from, address to, uint256 tokenId, uint256 amount, bytes memory data ) public override(ERC1155) { require(allGameItemAttributes[tokenId].transferable); super.safeTransferFrom(from, to, tokenId, amount, data); }
allowanceRemaining[msg.sender][tokenId] = 0
.safeTransferFrom()
sending the battery to his original address.useVoltageBattery()
to refill his voltage balance.This gives Bob an unfair advantage compared to other users who are unaware of this loophole.
Users can transfer game items from a different address after depleting their daily allowance which gives them a unfair advantage compared to other players. This in turn makes the concept of daily allowance useless.
Manual Review
Possible suggestion would be to allow game items to be transferred only if the to
address has not reached the daily allowance limit for that day.
Invalid Validation
#0 - c4-pre-sort
2024-02-22T18:06:30Z
raymondfam marked the issue as insufficient quality report
#1 - c4-pre-sort
2024-02-22T18:06:41Z
raymondfam marked the issue as duplicate of #43
#2 - c4-judge
2024-03-07T04:17:54Z
HickupHH3 marked the issue as satisfactory