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.
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.