MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: low
Valid

Absence of `payoutStart` check at the `editPool` function

Summary

Absence of payoutStart check at the editPool function may lead to instantly changing of pools' key parameters. This can cause different problems such as incorrect rewards calculation and time lock changing.

Vulnerability Details

The createPool checks the payoutStart value:

function createPool(Pool calldata pool_) public onlyOwner {
require(pool_.payoutStart > block.timestamp, "DS: invalid payout start value");

The payoutStart influences on the reward calculation, withdrawal and claiming possibilities.

function getPeriodReward(uint256 poolId_, uint128 startTime_, uint128 endTime_) public view returns (uint256) {
...
return
LinearDistributionIntervalDecrease.getPeriodReward(
...
pool.payoutStart,
...
function claim(uint256 poolId_, address user_) external payable poolExists(poolId_) {
...
require(block.timestamp > pool.payoutStart + pool.claimLockPeriod, "DS: pool claim is locked");
...
function _withdraw(address user_, uint256 poolId_, uint256 amount_, uint256 currentPoolRate_) private {
...
if (pool.isPublic) {
require(
block.timestamp < pool.payoutStart ||
(block.timestamp > pool.payoutStart + pool.withdrawLockPeriod &&

But the editPool function has no similar check. This way key parameters of pools can be instantly changed because of a mistake.

Impact

Incorrect reward calculation. Users will receive less rewards or won't receive rewards at all. Instant changing of withdrawal (in public pools) and claiming possibilities due to changing pool.payoutStart + pool.withdrawLockPeriod and pool.payoutStart + pool.claimLockPeriod timestamps.

Tools used

Manual Review

Recommendations

Consider checking that a new payoutStart parameter is the same as the old one.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`editPool` function doesn't do the payoutStart check

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.