sherlock-audit / 2024-08-flayer-judging

0 stars 0 forks source link

Happy Green Chimpanzee - Unsafe Casting #804

Closed sherlock-admin4 closed 4 days ago

sherlock-admin4 commented 4 days ago

Happy Green Chimpanzee

Low/Info

Unsafe Casting

Vulnerability Detail

Downcasting int/uints in Solidity can be unsafe due to the potential for data loss and unintended behavior.When downcasting a larger integer type to a smaller one (e.g., uint256 to uint128), the value may exceed the range of the target type,leading to truncation and loss of significant digits. Use OpenZeppelin's SafeCast library to safely downcast integers.

Impact

Leads to loss of value

Code Snippet

Found in InfernalRiftAbove.sol Line: 288

            royaltyBps_ = uint96(_royaltyAmount);

Tool used

Manual Review