There is a logical error in the MarketMakingEngineConfigurationBranch::configureFeeRecipient that causes unwanted reverts when attempting to decrease an existing fee recipient’s share. The function checks the new share against the maximum configurable protocol fee limit before subtracting the old share. As a result, legitimate updates to an existing recipient’s share can incorrectly revert.
The bug occurs in the following lines in MarketMakingEngineConfigurationBranch::configureFeeRecipient :
This check adds the new share to marketmakingengineconfiguration::totalFeeRecipientsShares before subtracting the old share value. The total should first be decreased by the old share before the new share is added. Otherwise, a legitimate update (from a higher share to a lower share) will revert unnecessarily.
The order of operations in the share calculation is incorrect. The function does not account for the fact that the old share value should first be subtracted from the total fee recipients’ shares before verifying that the new share fits under the maximum limit.
This bug can block legitimate reconfigurations of fee shares. Administrators may be prevented from decreasing a fee recipient’s share if the sum of current total shares plus the new share appears to exceed the limit—even when the final configuration would be valid. This can halt necessary protocol governance or maintenance procedures, which may include Adjusting fee splits as market conditions change or correcting an over-allocated fee distribution.
Manual Review, Foundry
The proposed fix properly reorders the logic to subtract the old fee recipient share before adding the new share, avoiding unwanted reverts. By using a “preview” total (subtracting oldFeeRecipientShares from the existing total) and then adding the new share for the limit check, you ensure no valid configuration is blocked when reducing a fee recipient’s share. This solution also maintains the integrity of the maximum fee constraint.
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.