According to the contract,
finalVestedAmount function calculates the total vested at the end of the schedule.
vestedAmount function calculates the amount vested for a given _recipient at a reference timestamp.
claimableAmount function Calculates how much can we claim, by subtracting the already withdrawn amount from the vestedAmount at this moment.
But there is a missing check for if the claim is active or not.
Lines of code
https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L206 https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L215 https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L196
Vulnerability details
Impact
According to the contract,
finalVestedAmount
function calculates the total vested at the end of the schedule.vestedAmount
function calculates the amount vested for a given _recipient at a reference timestamp.claimableAmount
function Calculates how much can we claim, by subtracting the already withdrawn amount from the vestedAmount at this moment.But there is a missing check for if the claim is active or not.
Proof of Concept
https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L206
https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L196
https://github.com/code-423n4/2022-09-vtvl/blob/main/contracts/VTVLVesting.sol#L215
Tools Used
Manual Analysis
Recommended Mitigation Steps
Add check as shown below: