Soulmate::totalSouls
does not return the proper amount of souls
Soulmate::totalSouls
is a function that is aimed to return the number of Souls currently in the contract.
However, it does not count people who still have not found it soulmate, and therefore, returning a number 1 unit lower than expected in some situations
Can result in a misscalculation if the result of the function is used in some arithmetic.
Foundry
Proof of Concept:
1-There is only a couple in the contract now, but soulmate3
calls Soulmate::mintSoulmateToken
when nobody is looking for a soul
2- Soulmate::totalSouls
returns 2, even though there are 3 souls on the contract
Place the following code into Soulmate.t.sol
Actually having a variable that counts the number of people that call Soulmate::mintSoulmateToken
without reverting.
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.