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

4 stars 3 forks source link

Upgraded Q -> 2 from #1606 [1711008404566] #2096

Closed c4-judge closed 8 months ago

c4-judge commented 8 months ago

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

[L-04] Asking for user input or a choice before setting the value in the mapping Asking the user for a choice provides transparency and allows users to have control over certain aspects of the contract. Users may prefer to have a say in whether a particular address is allowed to perform burning operations.

File : src/GameItems.sol

185: function setAllowedBurningAddresses(address newBurningAddress) public { 186: require(isAdmin[msg.sender]); 187: allowedBurningAddresses[newBurningAddress] = true; 188: } src/GameItems.sol#L185C1-L188C6

// Ask for user choice (you might implement this based on your specific use case) bool userChoice = getUserChoice(); // You need to define and implement the getUserChoice function

// Set the mapping based on user choice allowedBurningAddresses[newBurningAddress] = userChoice;

In this modification, you would need to implement a function (getUserChoice in this example) that interacts with the user or a user interface to obtain their choice (whether to set the value to true or false). This approach provides more flexibility and user control over the setting of burning addresses.

c4-judge commented 8 months ago

HickupHH3 marked the issue as duplicate of #47

c4-judge commented 8 months ago

HickupHH3 marked the issue as satisfactory