A soulmate who is divorced can still claim airdrop rewards.
The Airdrop::claim()
function rewards soulmates who are not divorced to claim lovetokens. The contract attempts to check the soulmates' divorce status by calling Soulmate::isDivorced()
:
If we look inside of Soulmate::isDivorced()
we'll see that it checks for the divorce status for msg.sender
:
Since Airdrop is calling Soulmate::isDivorced()
, msg.sender
will represent the Airdrop contract address and not the original caller of Airdrop::claim()
. This will result in Soulmate::isDivorced()
to return false thus bypassing the revert.
A divorced soulmate will bypass the revert and will still be able to claim tokens.
We can imagine the following scenario:
User A calls Soulmate::mintSoulmateToken()
.
User B calls Soulmate::mintSoulmateToken()
and now user A & B are soulmates.
User A or B calls Soulmate::getDivorced()
and now user A & B are divorced.
1 day passes by.
User A or B calls Airdrop::claim()
.
Airdrop::claim()
checks the divorce status of it's own contract address instead of user A & B.
Airdrop::claim()
rewards user A or B with tokens.
Here you can see a POC of the above scenario:
VS Code, Foundry
Declare a parameter of type address called _soulmate
to Soulmate::isDivorced()
and check the divorce status of _soulmate
instead of msg.sender
:
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.