Omniscia Boson Protocol Audit
OrchestrationHandlerFacet Code Style Findings
OrchestrationHandlerFacet Code Style Findings
CON-01C: Redundant Modifier Overlap
Type | Severity | Location |
---|---|---|
Gas Optimization | ![]() | OrchestrationHandlerFacet.sol:L147, L338, L414, L496, L585-L590 |
Description:
The linked modifier
applications contain redundant overlap that leads to an increased execution cost as certain external
functions invoke public
functions that apply a portion of their modifier
declarations.
Example:
contracts/protocol/facets/OrchestrationHandlerFacet.sol
404function createSellerAndOfferWithCondition(405 Seller memory _seller,406 Offer memory _offer,407 OfferDates calldata _offerDates,408 OfferDurations calldata _offerDurations,409 uint256 _disputeResolverId,410 Condition calldata _condition,411 AuthToken calldata _authToken,412 VoucherInitValues calldata _voucherInitValues,413 uint256 _agentId414) external override sellersNotPaused offersNotPaused groupsNotPaused orchestrationNotPaused {415 checkAndCreateSeller(_seller, _authToken, _voucherInitValues);416 createOfferWithCondition(_offer, _offerDates, _offerDurations, _disputeResolverId, _condition, _agentId);417}
Recommendation:
We advise the modifier
overlaps to be detected and omitted from the outer-most call to minimize the execution cost of the contract.
Alleviation (44009967e4f68092941d841e9e0f5dd2bb31bf0b):
All modifier
overlaps have been properly omitted thus optimizing the codebase's gas cost whilst retaining the same security guarantees.