Omniscia Alliance Block Audit

LibFeeCalculator Manual Review Findings

LibFeeCalculator Manual Review Findings

LFC-01M: Unfair Fee Distribution

Description:

The addNewMember function should snapshot any accrued reward up to the point the new member is added to be distributed to the previous members as the current system is unfair.

Example:

contracts/libraries/LibFeeCalculator.sol
41function addNewMember(address account) internal {
42 LibFeeCalculator.Storage storage fcs = feeCalculatorStorage();
43 fcs.claimedRewardsPerAccount[account] = fcs.accumulator;
44}

Recommendation:

We strongly recommend the addNewMember function to perform the first 4 steps of claimReward to ensure that rewards are distributed to the previously existing members as each addNewMember would dilute the latest accrued fees unfairly.

Alleviation:

Rewards are now properly distributed to existing members when a new member is introduced.