The Soulmate::totalSouls function is designed to calculate the total number of "souls" by multiplying the nextID by 2. This method assumes that each increment of nextID represents a pair of soulmates, thus doubling the count. However, the Soulmate::getDivorced function does not adjust the nextID or remove any soulmates from the system upon divorce. It marks only the divorced status of both members of the couple as true.
The current implementation of Soulmate::totalSouls does not account for the divorce status of couples. As a result, it continues to count all pairs that have been created, including those that have divorced. This leads to an inaccurate representation of the total number of active couples in the system.
The souls are 2 (the other 2 have divorced) but the system continues to count 4.
Manual review
Consider maintaining a separate counter for active couples.
Low severity, given `totalSouls()` is simply a view function not used anywhere else in the protocol. There are several instances that can cause wrong values: 1. When there are pending soulmates not yet paired, but `nextId` has already been incremented 2. Divorced soulmates are still included in computation of totalSouls
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.