Omniscia Bonq Audit
trove-factory Code Style Findings
trove-factory Code Style Findings
TRE-01C: Variable Mutability Specifiers (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | trove-factory.sol:L45, L53 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
contracts/trove-factory.sol
97// solhint-disable-next-line func-visibility98constructor(99 address _troveCreator,100 address _stableCoin,101 address _feeRecipient102) Ownable() {103 stableCoin = IMintableToken(_stableCoin);104 troveCreator = ITroveCreator(_troveCreator);105 feeRecipient = IFeeRecipient(_feeRecipient);106 stableCoin.approve(address(feeRecipient), BONQMath.MAX_INT);107}
Recommendation:
We advise them to be set as immutable
greatly optimizing their read-access gas cost.
Alleviation:
The Bonq Protocol team has partially fixed the issue by only marking troveCreator
variable as immutable
.