Fee recipient share on Market Making Engine cannot be properly configured due to incorrect shares checking.
Market Making Engine owner can call configureFeeRecipient() to configure fee share to an recipient.
This function checks if share is greater than zero to verify the total will not exceed the maximum shares, by comparing totalFeeRecipientsSharesX18 + share
to Constants.MAX_CONFIGURABLE_PROTOCOL_FEE_SHARES
.
MarketMakingEngineConfigurationBranch::configureFeeRecipient():
The checking is incorrect and may fail if the configured fee recipient has non-zero old share. Assuming:
The Perp Engine is configured with 60% fee share, totalFeeRecipientsSharesX18
is 60%;
Later owner tries to update the Perp Engine's fee share to 40% by calling **configureFeeRecipient()
**and specifying share
to 40%;
Protocol compares totalFeeRecipientsSharesX18 + share
to Constants.MAX_CONFIGURABLE_PROTOCOL_FEE_SHARES
which is 90%, because 60% + 40% > 90%, then transaction will be reverted and the new share cannot be configured.
Please run the coded POC in configureFeeRecipieint.t.sol
:
Fee recipient cannot be configured.
Manual Review
Comparing totalFeeRecipientsSharesX18 + share - oldFeeRecipientShares
to Constants.MAX_CONFIGURABLE_PROTOCOL_FEE_SHARES
:
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.