Submitted by hals, also found by ether_sky, visualbits, m4ttm, and btk
Curves protocol incentivize users to buy subjects and hold it for a prolonged time to receive high rewards, and the claimable rewards amount entitled for each user is calculated based on the user subject balance times the difference between the subject cumulativeFeePerToken and the users userFeeOffset of that subject, where the users userFeeOffset is updated whenever he buys or sells that specific subject:
The cumulativeFeePerToken is updated by an increment of msg.value / PRECISION, where msg.value represents the holdersFee amount that is deducted from each selling/purchase price of each subject token, and this value is accumulated to be claimed later by that subject holders (via FeeSplitter.addFees function):
But theres an issue with this implementation:
This issue is presented in the PoC section below, where all subject holders claim their rewards while theres still a stuck amount of that subject rewards in the contract.
FeeSplitter.addFees function
Foundry
Implement a mechanism to utilize these stuck rewards or withdraw them; or modify the current rewarding mechanism to prevent any stuck rewards in the future.
andresaiello (Curves) acknowledged
Note: For full discussion, see here.
