The Airdrop contract allows soulmates to claim LoveToken if they are in relation but should not allow divorced people to claim tokens as mentioned by the protocol.
The check inside the Airdrop::claim
function checks for divorce condition of Airdrop
contract instead of the actual caller leading to airdrop claims even though the soulmates are divorced and as the Airdrop
contract will not be in relation therefore the divorce condition will always be false, and thus allowing divorced users to still claim Airdrop as usual when they were not divorced.
The vulnerability lies at line 53 inside Airdrop
contract's claim
function which represents the incorrect condition for evaluating whether caller is divorced or not.
The call soulmateContract.isDivorced()
made inside Airdrop::claim
function actually returns the divorce status of Airdrop
contract because the caller of isDivorced
function on Soulmate
contract is Airdrop
contract. Thus, it returns the divorce status of Airdrop
contract instead of the caller who called the Airdrop::claim
function, allowing divorced people to still take benefits of Airdrop.
Divorced users can still claim Airdrop due to the incorrect divorce condition implemented inside Airdrop::claim
function.
Add the test in the file: test/unit/AirdropTest.t.sol
Run the test:
Manual Review, Unit Test in Foundry
Instead of checking divorce condition of Airdrop contract, check the same for the caller of Airdrop::claim
function.
Soulmate
contract doesn't have the function to query the divorce condition of a user, therefore implementing the same inside Soulmate
contract:
Modify the check inside Airdrop::claim
function to check divorce condition for the caller (At line 53)
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.