The mint_range
function in the ERC721BridgeableMintableImpl
contract does not mint any NFTs when start == end
. This behavior is likely contrary to user expectations, as users might expect at least one NFT to be minted when start
and end
are the same.
The mint_range
function is designed to mint a range of NFTs from start
to end
. However, the current implementation contains a loop that only executes when start != end
. As a result, if a user calls mint_range
with start
equal to end
, the loop does not execute, and no NFTs are minted:
In this case, the loop condition (token_id == end
) is met immediately, causing the loop to exit before any minting occurs. The general convention in a range function is either to include start and exclude end, or include end and exclude start or include start and end - the current implementation excludes both start and end when both are equal.
This behavior is likely to be unexpected for users, who might reasonably assume that calling mint_range
with start
equal to end
would result in the minting of a single NFT with the specified token_id
.
The function's behavior does not align with common user expectations for range-based minting functions.
Manual Review.
Consider modifying the mint_range
function to handle the case where start == end
by minting a single NFT with the start
(or end
) value as the token_id
.
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.