Omniscia Nexera Audit
FractionERC1155DataManager Code Style Findings
FractionERC1155DataManager Code Style Findings
FEM-01C: Inefficient Unconditional Write
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | FractionERC1155DataManager.sol:L120 |
Description:
The referenced write operation will unconditionally overwrite the wrapper data point even if the fractionConfig_.wrapper value has been validated as 0.
Example:
109// Mint intial supply110if (fractionConfig_.wrapper != address(0)) {111 if (IERC721(fractionConfig_.wrapper).ownerOf(fractionConfig_.nftId) != address(this)) revert NotOwnerOfWrappedNFT();112 if (fractionConfig_.initialSupply != 0) {113 mint(beneficiary_, 0, fractionConfig_.initialSupply, "");114 }115}116
117registerOmnichainIncreaseBalanceHandler();118
119// Store FractionConfig120wrapper = fractionConfig_.wrapper;Recommendation:
We advise the assignment to be relocated to the if block that precedes it akin to the original implementation, optimizing the code's gas cost.
Alleviation:
The inefficient unconditional write has been relocated as advised, optimizing the code's gas cost.
FEM-02C: Non-Standard Configuration Structure
| Type | Severity | Location |
|---|---|---|
| Code Style | ![]() | FractionERC1155DataManager.sol:L35-L41, L87 |
Description:
The FractionConfig structure will contain configurational variables for the FractionERC1155DataManager::__FractionERC1155DataManager_init_unchained function implementation, however, the beneficiary_ address has remained distinct.
Example:
86__FractionERC1155DataManager_init_unchained(87 beneficiary_,88 FractionConfig({89 wrapper: wrapper_,90 nftId: nftId_,91 initialSupply: amountToBeMinted_,92 upperGenesisId: upperGenesisId_,93 userUnlockEnabled: userUnlockEnabled_94 })95);Recommendation:
We advise the address to be introduced to the structure as well, optimizing the code's style.
Alleviation:
The beneficiary has been introduced to the configurational structure optimally as advised, addressing this exhibit.
