An user, after initially staking the minimum required amount, can subsequently bypass this minimum threshold in later transactions. This loophole allows the user to stake amounts lower than the originally intended minimum.
In line 209 of the Distribution.sol file, we have:
require(userData.deposited + amount_ >= pool.minimalStake, "DS: amount too low");
This line of code checks the total deposited amount (userData.deposited + amount_
) against the minimal stake. If a user has already deposited an amount meeting the minimum stake in previous transactions, they can subsequently deposit any amount, even if it's below the minimum stake, because userData.deposited
is cumulative (line 224).
This could allow users to bypass the minimum stake requirement after their initial deposit.
Manual audit.
To address the vulnerability, it's advised to modify the smart contract's logic to check only the amount_
being currently staked against the pool.minimalStake
. This ensures that each individual staking transaction must meet the minimum stake requirement, regardless of the user's previous deposits.
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.