Closed sherlock-admin2 closed 5 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid: points are said to be nothing of value by the sponsor
We have not found a test scenario where the user's unlockable token balance decreases after a new mint. The locked time extension ensures that the user always gets their vested tokens even after a new mint. A POC would be good to prove otherwise. Whilst this design makes the accounting very simple and scales well (doesn't need to track individual mints), there are some drawbacks where the user may be at an advantage to unlock their almost fully vested tokens before minting more.
Added a test PR to disprove issue #204 https://github.com/dhedge/flatcoin-v1/pull/268
xiaoming90
medium
Unlock of points can be delayed infinitely
Summary
The unlock of points can be delayed infinitely as long as the users interact with the protocol frequently. As a result, points that have already been unlocked (already passed the
unlockTaxVest
) will be locked up again, preventing users from exchanging their points for something of value.Vulnerability Detail
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/PointsModule.sol#L142
Based on the above code, the unlock time can be continuously delayed by normal user actions:
Initial Mint: A user mints 100 tokens at time
t0
. The initial unlock time is set tot0 + 360 days
(360 days being theunlockTaxVest
period).Additional Mint after 180 Days: The user mints an additional 50 tokens 180 days after the initial mint, the new unlock time will be as follows:
The new unlock date (T0 + 420) is 60 days later than the initial one (T0 + 360).
Therefore, each subsequent minting of tokens can extend the unlock period. This can lead to a situation where users who frequently mint additional tokens or interact with the protocol may continuously push back their unlock time.
The only way to unlock the point entirely is to stop using the protocol for 360 days so as to prevent the unlock date from being pushed further.
Impact
Points that have already been unlocked (already passed the
unlockTaxVest
) will be locked up again, preventing users from exchanging their points for something of valueCode Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/PointsModule.sol#L142
Tool used
Manual Review
Recommendation
Consider not delaying the unlock date for existing points when new points are minted. Implement a more sophisticated approach to tracking the unlock date of the points minted at different points in time.