Closed sherlock-admin2 closed 3 months ago
bareli
Medium
when amount is equal to value then split will revert.
function split(uint _tokenId,uint amount) external { // check permission and vote require(attachments[_tokenId] == 0 && !voted[_tokenId], "attached"); require(_isApprovedOrOwner(msg.sender, _tokenId)); require(!blockedSplit[_tokenId],"split blocked"); // save old data and totalWeight address _to = idToOwner[_tokenId]; LockedBalance memory _locked = locked[_tokenId]; uint end = _locked.end; uint value = uint(int256(_locked.amount)); @>> require(value > amount,"amount > value");
split will revert then value is equal to amount.
https://github.com/sherlock-audit/2024-06-velocimeter/blob/main/v4-contracts/contracts/VotingEscrow.sol#L1229
Manual Review
require(value >= amount,"amount > value");
Invalid, if amount == value locked, there is nothing to split, so no issue here
bareli
Medium
split will not work when "amount" is equal to "value"
Summary
when amount is equal to value then split will revert.
Vulnerability Detail
Impact
split will revert then value is equal to amount.
Code Snippet
https://github.com/sherlock-audit/2024-06-velocimeter/blob/main/v4-contracts/contracts/VotingEscrow.sol#L1229
Tool used
Manual Review
Recommendation
require(value >= amount,"amount > value");