When the FeeCollector
contract is deployed, the different fee types are initialized by invoking _initializeFeeTypes(). The problem is that the swap fees and NFT royalty fees are initialized with the wrong amount which will inflate the received shares.
As can be seen the swap fee must be in total 2% along with the NFT royalty fee (denominated in BPS, i.e 10000 = 100%).
10000 = 100%
1000 = 10%
100 = 1%
10 = 0.1%
The problem is that 500
equals 5% and 1000
equal 10%. That means the total collected fees will be 20% with 18% more than intended.
A very brief example would be:
feeAmount = 0.01 ETH
totalFees = 1e18
weight = 0.01 * 10000 / 1e18 = 100
for example let's take the repair share, the formula would be:
100 (weight) * 1000 (the % set upon deployment) / 10000 (BPS) = 10 shares
but actually the correct formula should be:
100 * 100 (instead of 1000) / 10000 = 1 shares
The shares will be inflated and the collector will over-reward the recipients.
Over-rewarding the fee recipients, although there is an update function:
Here the logic requires new total of fees to be 100% otherwise the call reverts, but as can be seen from the code the intention for swap fees and NFT fee is to be only 2%. Overall this is not intended behaviour and cannot be fixed until the devs decide to allocate 100% by calling the update function it will inflate the fees. For this reason i consider this as Low
severity.
Manual Review
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.