The _initializeFeeTypes function is responsible for setting default fee distributions for various protocol operations. However, an issue has been identified where Fee Type 6 and 7 were not capped at 100% during initialization, while the updateFeeType function enforces strict validation requiring fee distributions to sum to 100% (BASIS_POINTS). This inconsistency forces Fee Type 6 and 7 to be set at 100% when updated, which may not align with their intended design.
Fee Type 6 and 7 Not Capped at 100% in Initialization
In _initializeFeeTypes, Fee Type 6 and 7 were set with a total distribution of 2% rather than 100%.
This discrepancy does not trigger any validation during contract deployment since _initializeFeeTypes lacks a validation check.
Strict Validation in updateFeeType Enforces a 100% Cap
The updateFeeType function enforces that all fee shares must sum to 100%.
Since Fee Type 6 and 7 were initialized with a sum of 2%, any attempt to update them forces a change to 100%, which alters the original allocation logic.
Potential Issues
The enforced 100% requirement on updates might misalign with the protocol's intended fee distribution for Fee Type 6 and 7.
If Fee Type 6 and 7 are meant to represent a fraction of an external fee structure (e.g., 2% of a transaction rather than 100% of an internal allocation), the update function’s strict validation prevents maintaining their proportional structure.
This inconsistency can cause confusion for developers and auditors reviewing the contract logic.
Governance will be forced to set Fee Type 6 and 7 at 100% during updates, which may not reflect their intended distribution.
Unexpected contract behavior could arise if Fee Type 6 and 7 are adjusted incorrectly due to the enforced 100% validation.
The inconsistency between initialization and update logic could lead to governance and operational challenges.
Manual code review
Ensure Fee Type 6 and 7 Maintain Their Intended Proportional Allocation
Modify _initializeFeeTypes to either set Fee Type 6 and 7 at 100% or establish a separate validation rule for proportionally allocated fees.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.