Omniscia XFai Audit
xfai Code Style Findings
xfai Code Style Findings
XFA-01C: Variable Mutability Specifier
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | xfai.sol:L57, L62, L80, L99, L102, L103 |
Description:
The linked variables are assigned to only once during the contract's constructor
.
Example:
contracts/xfai.sol
90constructor(91 IERC20 _XFIT,92 address _devaddr,93 uint256 _XFITPerBlock,94 uint256 _startBlock,95 uint256 _bonusEndBlock,96 uint256 _xFitThreeshold,97 uint256 _fundsSplitFactor98) XPoolHandler(_xFitThreeshold, _fundsSplitFactor) {99 XFIT = _XFIT;100 devaddr = _devaddr;101 XFITPerBlock = _XFITPerBlock;102 bonusEndBlock = _bonusEndBlock;103 startBlock = _startBlock;104}
Recommendation:
We advise them to be set as immutable
greatly optimizing the gas cost of the contract.
Alleviation:
All three variables were properly set as immutable
greatly optimizing the gas cost of the codebase.