Submitted by pashov
VTVLVesting.sol#L174
In the _baseVestedAmount of VTVLVesting.sol we see the following code
Lets look at truncatedCurrentVestingDurationSecs as just the duration passed from the start of the vesting period for the PoC (this doesnt omit important data in this context).
Now think of the following scenario:
We have a token $TKN that has 6 decimals (those are the decimals of both USDT & USDC). We want to distribute 10,000 of those tokens to a user vested over a 10 year period.
10 years in seconds is 315360000 ****(this is finalVestingDurationSecs)
This means that we will distribute 10,000 * 10^6 = 10 000 000 000 fractions of a token for 315360000 seconds, meaning we will distribute 310 fractions of a token each second - this is linearVestAmount
Now, since finalVestingDurationSecs is so big (315360000) it will almost always round linearVestAmount to zero when dividing by it, up until
_claim.linearVestAmount * truncatedCurrentVestingDurationSecs becomes a bigger number than 315360000, but since _claim.linearVestAmount is 310 we will need the current vesting duration to be at least 1 017 290 seconds which is 12 days postponed vesting. 12 days in a moving market can make a big difference if the user was expecting the tokens to start vesting from the first day.
Unexpected postponing of vesting can result in waiting times for users to receive their must-be-vested tokens. This period can be used by other token holders to dump the token and decrease the price of it, resulting in a loss of capital for the vesting receiver.
Enforce the contract to work with only 18 decimal tokens with a require statement in the constructor.
0xean (judge) decreased severity to Medium and commented:
lawrencehui (VTVL) acknowledged, but disagreed with severity and commented:
0xean (judge) commented:
