The mint_range
function in the erc721_bridgeable.cairo
contract contains a logic error that results in the exclusion of the upper bound token ID
when minting a range of tokens. This leads to fewer tokens being minted than intended, potentially causing discrepancies in token distribution and bridge operations.
The mint_range
function is designed to mint a range of ERC721
tokens from a start ID
to an end ID
. However, the current implementation uses an exclusive upper bound check, which causes the function to terminate before minting the token with the ID equal to the end
parameter.
The problematic code snippet is:
In this loop, the break condition if token_id == end
is checked before minting the token. As a result, when token_id
reaches the value of end
, the loop terminates without minting that final token.
The function will consistently mint one less token than expected. For example, if called with start = 1
and end = 10
, it will mint tokens 1 through 9, omitting token 10.
Manual Review
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.