Omniscia LimeChain Audit

Router Code Style Findings

Router Code Style Findings

ROU-01C: Inexplicably Payable constructor

TypeSeverityLocation
Code StyleInformationalRouter.sol:L19

Description:

The constructor of the Router is declared as payable yet does not make use of the msg.value variable.

Example:

contracts/Router.sol
16constructor(
17 IDiamondCut.FacetCut[] memory _diamondCut,
18 DiamondArgs memory _args
19) payable {
20 LibDiamond.diamondCut(_diamondCut, address(0), new bytes(0));
21 LibDiamond.setContractOwner(_args.owner);
22
23 LibDiamond.DiamondStorage storage ds = LibDiamond.diamondStorage();
24
25 // adding ERC165 data
26 ds.supportedInterfaces[type(IERC165).interfaceId] = true;
27 ds.supportedInterfaces[type(IDiamondCut).interfaceId] = true;
28 ds.supportedInterfaces[type(IDiamondLoupe).interfaceId] = true;
29 ds.supportedInterfaces[type(IERC173).interfaceId] = true;
30}

Recommendation:

We advise it to be set to public instead as that appears to have been its intended purpose.

Alleviation:

The payable modifier was properly removed from the constructor of the contract.