Omniscia Moby Audit
ERC20 Code Style Findings
ERC20 Code Style Findings
ERC-01C: Inexistent Error Message
Type | Severity | Location |
---|---|---|
Code Style | ERC20.sol:L224 |
Description:
The linked require
check has no error message explicitly defined.
Example:
contracts/tokens/ERC20.sol
224require(msg.sender == owner);
Recommendation:
We advise one to be set so to increase the legibility of the codebase and aid in validating the require
check's condition.
Alleviation (b02fae335f62cc1f5f4236fb4d982ad16a32bd26):
The statement has been omitted as a result of a separate exhibit, rendering this exhibit nullified.
ERC-02C: Variable Mutability Specifier (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | ERC20.sol:L40 |
Description:
The linked variable is assigned to only once during the contract's constructor
.
Example:
contracts/tokens/ERC20.sol
40address owner; // mock41uint256 private _totalSupply;42
43string private _name;44string private _symbol;45uint8 private _decimals;46
47/**48 * @dev Sets the values for {name} and {symbol}, initializes {decimals} with49 * a default value of 18.50 *51 * To select a different value for {decimals}, use {_setupDecimals}.52 *53 * All three of these values are immutable: they can only be set once during54 * construction.55 */56constructor (string memory name, string memory symbol, uint8 decimals) public {57 _name = name;58 _symbol = symbol;59 _decimals = decimals;60
61 owner = msg.sender;62}
Recommendation:
We advise it to be set as immutable
greatly optimizing its read-access gas cost.
Alleviation (b02fae335f62cc1f5f4236fb4d982ad16a32bd26):
The variable has been omitted as a result of a separate exhibit, rendering this exhibit nullified.