Omniscia Nexera Audit

DataIndex Code Style Findings

DataIndex Code Style Findings

DIX-01C: Syntactic Sugar Optimization

Description:

The referenced functions will always cast the input address type to the IDataObject interface.

Example:

contracts/DataIndex.sol
78///@inheritdoc IDataIndex
79function read(address dobj, DataPoint dp, bytes4 operation, bytes calldata data) external view returns (bytes memory) {
80 return IDataObject(dobj).read(dp, operation, data);
81}
82
83///@inheritdoc IDataIndex
84function write(address dobj, DataPoint dp, bytes4 operation, bytes calldata data) external onlyApprovedDM(dp) returns (bytes memory) {
85 return IDataObject(dobj).write(dp, operation, data);
86}

Recommendation:

We advise the function's input to be set to the IDataObject data type directly, optimizing the code's syntax.

Alleviation:

The referenced syntax has been optimized as advised, updating the DataIndex::read and DataIndex::write functions to accept an IDataObject argument directly.