Omniscia Platypus Finance Audit
MasterPlatypus Code Style Findings
MasterPlatypus Code Style Findings
MPS-01C: Inexistent Error Messages
Type | Severity | Location |
---|---|---|
Code Style | Informational | MasterPlatypus.sol:L117-L120, L426, L436 |
Description:
The linked require
checks do not have any error message defined.
Example:
contracts/MasterPlatypus.sol
117require(address(_ptp) != address(0));118require(address(_vePtp) != address(0));119require(_ptpPerSec != 0);120require(_dialutingRepartition <= 1000);
Recommendation:
We advise one to be defined to allow for easier validation of the require
's condition as well as to increase the debugging capabilities of the system.
Alleviation:
The Platypus team opted to introduce error messages only to the first set of require
checks.
MPS-02C: Variable Mutability Specifiers
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | MasterPlatypus.sol:L125, L130 |
Description:
The linked variables are only set once during the contract's initialize
hook.
Example:
contracts/MasterPlatypus.sol
110function initialize(111 IERC20 _ptp,112 IVePtp _vePtp,113 uint256 _ptpPerSec,114 uint256 _dialutingRepartition,115 uint256 _startTimestamp116) external initializer {117 require(address(_ptp) != address(0));118 require(address(_vePtp) != address(0));119 require(_ptpPerSec != 0);120 require(_dialutingRepartition <= 1000);121
122 __Ownable_init();123 __ReentrancyGuard_init_unchained();124
125 ptp = _ptp;126 vePtp = _vePtp;127 ptpPerSec = _ptpPerSec;128 dialutingRepartition = _dialutingRepartition;129 nonDialutingRepartition = 1000 - _dialutingRepartition;130 startTimestamp = _startTimestamp;131 totalAllocPoint = 0;132}
Recommendation:
We advise them to be set as immutable
and be assigned during the contract's constructor
instead. This is compatible with all upgrade-ability patterns as immutable
variables are replaced in the bytecode directly.
Alleviation:
The Platypus team considered this exhibit but opted not to apply a remediation for it.