Omniscia CloudFunding Audit
IOU Code Style Findings
IOU Code Style Findings
IOU-01C: Variable Mutability Specifier (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | IOU.sol:L9 |
Description:
The linked variable is assigned to only once during the contract's constructor
.
Example:
contracts/IOU.sol
9uint8 private iouDecimals;10
11constructor(12 string memory _name,13 string memory _symbol,14 uint8 _decimals15) ERC20(_name, _symbol) ERC20Permit(_name) {16 iouDecimals = _decimals;17}
Recommendation:
We advise it to be set as immutable
greatly optimizing its read-access gas cost.
Alleviation:
The variable has been properly set as immutable
optimizing the codebase.