Omniscia Evergon Labs Audit

TransferFundsOnAddMarginFacet Code Style Findings

TransferFundsOnAddMarginFacet Code Style Findings

TFA-01C: Redundant Named Function Arguments

TypeSeverityLocation
Gas OptimizationTransferFundsOnAddMarginFacet.sol:
I-1: L19
I-2: L21

Description:

The TransferFundsOnAddMarginFacet::initDoAddMarginFacet and TransferFundsOnAddMarginFacet::setAndCheckDoAddMargin functions will redundantly use an explicit name for their input argument even though it remains unused.

Example:

packages/contracts/contracts/subInternalFacets/marginCallPhaseFacets/doAddMarginFacets/transferFundsOnAddMargin/TransferFundsOnAddMarginFacet.sol
19function initDoAddMarginFacet(bytes calldata initDoAddMarginData) external onlyExternalDelegateCall {}

Recommendation:

We advise the explicit name to be removed on each instance, ensuring the function still adheres to the desired function selector yet does not waste extraneous gas.

Alleviation (71cda4ccfdcfa25fb96a4565f1f8143b350dd246):

The redundantly named input arguments have been omitted as advised, optimizing the code's gas cost as well as syntax.