Omniscia PolyTrade Finance Audit

PolyTadeToken Manual Review Findings

PolyTadeToken Manual Review Findings

PTT-01M: Improper require Check

TypeSeverityLocation
Logical FaultMinorPolyTadeToken.sol:L34

Description:

The linked require check states that minting and burning can only begin after deployment, however, the conditional within simply ensures that allowedAfter is greater-than-or-equal-to 0 which will always be the case as its a tautology.

Example:

contracts/PolyTadeToken.sol
23constructor(
24 string memory name,
25 string memory symbol,
26 uint256 initialSupply,
27 uint256 allowedAfter,
28 address _governance,
29 address account
30)
31 ERC20(name, symbol)
32 ERC20Permit(name)
33{
34 require(allowedAfter >= 0, "Minting/Burning can only begin after deployment");
35 mintAllowedAfter = block.timestamp + allowedAfter;
36 burnAllowedAfter = block.timestamp + allowedAfter;
37 governance = _governance;
38 _mint(account, initialSupply);
39}

Recommendation:

We strongly recommend the conditional to be set to a greater-than comparison (>) and potentially with a minimum threshold, such as a day.