Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Functionality in `burnBatchMultiple()` Function

Description

The burnBatchMultiple function is intended to burn batches of tokens for multiple addresses. However, the current implementation burns individual token IDs and their amounts for each address, rather than burning batches of tokens.

function burnBatchMultiple(
address[] memory froms
) public onlyRole(OWP_FACTORY_ROLE) {
for (uint256 j = 0; j < froms.length; ++j) {
for (uint256 i = 0; i < 7; ++i) {
uint256 amount = balanceOf(froms[j], i);
if (amount > 0) {
burn_(froms[j], i, amount);
}
}
}
}

Issue: The function iterates over the froms array and burns individual token IDs and their amounts for each address. This does not align with the intended functionality of burning batches of tokens.

Recommendation: To correctly burn batches of tokens, the function should be modified to accept arrays of token IDs and amounts for each address. Here is a suggested implementation:

function burnBatchMultiple(
address[] memory froms,
uint256[][] memory ids,
uint256[][] memory amounts
) public onlyRole(OWP_FACTORY_ROLE) {
require(froms.length == ids.length, "Invalid input");
require(froms.length == amounts.length, "Invalid input");
for (uint256 i = 0; i < froms.length; i++) {
require(ids[i].length == amounts[i].length, "Invalid batch input");
_burnBatch(froms[i], ids[i], amounts[i]);
}
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.