An attacker can claim more Staking LoveToken than they are entitled to.
An attacker can claim the reward twice by making a deposit, then claiming the his reward, followed by a withdrawal, and transferring their entire balance to another user who will then make a deposit and claim rewards based on time the NFT id = 0 stake.
This is due to the claimRewards() function in the Staking contract, which relies on soulmateContract.idToCreationTimestamp(soulmateId) for a user who has never claimed rewards.
An attacker can obtain Staking rewards without needing to wait more than a week.
foundry
Proof of Concept: The test case below, to be included in StakingTest.t.sol, demonstrates that when a attacker claims an AiStaking reward without waiting a week.
StakingTest.t.test
foundry
It would be more prudent to update the mapping mapping(address => uint256 timestamp) public lastClaim; with the timestamp of the deposit date.
Staking.sol
High severity, this allows users to claim additional rewards without committing to intended weekly staking period via multi-deposit/deposit right before claiming rewards.
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.