Submitted by Shubham, also found by ABAIKUNANBAEV
https://github.com/code-423n4/2024-12-secondswap/blob/main/contracts/SecondSwap_StepVesting.sol#L225
Vestings can be transferred to another address by a trusted authority. All the necessary parameters are recalculated like the totalAmount & releaseRate for the current owner for the vesting.
However it is possible that a call to transfer the vesting might be frontrun where the owner of the original vesting claims their token resulting in an overall revert.
Users can call the claim() to claim their tokens depending on the timespan they were deposited for.
transferVesting() creates a new vesting for the new owner making necessary calculations to ensure that the previous owner does not experience any loss.
Scenario
In the above situation, if Bobs entire amount is claimable & he frontruns the call to transferVesting(), no transfer of vesting is possible to another address.
A way would be to pause claiming of tokens when transferring to avoid this issue & unpause later.
calvinx (SecondSwap) commented:
Koolex (judge) commented:
ABAIKUNANBAEV (warden) commented:
Koolex (judge) commented:
