Open hats-bug-reporter[bot] opened 2 months ago
Thank you for your report on the safeInflationBatchTransferFrom function. After review, we've determined this is not an issue.
The function does not require an explicit array length check because this validation is already performed in the ERC1155:_update()
function, which is called deeper in the stack. This design ensures array length consistency without redundant checks.
We appreciate your careful examination of our code and your focus on input validation. Your diligence helps maintain the robustness of our system. Thank you for your valuable contribution.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xb77ca2cee19b08da466c23477ba0753e7722b3ad28a5ce2b2e0fae125525bf65 Severity: medium
Description: When working with address and amount arrays, it is common practice to check that the arrays are of equal length. This prevents issues such as mismatched transfers, where addresses could receive incorrect amounts or, in the worst case, nothing at all.
This happens everywhere else in the code, for example, inside
Migration:Migrate
:Now, let’s take a closer look at the function
safeInflationBatchTransferFrom
:This function accepts two arrays,
_ids
and_inflationaryValues
. Logically, there should be a check to ensure both arrays are of the same length, confirming they are correctly paired. However, this check is missing in the function's flow.As previously mentioned, this oversight can lead to significant issues. For example, if the arrays are mismatched, certain
_ids
may not receive their corresponding_inflationaryValue
(if the values array is longer than the_ids
array).This issue should be classified as medium severity due to its potential to:
Since this function may result in incorrect transfers or prevent recipients from receiving their intended amounts, it can make an essential functionality (batch transferring inflationary values), temporarily (even if for just 1 transaction) unusable (it does not work as it should).
Recommendation
Ensure that a check is added to verify that the length of
_ids
is equal to the length of_inflationaryValues
.