Omniscia Alliance Block Audit

Router Code Style Findings

Router Code Style Findings

ROU-01C: Duplication of Code

TypeSeverityLocation
Gas OptimizationInformationalRouter.sol:L38-L42

Description:

The linked code segment performs the same statements as LibDiamond's diamondStorage function.

Example:

contracts/Router.sol
38LibDiamond.DiamondStorage storage ds;
39bytes32 position = LibDiamond.DIAMOND_STORAGE_POSITION;
40assembly {
41 ds.slot := position
42}

Recommendation:

We advise the LibDiamond implementation to be used to ensure consistency in the codebase as well as a reduction in bytecode size.

Alleviation:

The statements were indeed replaced by an invocation of the diamondStorage function of LibDiamond.