Omniscia Echidna Finance Audit
EcdToken Code Style Findings
EcdToken Code Style Findings
ETN-01C: Convoluted Initial Cap Representation
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | EcdToken.sol:L64 |
Description:
The linked representation of the EcdToken cap is unnecessarily convoluted.
Example:
64ERC20CappedInflation(3 * (10**(18 + 8)), 300)Recommendation:
We advise the primary number to be represented in its expanded form using the special underscore (_) separator (whereby 10000 would be represented as 10_000) to increase the legibility of the code.
Alleviation:
The linked literal was correspondingly updated to 500_000_000 * (10**18) better representing the value it is meant to depict.
ETN-02C: Inexistent Error Messages
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | EcdToken.sol:L45, L86, L112 |
Description:
The linked require checks have no error messages explicitly defined.
Example:
112require(operators[msg.sender]);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:
An error message was introduced in all three linked require instances.
ETN-03C: Variable Mutability Specifiers
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | Informational | EcdToken.sol:L11, L22 |
Description:
The linked variable is assigned to only once during the contract's constructor.
Example:
16/**17 * @dev Sets the value of the `cap`.18 */19constructor(uint256 cap_, uint256 inflationRate_) {20 require(cap_ > 0, "ERC20Capped: cap is 0");21 _cap = cap_;22 _inflationRate = inflationRate_;23 increaseAfter = block.timestamp + DELAY;24}Recommendation:
We advise it to be set as immutable greatly optimizing the codebase.
Alleviation:
The _inflationRate was properly set as immutable optimizing the codebase.