Omniscia Gravita Protocol Audit
DebtToken Code Style Findings
DebtToken Code Style Findings
DTN-01C: Variable Mutability Specifier (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | DebtToken.sol:L22 |
Description:
The linked variable is assigned to only once during the contract's constructor
.
Example:
contracts/DebtToken.sol
42constructor(43 address _vesselManagerAddress,44 address _stabilityPoolAddress,45 address _borrowerOperationsAddress,46 address _timelockAddress47) ERC20("GRAI", "GRAI") {48 vesselManagerAddress = _vesselManagerAddress;49 timelockAddress = _timelockAddress;50 stabilityPool = IStabilityPool(_stabilityPoolAddress);51 borrowerOperationsAddress = _borrowerOperationsAddress;52}
Recommendation:
We advise it to be set as immutable
greatly optimizing its read-access gas cost.
Alleviation:
The timelockAddress
has been set as immutable
, greatly optimizing its read-access gas cost.