After every reward epoch, user is entitled to get the reward from FTSO delegator based on VP token balance in vault - recentDeposit (since epoch uses snap shots, user will not get the reward for the epoch in which they deposited, they get it starting the next one).
We keep track of which reward epoch a particular user has withdrawn reward for but there is no limit on how far they can go back.
Exploit:
User A has VP token balance X that they received reward for up to Epoch Y (latest)
User A's vault is liquidated due to undercollateralization - note that for reward for VP token balance X is already claimed
User B bought User A's balance X but User B has only claimed reward from delegator for up to Epoch Y - N.
Now User B can claim reward for User A's balance X from Epoch (Y - N ) to Epoch Y.
Potential solution:
Limit the number of epoch that can go unclaimed
The idea here to make sure people stay up to date on the reward they claim
Buyer of VP token asset from auctioneer will need to claim reward before receiving the Seller's token (add a check in auctioneer)
After every reward epoch, user is entitled to get the reward from FTSO delegator based on VP token balance in vault - recentDeposit (since epoch uses snap shots, user will not get the reward for the epoch in which they deposited, they get it starting the next one). We keep track of which reward epoch a particular user has withdrawn reward for but there is no limit on how far they can go back.
Exploit: User A has VP token balance X that they received reward for up to Epoch Y (latest) User A's vault is liquidated due to undercollateralization - note that for reward for VP token balance X is already claimed User B bought User A's balance X but User B has only claimed reward from delegator for up to Epoch Y - N. Now User B can claim reward for User A's balance X from Epoch (Y - N ) to Epoch Y.
Potential solution: