Omniscia Echidna Finance Audit
PtpDepositor Code Style Findings
PtpDepositor Code Style Findings
PDR-01C: Function Typo
Type | Severity | Location |
---|---|---|
Code Style | Informational | PtpDepositor.sol:L101-L109 |
Description:
The linked function contains a typographic mistake.
Example:
99/// @notice Stop accepting PTP deposits100/// @dev only owner101function shutwownPtpDeposits() external onlyOwner {102 require(isShutdown == false, "isShutdown");103 isShutdown = true;104
105 withdrawAfter = block.timestamp + 7 days;106}107
108/// @notice Remove PTP from vePTP to the owner109/// @dev Can only be called 7 days after calling `shutwownPtpDeposits`
Recommendation:
We advise it to be corrected.
Alleviation:
The typo of the function was properly corrected.
PDR-02C: Inexistent Error Messages
Type | Severity | Location |
---|---|---|
Code Style | Informational | PtpDepositor.sol:L58, L111, L135 |
Description:
The linked require
checks have no error messages explicitly defined.
Example:
58require(isShutdown == false);
Recommendation:
We advise them to be set so to aid in the validation of the require
's condition as well as the legibility of the codebase.
Alleviation:
Error messages were introduced across all three require
statements.
PDR-03C: Inexistent Visibility Specifiers
Type | Severity | Location |
---|---|---|
Code Style | Informational | PtpDepositor.sol:L18-L21 |
Description:
The linked variables have no visibility specifiers explicitly set.
Example:
17uint256 public constant FEE_DENOMINATOR = 10000;18address ptp; // immutable19address vePtp; // immutable20address platypusProxy; // immutable21address ecdptp; // immutable22uint256 public lockIncentivePtp;23uint256 public lockIncentive; // divided by FEE_DENOMINATOR24uint256 public withdrawAfter = type(uint256).max;25bool public isShutdown;
Recommendation:
We advise them to be set so to avoid potential compilation discrepancies in the future as the default behaviour is for the compiler to assign one automatically which may change in future pragma
versions.
Alleviation:
Visibility specifiers were explicitly introduced for all linked variables.
PDR-04C: Variable Mutability Specifiers
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | PtpDepositor.sol:L18-L21, L33-L36 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
27constructor(28 address _ptp,29 address _vePtp,30 address _platypusProxy,31 address _ecdptp32) {33 ptp = _ptp;34 vePtp = _vePtp;35 platypusProxy = _platypusProxy;36 ecdptp = _ecdptp;37}
Recommendation:
We advise them to be set as immutable
greatly optimizing the codebase.
Alleviation:
The immutable
mutability specifier was introduced for all referenced variables.