Omniscia Tangible Audit
TangibleReaderHelperV2 Code Style Findings
TangibleReaderHelperV2 Code Style Findings
TRH-01C: Variable Mutability Specifiers (Immutable)
Type | Severity | Location |
---|---|---|
Gas Optimization | TangibleReaderHelperV2.sol:L19, L22, L25 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
contracts/TangibleReaderHelperV2.sol
29/**30 * @notice Initializes TangibleReaderHelper31 * @param _factory Factory contract reference.32 * @param _passiveNft PassiveNFT contract reference.33 * @param _revenueShare RevenueShare contract reference.34 */35constructor(IFactory _factory, IPassiveIncomeNFT _passiveNft, RevenueShare _revenueShare) {36 require(address(_factory) != address(0), "FP 0");37 factory = _factory;38 passiveNft = _passiveNft;39 revenueShare = _revenueShare;40}
Recommendation:
We advise them to be set as immutable
greatly optimizing their read-access gas cost.
Alleviation (2ad448279d9e8e4b6edd94bcd2eb22129b6f7357):
The factory
, passiveNft
, and revenueShare
contract-level variables of the contract have been set as immutable
, optimizing their read-access gas cost significantly.