Unsafe type casting #195
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
LinearVesting
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/tokens/vesting/LinearVesting.sol#L137-L138
Downcasting from uint256/int256 in Solidity does not revert on overflow. This can easily result in undesired exploitation or bugs.
Recommendation
Consider using
SafeCast
library from OpenZeppelin.https://docs.openzeppelin.com/contracts/4.x/api/utils#SafeCast
The text was updated successfully, but these errors were encountered: