Any user that hasn't minted via Soulmate::mintSoulmateToken()
or a user that is still awaiting a soulmate can call Soulmate::getDivorced()
to set their divorce status to true.
The Soulmate::getDivorced()
function is meant to divorce msg.sender
and their soulmate. However, if a user hasn't minted a soulmate, or they are awaiting a future soulmate soulmateOf[msg.sender]
will return address(0)
and assign that to the soulmate2
local variable.
This then results in divorce[msg.sender]
to be set to true
, and divorce[0x0000000000000000000000000000000000000000]
to also be set to true
.
When a user then mints a soulmate, this will result in soulmate1 to be divorced, and soulmate2 to not be divorced.
A user who divorces themselves without a soulmate will result in:
Incorrect divorce state for both soulmate1 (true
) and soulmate2 (false
).
soulmate1 not be eligible to claim lovetokens via Airdrop::claim()
while soulmate2 will be able to.
Incorrect event emitted as the couple will be msg.sender
and 0x0000000000000000000000000000000000000000
.
You can add the following POC test in foundry to test the incorrect state:
VS Code, Foundry
Add a new error and check the soulmateOf
mapping to ensure msg.sender
has a soulmate before updating the divorced mapping:
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.