The contract is designed to distribute RAAC rewards to users (based on their deposits) and managers (based on their allocations). However, the code only distributes rewards to users, completely ignoring managers.
Assume:
Liquidity Pool deposits 1000 RAAC into the StabilityPool.
Total manager allocations = 300 (e.g., Manager A: 100, Manager B: 200).
Total user deposits = 700 deToken.
depositRAACFromPool(1000) is called by the liquidity pool. The entire 1000 RAAC remains in the StabilityPool contract.
Managers should receive 300 RAAC (proportional to their allocations).
Users should receive the remaining 700 RAAC.
what happens:
All 1000 RAAC is treated as user rewards. Managers get 0
A user with 350 deToken (50% of the total 700 deToken) calls withdraw.
calculateRaacRewards computes and the user receives 500 RAAC (50% of the total pool). However User should receive 350 RAAC (50% of the user-specific 700 RAAC pool).
The remaining 300 RAAC should have gone to managers. User claims 500 RAAC (50% of the entire 1000 RAAC), over-rewarding them by 150 RAAC and Managers receive nothing.
The depositRAACFromPool function has a TODO but no code to split RAAC between managers and users. All RAAC is treated as user rewards. calculateRaacRewards uses the total RAAC balance (including the portion meant for managers) to calculate user rewards:
Managers lose rewards
Foundry
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.