In Solidity would not directly compile because Solidity does not recognize 0.1 or 0.01 as a valid number for computation in its native types. Solidity does not support real numbers or floating-point arithmetic directly.
Vulnerability Detail
In Solidity, when assigning such values to state variables or manipulating them in smart contracts, ensure you handle these scaled integers consistently across all calculations to avoid precision errors or overflow/underflow bugs.
Wrong percentage calculation
Low/Info issue submitted by NoOne
Summary
In Solidity would not directly compile because Solidity does not recognize
0.1
or0.01
as a valid number for computation in its native types. Solidity does not support real numbers or floating-point arithmetic directly.Vulnerability Detail
In Solidity, when assigning such values to state variables or manipulating them in smart contracts, ensure you handle these scaled integers consistently across all calculations to avoid precision errors or overflow/underflow bugs.
Impact
Code Snippet
function __BaseLSTAdapter_init
BaseLSTVault.sol
BaseLSTVault.sol
Tool used
Manual Review
Recommendation
use this
$.targetBufferPercentage = 10**17
for $.targetBufferPercentageuse this targetBufferPercentage = 10**17 for targetBufferPercentage
and this
MIN_BUFFER_PERCENTAGE = 1e16
for MIN_BUFFER_PERCENTAGE