Submitted by BugPull, also found by 0xrex, 0XRolko, BugPull, Drynooo, KupiaSec, montecristo, Ryonen, SmartAuditPro, and TheFabled
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_StepVesting.sol#L172-L181
https://github.com/code-423n4/2024-12-secondswap/blob/214849c3517eb26b31fe194bceae65cb0f52d2c0/contracts/SecondSwap_StepVesting.sol#L196-L199
A user who buys vesting tokens after fully claiming their allocation at the end of the vesting period will be unable to claim the newly acquired tokens.
in some cases due to rounding issues the
- stepsClaimed > numOfSteps
In claimable function claimableSteps is calculated as follow:
For that the user cannot claim newly purchased amounts.
Scenario
Numerical Example
Assumptions:
Calculation:
This results in:
After Purchasing More Tokens:
Assuming the issue in the create function is mitigated as stated in another report:
Bob successfully buys additional tokens. However, when he tries to claim them:
The function always reverts due to the incorrect check.
Apply the following correction to the claimable function:
Koolex (judge) commented:
