Omniscia AllianceBlock Audit
MPProviderFacet Code Style Findings
MPProviderFacet Code Style Findings
MPP-01C: Suboptimal Struct Declaration Style
Type | Severity | Location |
---|---|---|
Code Style | ![]() | MPProviderFacet.sol:L85-L92 |
Description:
The linked declaration style of a struct is using index-based argument initialization.
Example:
contracts/facets/MPProviderFacet.sol
85ITeleport.DappTransmissionReceive(86 LibTeleport.teleportStorage().teleportAddressByChainId[params.sourceChainId], // We can use this address directly from this provider, as we are part of the same diamond.87 params.sourceChainId,88 params.transmissionSender,89 params.transmissionReceiver,90 params.dAppId,91 params.payload92)
Recommendation:
We advise the key-value declaration format to be utilized instead, greatly increasing the legibility of the codebase.
Alleviation (54fd570de24631ca65a7cea022aebe43225a08c7):
The key-value declaration style is now properly in use within the referenced struct
declaration, addressing this exhibit in full.