bridgeNftToAnotherChain
use userTokenIds.length - 1
to know the last owned ID of a user but it pops the array just before reusing this line.
If the user only have one NFT, it will underflow the condition below. Otherwise, if the sender have more than one NFT, and the bridged NFT is the second to last of the array, it will erase the last item without replacing the second-to-last.
Likelyhood: High
Occurs during every bridge if the Cat owner has only 1 NFT or bridges their second-to-last NFT.
Impact: High
Underflow and revert: No bridge possible
Removal of the wrong NFT from the array
Mint only one NFT to a Cat owner.
Attempt to bridge this NFT.
Use pop
after replacing lastItem
.
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.