The mintSoulmateToken()
function anticipates that the paired users will share one tokenID for their NFT. But the ERC721.sol
standard that Soulmate.sol
inherits from allows only one owner per tokenID. Each user should get an NFT but it can't be with the same tokenID (it is called nextID
in the function, but it is the tokenID for ERC721 purposes).
If the function was otherwise set up properly, it would revert every time soulmate2 called it (because it would have already minted an NFT at nextID and wouldn't mint a second one). The reason this doesn't happen is because the function fails to mint an NFT at nextID to soulmate1 (but it should in fact do this) and also because the call to _mint()
for soulmate2 incorrectly iterates to nextID++ (even though the state variables like idToOwners[nextID][1]
would say that soulmate2 owns the NFT of nextID, not nextID++).
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.