In the StabilityPool.sol contract the totalAllocation variable is used for both managers and markets, which dilutes the allocation for managers when calculating their shares.
The vulnerability arises from the use of a single totalAllocation variable to represent the combined allocation for both managers and markets. This approach dilutes the allocation for managers when calculating their shares, as the total allocation includes both manager and market allocations. According to the comment above the getTotalAllocation function, totalAllocation should only contain the allocation across all managers.
By diluting the allocation for managers, the protocol may incorrectly distribute rewards and resources, leading to unfair compensation for managers. This can result in reduced incentives for managers to participate and perform their roles effectively. Over time, this can undermine the stability and efficiency of the protocol, as managers may be less motivated to contribute.
Manual Review
To mitigate this vulnerability, separate the allocation tracking for managers and markets. Introduce a new variable, totalMarketAllocation, to track the total allocation for markets. Update the relevant functions to use the correct allocation variables. Here is an example of how to implement this:
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.