Omniscia Nexera Audit

MinimalisticFungibleFractionsDO Manual Review Findings

MinimalisticFungibleFractionsDO Manual Review Findings

MFF-01M: Improper Graceful Handling of Errors

Description:

The MinimalisticFungibleFractionsDO::_tryDiid function is meant to opportunistically query the DIID of a particular account, however, it will invoke the MinimalisticFungibleFractionsDO::_dataPointStorage function which will revert if the dataIndexImplementation is zero despite what the local code of the MinimalisticFungibleFractionsDO::_tryDiid function implies.

Impact:

The MinimalisticFungibleFractionsDO::_tryDiid function will fatally fail when a data index implementation has not been defined despite what its local statements would indicate.

Example:

contracts/dataobjects/MinimalisticFungibleFractionsDO.sol
330function _tryDiid(DataPoint dp, address account) internal view returns (bytes32) {
331 DataPointStorage storage dps = _dataPointStorage(dp);
332 if (address(dps.dataIndexImplementation) == address(0)) return 0;
333 try dps.dataIndexImplementation.diid(account, dp) returns (bytes32 diid) {
334 return diid;
335 } catch {
336 return 0;
337 }
338}

Recommendation:

We advise the _dpStorages to be accessed directly similarly to the MinimalisticFungibleFractionsDO::setDataIndexImplementation function, ensuring that the code will gracefully handle a case whereby the data index implementation has not been defined yet.

Alleviation:

The _dpStorages data entry is directly accessed as advised in the revised MinimalisticFungibleFractionsDO::_tryDiid implementation, alleviating this exhibit.