Description: This function calculates token rewards based on the duration of a couple's relationship using block.timeStamp, which is susceptible to manipulation by miners. This vulnerability can lead to unfair token distribution, compromising the airdrop's integrity and security.
Impact: This exploit allows miners to manipulate couple duration, potentially enabling unfair token distribution and compromising airdrop integrity.
Proof of Concept:
Both the attacker and a soulmate mint a Soulmate token.
The attacker can then skew the block.timeStamp variable to a desired value to ensure a huge difference in the accurate current time.
The attacker then calls on the Airdrop::claim function with the manipulated block.timeStamp variable causing the numberOfDaysInCouple calculation to yield a larger value than the actual duration of the couple's relationship.
As a result, the function calculates a higher tokenAmountToDistribute, potentially exceeding the available balance in the airdrop vault.
The function then transfers tokens based on the manipulated calculation, allowing the attacker to claim an unfair amount of tokens.
Place the following into the AirdropTest.t.sol.
Note: The attacker adjusted the block.timeStamp to a high amount of days(900_000_000_000_000 days), to get an unfair Lovetoken acquirance of worth 500_000_000.
Recommended Mitigation: Consider using an off-chain Oracle to get the accurate present time for claiming a LoveToken token.
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.