Staking::claimRewards()
, Violating the Staking Rule and Rapidly Decreasing LoveTokens
in StakingVault
.Description: Users can claim rewards before the required 1-week
duration from the Staking
contract. Consider a scenario where two users mint a Soulmate NFT token
. As per the protocol rule, each user can claim 1 LoveToken
per day from the Airdrop
. If they or one of them refrains from claiming LoveTokens from the Airdrop
for 7 days
and then attempts to claim their LoveTokens
from the Airdrop
, they will receive 7 tokens each from the Airdrop Vault
, which is acceptable. However, if they deposit their LoveTokens for staking at the 'Staking' contract using Staking::deposit(uint256 amount)
, the protocol breaks when they call Staking::claimRewards
without waiting for the mandated 1-week duration
. The issue lies in the following section of the Staking::claimRewards()
function:
The problem is that lastClaim[msg.sender]
calculates the claiming time based on the creation of the Soulmate NFT
using soulmateContract.idToCreationTimestamp(soulmateId)
. This timestamp
represents the time of NFT creation
, not the time of depositing the token into the staking contract. Consequently, users do not need to wait 7 days after depositing their LoveTokens for staking before claiming rewards, which violates the staking and rewards claiming rule.
Impact: Viloates Staking And Rewards Claimig Rule.
Proof of Concept: The provided proof of code demonstrates how users can claim rewards without waiting for 1 week.
Recommended Mitigation: This issue can be mitigted by updating the both Staking::deposit(uin256 amount)
and Staking::claimrewards()
function
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.