Based on the implementation of RWAVotingEscrow::burn, a user is able to burn their NFT early by incurring a fee. The VotingEscrowVesting::claim function, however, denotes that it should only be invoke-able when the vesting period has completed which contradicts its implementation.
Example:
/**
* @dev Claims the underlying locked tokens of a vested VotingEscrow token, effectively burning the VotingEscrow
* token. The function can only be called once the vesting period has completed.
*
* @param receiver The address to receive the underlying locked tokens.
* @param tokenId The identifier of the VotingEscrow token to be claimed.
* The VotingEscrow token is burned, and the locked tokens are transferred to the receiver.
*/
function claim(address receiver, uint256 tokenId) external nonReentrant {
if (depositors[tokenId] != msg.sender) {
revert NotAuthorized(msg.sender);
}
VestingSchedule storage tokenSchedule = vestingSchedules[tokenId];
uint256 endTime = tokenSchedule.endTime;
uint256 remainingTime;
if (endTime > block.timestamp) {
unchecked {
remainingTime = endTime - block.timestamp;
}
}
_removeTokenFromDepositorEnumeration(msg.sender, tokenId);
delete vestingSchedules[tokenId];
votingEscrow.updateVestingDuration(tokenId, remainingTime);
votingEscrow.burn(receiver, tokenId);
}
Recommendation:
We advise the documentation to be corrected as we consider the early claim possibility to be desirable per the implementation of RWAVotingEscrow::burn.
VEV-02M: Misleading Documentation of Function
Description:
Based on the implementation of
RWAVotingEscrow::burn
, a user is able to burn their NFT early by incurring a fee. TheVotingEscrowVesting::claim
function, however, denotes that it should only be invoke-able when the vesting period has completed which contradicts its implementation.Example:
Recommendation:
We advise the documentation to be corrected as we consider the early claim possibility to be desirable per the implementation of
RWAVotingEscrow::burn
.