Omniscia Symbiosis Finance Audit
SyntERC20 Code Style Findings
SyntERC20 Code Style Findings
SER-01C: Variable Mutability Specifier
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | SyntERC20.sol:L10, L27 |
Description:
The linked variable is assigned to only once during the contract's constructor.
Example:
contracts/synth-contracts/SyntERC20.sol
9contract SyntERC20 is Ownable, ERC20Permit {10 uint8 private _decimals;11
12 function mint(address account, uint256 amount) external onlyOwner {13 _mint(account, amount);14 }15
16 function burn(address account, uint256 amount) external onlyOwner {17 _burn(account, amount);18 }19
20 function decimals() public view virtual override returns (uint8) {21 return _decimals;22 }23
24 constructor(string memory name_, string memory symbol_, uint8 decimals_)25 ERC20Permit("Symbiosis")26 ERC20(name_, symbol_) {27 _decimals = decimals_;28 }29}Recommendation:
We advise it to be set as immutable greatly optimizing the codebase.
Alleviation:
The variable has been properly set as immutable optimizing the codebase.
