According to protocol documentation, divorced Soulmates should not be able to continue to claim daily loveToken airdrops once they have been divorced. Due to a logic error in the Soulmate::isDivorced() function, it will always return false when called in the Airdrop::claim() function. This allows the divorced Soulmates to continue claiming airdropped loveTokens.
When the Airdrop::claim() function calls Soulmate::isDivorced(), the msg.caller is used to access the divorced mapping. The value of msg.caller within Soulmate::isDivorced() is the Airdrop contract and is NOT the divorced Soulmate who called Airdrop::claim(). The Airdrop contract doesn't exist in the divorced mapping, so false will be returned by Soulmate::isDivorced().
The Foundry test below demonstrates the problem as it shows that an airdrop claim from a divorced Soulmate will NOT revert as expected and the test will fail:
High
Visual Studio Code, Foundry
It is recommended to rewrite Soulmate::isDivorced() to take a parameter which accepts an address which is to be checked for being divorced.
As a result, Airdrop::claim() should also be modified as shown to pass the parameter - the caller of Airdrop::claim():
Finally, the ISoulmate contract should be changed to reflect the new signature of Soulmate::isDivorced():
After these changes, the test provided in the Vulnerability Details section should pass.
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.