Omniscia Glimpse Audit
GLMS_ETH Code Style Findings
GLMS_ETH Code Style Findings
GLS-01C: Redundant Getter Function
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | GLMS_ETH.sol:L51-L53 |
Description:
The getOwner
function invokes the owner
getter function internally.
Example:
51function getOwner() external view override returns (address) {52 return owner();53}
Recommendation:
We advise the getOwner
function to be dropped as it is equivalent to the owner
function as the IBEP20
inheritence is not meant to be conformed to since this is the ETH version of the token.
Alleviation:
The IBEP20
inheritance was dropped entirely rendering the getOwner
function null.
GLS-02C: Redundant User-Defined Getters
Type | Severity | Location |
---|---|---|
Code Style | Informational | GLMS_ETH.sol:L58-L81 |
Description:
The linked getter functions all return their respective variables with an underscore (_
) prefix.
Example:
55/**56* @dev Returns the token decimals.57*/58function decimals() external view override returns (uint8) {59 return _decimals;60}61
62/**63* @dev Returns the token symbol.64*/65function symbol() external view override returns (string memory) {66 return _symbol;67}68
69/**70* @dev Returns the token name.71*/72function name() external view override returns (string memory) {73 return _name;74}75
76/**77* @dev See {BEP20-totalSupply}.78*/79function totalSupply() external view override returns (uint256) {80 return _totalSupply;81}
Recommendation:
We advise them to be dropped and the inner variables to be renamed with the underscore omitted and set as public
, ensuring that the getter functions are generated by the compiler instead.
Alleviation:
The variables were properly set to public
after removal of their manual getter functions.
GLS-03C: Variable Mutability Specifiers
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | GLMS_ETH.sol:L14-L17, L25-L28 |
Description:
The linked variables are assigned to only once during the contract's constructor
and are done so to literal values.
Example:
24constructor() {25 _name = "Glimpse";26 _symbol = "GLMS";27 _decimals = 18;28 _totalSupply = 360000000 * 10 ** 18;29 _balances[_msgSender()] = _totalSupply;30 31 emit Transfer(address(0), _msgSender(), _totalSupply);32}
Recommendation:
We advise the assignments to be relocated to the declarations and the variables to be set as constant
, greatly optimizing the codebase.
Alleviation:
The assignments were properly relocated, however, the variables were not set to constant
.