Skip to content

Code4rena

Forte: Float128 Solidity Library

Every publicly disclosed report for Forte: Float128 Solidity Library and what kind of bugs they were.

disclosed reports
6
most reported class
Smart contracts
bug classes found
2
first disclosure
2025
Find Forte: Float128 Solidity Library on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Forte: Float128 Solidity Library chose to make public.

Audit finding

Early 72-digit adjustment in sqrt will lead to incorrect result exponent calculation

The sqrt function in a Solidity fixed-point library incorrectly halves the exponent after adjusting the mantissa, causing an off-by-one error in the result exponent for large inputs. This leads to a result that is off by a factor of 10, producing blatantly wrong calculations.

Forte: Float128 Solidity Library

High
Audit finding

Inconsistent mantissa size auto-scaling between packedFloat encoding and calculations will lead to unacceptable rounding errors

The library's packedFloat encoding and its arithmetic operations apply different rules for choosing the mantissa size, so values with very small exponents keep 72-digit mantissas when encoded but lose those extra digits during addition and subtraction. This inconsistency produces rounding errors of 9 ULPs, far above the library's stated tolerance of 1 ULP for add and sub.

Forte: Float128 Solidity Library

Medium
Smart contracts

Natural logarithm function silently accepts invalid non-positive inputs

The natural logarithm function in a Solidity library accepts negative numbers and zero without validation, silently returning mathematically invalid results instead of reverting. An attacker could exploit this to cause incorrect calculations in any system relying on the library.

Forte: Float128 Solidity Library

High
Smart contracts

Unwrapping while equating inside the eq function fails to account for the set L_MATISSA_FLAG

The Float128 library's equality function compares the raw bit patterns of two packed floats, so two values that represent the same number but use different mantissa sizes (38-digit vs 72-digit) are reported as unequal. An attacker could exploit this to cause incorrect equality checks in contracts using the library.

Forte: Float128 Solidity Library

High
Audit finding

Precision loss in toPackedFloat function when mantissa is in range ( MAX_M_DIGIT_NUMBER , MIN_L_DIGIT_NUMBER )

The toPackedFloat function in a Solidity fixed-point library decides the output mantissa size based only on the exponent, ignoring the actual number of digits in the input mantissa. When the mantissa has more digits than the medium format allows but the exponent is small, the function downcasts to a smaller format and loses precision, which then propagates to arithmetic operations like multiplication.

Forte: Float128 Solidity Library

High