Omniscia Echidna Finance Audit

PtpDepositor Code Style Findings

PtpDepositor Code Style Findings

PDR-01C: Function Typo

TypeSeverityLocation
Code StyleInformationalPtpDepositor.sol:L101-L109

Description:

The linked function contains a typographic mistake.

Example:

contracts/core/PtpDepositor.sol
99/// @notice Stop accepting PTP deposits
100/// @dev only owner
101function 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 owner
109/// @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

TypeSeverityLocation
Code StyleInformationalPtpDepositor.sol:L58, L111, L135

Description:

The linked require checks have no error messages explicitly defined.

Example:

contracts/core/PtpDepositor.sol
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

TypeSeverityLocation
Code StyleInformationalPtpDepositor.sol:L18-L21

Description:

The linked variables have no visibility specifiers explicitly set.

Example:

contracts/core/PtpDepositor.sol
17uint256 public constant FEE_DENOMINATOR = 10000;
18address ptp; // immutable
19address vePtp; // immutable
20address platypusProxy; // immutable
21address ecdptp; // immutable
22uint256 public lockIncentivePtp;
23uint256 public lockIncentive; // divided by FEE_DENOMINATOR
24uint256 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

TypeSeverityLocation
Gas OptimizationInformationalPtpDepositor.sol:L18-L21, L33-L36

Description:

The linked variables are assigned to only once during the contract's constructor.

Example:

contracts/core/PtpDepositor.sol
27constructor(
28 address _ptp,
29 address _vePtp,
30 address _platypusProxy,
31 address _ecdptp
32) {
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.