Omniscia Platypus Finance Audit

MasterPlatypus Manual Review Findings

MasterPlatypus Manual Review Findings

MPS-01M: Conditional Emission Discrepancy

TypeSeverityLocation
Logical FaultMediumMasterPlatypus.sol:L229, L230, L286, L292

Description:

The emission of a particular pool is dynamic depending on whether people have a non-diluted (factor) power within it. This means that the emission rate of the whole contract will be discrepant and will not match the ptpPerSec value if at least one of all pools has zero factor given that the nonDialutingRepartition is not emitted when pool.sumOfFactors is 0.

Example:

contracts/MasterPlatypus.sol
282// calculate ptp reward
283uint256 ptpReward = (secondsElapsed * ptpPerSec * pool.allocPoint) / totalAllocPoint;
284
285// update accPtpPerShare to reflect dialuting rewards
286pool.accPtpPerShare += (ptpReward * 1e12 * dialutingRepartition) / (lpSupply * 1000);
287
288// update accPtpPerFactorShare to reflect non-dialuting rewards
289if (pool.sumOfFactors == 0) {
290 pool.accPtpPerFactorShare = 0;
291} else {
292 pool.accPtpPerFactorShare += (ptpReward * 1e12 * nonDialutingRepartition) / (pool.sumOfFactors * 1000);
293}

Recommendation:

We advise the code to introduce an else statement that emits the full ptpReward amount to simple stakers to ensure a consistent emission rate across the system.

Alleviation:

After discussion with the Platypus team, we identified that this is indeed desired behaviour as the system is not meant to emit the non diluting portion if no stakers exist. As such, we consider this exhibit null.