Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Soulmate.getDivorced does not update the current soulmates (soulMateOf)

Summary

Soulmate.getDivorced does not update the current soulmates mapping soulMateOf thus two souls appear to still be in love also after they divorced.

Vulnerability Details

The function getDivorced is updating only the divorced mapping. The divorced couple still appear as soulmates afterwards.

function getDivorced() public {
address soulmate2 = soulmateOf[msg.sender];
divorced[msg.sender] = true;
divorced[soulmateOf[msg.sender]] = true;
emit CoupleHasDivorced(msg.sender, soulmate2);
}

Impact

A divorced couple still appear as soulmates.

Tools Used

Manual code review.

Recommendations

function getDivorced() public {
address soulmate2 = soulmateOf[msg.sender];
divorced[msg.sender] = true;
divorced[soulmate2] = true;
// update soulMateOf
soulmateOf[msg.sender] = address(0);
soulmateOf[soulmate2] = address(0);
emit CoupleHasDivorced(msg.sender, soulmate2);
}
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.