Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: try running prb-math solidity tests in the example-project #5808

Closed
wants to merge 5 commits into from

Conversation

galargh
Copy link
Member

@galargh galargh commented Oct 7, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

This PR is a showcase of running solidity tests of a real world project with Hardhat v3. The tests use the standard library.

Here's the successful output from pnpm hardhat test:solidity:

Compiled 96 Solidity files successfully (evm target: unknown evm version for solc version 0.8.25).

Running Solidity tests...

✔ Ceil_Unit_Test | test_Ceil_Negative()
✔ Ceil_Unit_Test | test_Ceil_Positive()
✔ Ceil_Unit_Test | test_Ceil_Zero()
✔ Ceil_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ ConvertFrom_Unit_Test | test_ConvertFrom()
✔ ConvertFrom_Unit_Test | test_ConvertFrom_LtAbsoluteUnit()
✔ Abs_Unit_Test | test_Abs()
✔ Abs_Unit_Test | test_Abs_Negative()
✔ Abs_Unit_Test | test_Abs_Zero()
✔ Abs_Unit_Test | test_RevertWhen_MinSD59x18()
✔ CastingUint40_Test | testFuzz_intoSD1x18(uint40) (256 runs)
✔ CastingUint40_Test | testFuzz_intoSD59x18(uint40) (256 runs)
✔ CastingUint40_Test | testFuzz_intoUD2x18(uint40) (256 runs)
✔ CastingUint40_Test | testFuzz_intoUD60x18(uint40) (256 runs)
✔ Avg_Unit_Test | test_Avg_BothOperandsEven()
✔ Avg_Unit_Test | test_Avg_BothOperandsNegative()
✔ Avg_Unit_Test | test_Avg_BothOperandsOdd()
✔ Avg_Unit_Test | test_Avg_BothOperandsZero()
✔ Avg_Unit_Test | test_Avg_OneOperandEvenTheOtherOdd()
✔ Avg_Unit_Test | test_Avg_OneOperandNegativeTheOtherPositive()
✔ Avg_Unit_Test | test_Avg_OnlyOneOperandZero()
✔ CeilTest | test_Ceil()
✔ CeilTest | test_Ceil_Zero()
✔ CeilTest | test_RevertWhen_GtMaxPermitted()
✔ ConvertFrom_Unit_Test | test_ConvertFrom()
✔ ConvertFrom_Unit_Test | test_ConvertFrom_LtUnit()
✔ ConvertTo_Unit_Test | test_ConvertTo()
✔ ConvertTo_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ ConvertTo_Unit_Test | test_RevertWhen_LtMinPermitted()
✔ ConvertTo_Unit_Test | test_ConvertTo()
✔ ConvertTo_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ CounterTest | testInc()
✔ CounterTest | testInitialValue()
✔ Div_Unit_Test | test_Div()
✔ Div_Unit_Test | test_Div_NumeratorZero()
✔ Div_Unit_Test | test_RevertWhen_DenominatorZero_Function()
✔ Div_Unit_Test | test_RevertWhen_DenominatorZero_Operator()
✔ Div_Unit_Test | test_RevertWhen_ResultOverflowUD60x18_Function()
✔ Div_Unit_Test | test_RevertWhen_ResultOverflowUD60x18_Operator()
✔ Exp2_Unit_Test | test_Exp2()
✔ Exp2_Unit_Test | test_Exp2_Zero()
✔ Exp2_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ CastingUint128_Test | testFuzz_RevertWhen_OverflowSD1x18(uint128) (256 runs)
✔ CastingUint128_Test | testFuzz_RevertWhen_OverflowUD2x18(uint128) (256 runs)
✔ CastingUint128_Test | testFuzz_intoSD1x18(uint128) (256 runs)
✔ CastingUint128_Test | testFuzz_intoSD59x18(uint128) (256 runs)
✔ CastingUint128_Test | testFuzz_intoUD2x18(uint128) (256 runs)
✔ CastingUint128_Test | testFuzz_intoUD60x18(uint128) (256 runs)
✔ Avg_Unit_Test | test_Avg_BothOperandsZero()
✔ Avg_Unit_Test | test_Avg_NeitherOperandZero_BothOperandsEven()
✔ Avg_Unit_Test | test_Avg_NeitherOperandZero_BothOperandsOdd()
✔ Avg_Unit_Test | test_Avg_NeitherOperandZero_OneOperandEvenTheOtherOdd()
✔ Avg_Unit_Test | test_Avg_OnlyOneOperandZero()
✔ Floor_Unit_Test | test_Floor_Positive()
✔ Floor_Unit_Test | test_Floor_Zero()
✔ Exp_Unit_Test | test_Exp()
✔ Exp_Unit_Test | test_Exp_Zero()
✔ Exp_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ Exp_Unit_Test | test_Exp_Negative_GteMinPermitted()
✔ Exp_Unit_Test | test_Exp_Negative_LtThreshold()
✔ Exp_Unit_Test | test_Exp_Positive_LteMaxPermitted()
✔ Exp_Unit_Test | test_Exp_Zero()
✔ Exp_Unit_Test | test_RevertWhen_Positive_GtMaxPermitted()
✔ Exp2_Unit_Test | test_Exp2_Negative_GteMinPermitted()
✔ Exp2_Unit_Test | test_Exp2_Negative_LtThreshold()
✔ Exp2_Unit_Test | test_Exp2_Positive_LTePermittedMax()
✔ Exp2_Unit_Test | test_Exp2_Zero()
✔ Exp2_Unit_Test | test_RevertWhen_Positive_GtMaxPermitted()
✔ Frac_Unit_Test | test_Frac()
✔ Frac_Unit_Test | test_Frac_Zero()
✔ Div_Unit_Test | test_Div_NumeratorDenominatorDifferentSign()
✔ Div_Unit_Test | test_Div_NumeratorDenominatorSameSign()
✔ Div_Unit_Test | test_Div_NumeratorZero()
✔ Div_Unit_Test | test_RevertWhen_DenominatorMinSD59x18_Function()
✔ Div_Unit_Test | test_RevertWhen_DenominatorMinSD59x18_Operator()
✔ Div_Unit_Test | test_RevertWhen_DenominatorZero_Function()
✔ Div_Unit_Test | test_RevertWhen_DenominatorZero_Operator()
✔ Div_Unit_Test | test_RevertWhen_NumeratorMinSD59x18_Function()
✔ Div_Unit_Test | test_RevertWhen_NumeratorMinSD59x18_Operator()
✔ Div_Unit_Test | test_RevertWhen_ResultOverflowSD59x18_Function()
✔ Div_Unit_Test | test_RevertWhen_ResultOverflowSD59x18_Operator()
✔ Gm_Unit_Test | test_Gm()
✔ Gm_Unit_Test | test_Gm_OneOperandZero()
✔ Gm_Unit_Test | test_RevertWhen_ProductNegative_A()
✔ Gm_Unit_Test | test_RevertWhen_ProductNegative_B()
✔ Gm_Unit_Test | test_RevertWhen_ProductOverflow_A()
✔ Gm_Unit_Test | test_RevertWhen_ProductOverflow_B()
✔ Gm_Unit_Test | test_RevertWhen_ProductOverflow_C()
✔ Gm_Unit_Test | test_RevertWhen_ProductOverflow_D()
✔ Inv_Unit_Test | test_Inv_Negative()
✔ Inv_Unit_Test | test_Inv_Positive()
✔ Inv_Unit_Test | test_RevertWhen_Zero()
✔ Gm_Unit_Test | test_Gm()
✔ Gm_Unit_Test | test_Gm_OneOperandZero()
✔ Gm_Unit_Test | test_RevertWhen_ProductOverflows()
✔ Inv_Unit_Test | test_Inv()
✔ Inv_Unit_Test | test_RevertWhen_Zero()
✔ Casting_Fuzz_Test | testFuzz_IntoSD59x18(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_IntoUD2x18(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_IntoUD60x18(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_IntoUint128(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_IntoUint256(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_IntoUint40(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint40(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUD2x18(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUD60x18(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint128(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint256(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint40(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_Unwrap(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_Wrap(int64) (256 runs)
✔ Casting_Fuzz_Test | testFuzz_sd1x18(int64) (256 runs)
✔ Frac_Unit_Test | test_Frac()
✔ Frac_Unit_Test | test_Frac_Negative()
✔ Frac_Unit_Test | test_Frac_Zero()
✔ Floor_Unit_Test | test_Floor_Negative_GteMinPermitted()
✔ Floor_Unit_Test | test_Floor_Positive()
✔ Floor_Unit_Test | test_Floor_Zero()
✔ Floor_Unit_Test | test_RevertWhen_Negative_LtMinPermitted()
✔ Ln_Unit_Test | test_Ln()
✔ Ln_Unit_Test | test_RevertWhen_LtUnit()
✔ Log10_Unit_Test | test_Log10_NotPowerOfTen()
✔ Log10_Unit_Test | test_Log10_PowerOfTen()
✔ Log10_Unit_Test | test_RevertWhen_LtUnit()
✔ Ln_Unit_Test | test_Ln()
✔ Ln_Unit_Test | test_RevertWhen_Negative()
✔ Ln_Unit_Test | test_RevertWhen_Zero()
✔ Log10_Unit_Test | test_Log10_NotPowerOfTen()
✔ Log10_Unit_Test | test_Log10_PowerOfTen()
✔ Log10_Unit_Test | test_RevertWhen_Negative()
✔ Log10_Unit_Test | test_RevertWhen_Zero()
✔ Log2_Unit_Test | test_Log2_NotPowerOfTwo()
✔ Log2_Unit_Test | test_Log2_PowerOfTwo()
✔ Log2_Unit_Test | test_RevertWhen_LtUnit()
✔ Mul_Unit_Test | test_Mul_OneOperandZero()
✔ Mul_Unit_Test | test_Mul_OperandsDifferentSign()
✔ Mul_Unit_Test | test_Mul_OperandsSameSign()
✔ Mul_Unit_Test | test_RevertWhen_OneOperandMinSD59x18_Function()
✔ Mul_Unit_Test | test_RevertWhen_OneOperandMinSD59x18_Operator()
✔ Mul_Unit_Test | test_RevertWhen_ResultOverflowSD59x18_A()
✔ Mul_Unit_Test | test_RevertWhen_ResultOverflowSD59x18_B()
✔ Mul_Unit_Test | test_RevertWhen_ResultOverflowUint256()
✔ Log2_Unit_Test | test_Log2_NotPowerOfTwo()
✔ Log2_Unit_Test | test_Log2_PowerOfTwo()
✔ Log2_Unit_Test | test_RevertWhen_Negative()
✔ Log2_Unit_Test | test_RevertWhen_Zero()
✔ Mul_Unit_Test | test_Mul()
✔ Mul_Unit_Test | test_Mul_OneOperandZero()
✔ Mul_Unit_Test | test_RevertWhen_ResultOverflowUD60x18_Function()
✔ Mul_Unit_Test | test_RevertWhen_ResultOverflowUD60x18_Operator()
✔ CastingUint256_Test | testFuzz_RevertWhen_OverflowSD1x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_RevertWhen_OverflowSD59x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_RevertWhen_OverflowUD2x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_intoSD1x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_intoSD59x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_intoUD2x18(uint256) (256 runs)
✔ CastingUint256_Test | testFuzz_intoUD60x18(uint256) (256 runs)
✔ Powu_Unit_Test | test_Powu_BaseAndExponentZero()
✔ Powu_Unit_Test | test_Powu_BaseZeroExponentNotZero()
✔ Powu_Unit_Test | test_Powu_ExponentZero()
✔ Powu_Unit_Test | test_Powu_NegativeBase()
✔ Powu_Unit_Test | test_Powu_PositiveBase()
✔ Powu_Unit_Test | test_RevertWhen_ResultOverflowSD59x18()
✔ Powu_Unit_Test | test_RevertWhen_ResultOverflowUint256()
✔ Powu_Unit_Test | test_RevertWhen_ResultUnderflowSD59x18()
✔ Powu_Unit_Test | test_Powu()
✔ Powu_Unit_Test | test_Powu_BaseAndExponentZero()
✔ Powu_Unit_Test | test_Powu_BaseZeroExponentNotZero()
✔ Powu_Unit_Test | test_Powu_ExponentZero()
✔ Powu_Unit_Test | test_RevertWhen_ResultOverflowsUD60x18()
✔ Sqrt_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ Sqrt_Unit_Test | test_RevertWhen_Negative()
✔ Sqrt_Unit_Test | test_Sqrt()
✔ Sqrt_Unit_Test | test_Sqrt_Zero()
✔ Sqrt_Unit_Test | test_RevertWhen_GtMaxPermitted()
✔ Sqrt_Unit_Test | test_Sqrt()
✔ Sqrt_Unit_Test | test_Sqrt_Zero()
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Add(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_And(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Eq(uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Gt(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Gte(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_IsZero(uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Lshift(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Lt(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Lte(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Mod(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Neq(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Not(uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Or(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Rshift(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Sub(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_UncheckedAdd(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_UncheckedSub(uint256,uint256) (256 runs)
✔ UD60x18_Helpers_Fuzz_Test | testFuzz_Xor(uint256,uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowSD1x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowSD59x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUD2x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint128(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint40(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_UD60x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_Ud(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_Unwrap(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_Wrap(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoSD1x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoSD59x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoUD2x18(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoUint128(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoUint256(uint256) (256 runs)
✔ UD60x18_Casting_Fuzz_Test | testFuzz_intoUint40(uint256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_BaseUnit(int256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_BaseZero_ExponentNotZero(int256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_ExponentUnit(int256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_ExponentZero(int256) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoSD1x18(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoSD59x18(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoUD60x18(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoUint128(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoUint256(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_IntoUint40(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowSD1x18(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint40(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_Unwrap(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_Wrap(uint64) (256 runs)
✔ UD2x18_Casting_Fuzz_Test | testFuzz_ud2x18(uint64) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Add(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_And(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Eq(int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Gt(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Gte(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_IsZero(int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Lshift(int256,uint256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Lt(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Lte(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Mod(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Neq(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Not(int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Or(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Rshift(int256,uint256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Sub(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Unary(int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_UncheckedAdd(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_UncheckedSub(int256,int256) (256 runs)
✔ SD59x18_Helpers_Fuzz_Test | testFuzz_Xor(int256,int256) (256 runs)
✔ Pow_Unit_Test | test_Pow_BaseGtUnit()
✔ Pow_Unit_Test | test_Pow_BaseLtUnit()
✔ Pow_Unit_Test | test_Pow_BaseUnit()
✔ Pow_Unit_Test | test_Pow_BaseZero_ExponentNotZero()
✔ Pow_Unit_Test | test_Pow_BaseZero_ExponentZero()
✔ Pow_Unit_Test | test_Pow_ExponentUnit(uint256) (256 runs)
✔ Pow_Unit_Test | test_Pow_ExponentZero()
✔ Pow_Fuzz_Test | testFuzz_Pow_BaseUnit(uint256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_BaseZero_ExponentNotZero(uint256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_ExponentUnit(uint256) (256 runs)
✔ Pow_Fuzz_Test | testFuzz_Pow_ExponentZero(uint256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoInt256(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoSD1x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoUD2x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoUD60x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoUint128(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoUint256(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_IntoUint40(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowSD1x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUD2x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint128(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_OverflowUint40(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowSD1x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUD2x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUD60x18(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint128(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint256(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_RevertWhen_UnderflowUint40(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_Sd(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_Unwrap(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_Wrap(int256) (256 runs)
✔ SD59x18_Casting_Fuzz_Test | testFuzz_sd59x18(int256) (256 runs)
✔ Pow_Unit_Test | test_Pow_BaseUnit()
✔ Pow_Unit_Test | test_Pow_BaseZero_ExponentNotZero()
✔ Pow_Unit_Test | test_Pow_BaseZero_ExponentZero()
✔ Pow_Unit_Test | test_Pow_ExponentUnit()
✔ Pow_Unit_Test | test_Pow_ExponentZero()
✔ Pow_Unit_Test | test_Pow_NegativeExponent()
✔ Pow_Unit_Test | test_Pow_PositiveExponent()

I also tried breaking a test to make sure we're actually running them 😜

What did I do to make it work?

  1. I imported the standard library with pnpm (pnpm add https://github.com/foundry-rs/forge-std/tarball/v1.9.2)
  2. I imported the prb-math library with pnpm (pnpm add https://github.com/PaulRBerg/prb-math/tarball/v4.0.3; I did that so I wouldn't have to copy the src of prb-math to the example-project)
  3. I copied the test directory from node_modulels/@prb/math to the example-project (I also removed *.tree files; these likely should have been gitignored in the first place)
  4. I replaced all the absolute src imports (e.g. import from "src/...") with imports from the node dependency (@prb/math)
  5. I replaced all the relative src imports (e.g. import from "../../src/...") with imports from the node dependency (@prb/math)
  6. I run the solidity tests with hardhat (pnpm hardhat test:solidity)

Here's the forge test output for comparison:

$ forge test
[⠊] Compiling...
[⠊] Compiling 96 files with Solc 0.8.26
[⠒] Solc 0.8.26 finished in 4.03s
Compiler run successful!

Ran 3 tests for test/unit/ud60x18/math/ceil/ceil.t.sol:CeilTest
[PASS] test_Ceil() (gas: 512281)
[PASS] test_Ceil_Zero() (gas: 3615)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3757)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 10.82ms (801.75µs CPU time)

Ran 2 tests for test/unit/ud60x18/math/inv/inv.t.sol:Inv_Unit_Test
[PASS] test_Inv() (gas: 775355)
[PASS] test_RevertWhen_Zero() (gas: 3555)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 10.84ms (846.83µs CPU time)

Ran 2 tests for test/unit/ud60x18/math/floor/floor.t.sol:Floor_Unit_Test
[PASS] test_Floor_Positive() (gas: 520693)
[PASS] test_Floor_Zero() (gas: 3528)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 10.81ms (809.46µs CPU time)

Ran 3 tests for test/unit/ud60x18/math/log2/log2.t.sol:Log2_Unit_Test
[PASS] test_Log2_NotPowerOfTwo() (gas: 402178)
[PASS] test_Log2_PowerOfTwo() (gas: 347227)
[PASS] test_RevertWhen_LtUnit() (gas: 3735)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 10.88ms (832.25µs CPU time)

Ran 8 tests for test/unit/sd59x18/math/powu/powu.t.sol:Powu_Unit_Test
[PASS] test_Powu_BaseAndExponentZero() (gas: 3876)
[PASS] test_Powu_BaseZeroExponentNotZero() (gas: 158104)
[PASS] test_Powu_ExponentZero() (gas: 367759)
[PASS] test_Powu_NegativeBase() (gas: 1210034)
[PASS] test_Powu_PositiveBase() (gas: 1208245)
[PASS] test_RevertWhen_ResultOverflowSD59x18() (gas: 4692)
[PASS] test_RevertWhen_ResultOverflowUint256() (gas: 4309)
[PASS] test_RevertWhen_ResultUnderflowSD59x18() (gas: 4778)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 11.37ms (1.41ms CPU time)

Ran 4 tests for test/unit/sd59x18/math/ceil/ceil.t.sol:Ceil_Unit_Test
[PASS] test_Ceil_Negative() (gas: 502467)
[PASS] test_Ceil_Positive() (gas: 513135)
[PASS] test_Ceil_Zero() (gas: 3693)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3775)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 421.83µs (203.42µs CPU time)

Ran 4 tests for test/unit/sd59x18/math/floor/floor.t.sol:Floor_Unit_Test
[PASS] test_Floor_Negative_GteMinPermitted() (gas: 463991)
[PASS] test_Floor_Positive() (gas: 522348)
[PASS] test_Floor_Zero() (gas: 3714)
[PASS] test_RevertWhen_Negative_LtMinPermitted() (gas: 3796)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 488.38µs (195.67µs CPU time)

Ran 3 tests for test/unit/sd59x18/math/inv/inv.t.sol:Inv_Unit_Test
[PASS] test_Inv_Negative() (gas: 796496)
[PASS] test_Inv_Positive() (gas: 776640)
[PASS] test_RevertWhen_Zero() (gas: 3581)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 600.46µs (285.58µs CPU time)

Ran 2 tests for test/unit/ud60x18/conversion/convert-from/convertFrom.t.sol:ConvertFrom_Unit_Test
[PASS] test_ConvertFrom() (gas: 609813)
[PASS] test_ConvertFrom_LtUnit() (gas: 118406)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 329.96µs (133.08µs CPU time)

Ran 4 tests for test/unit/sd59x18/math/log2/log2.t.sol:Log2_Unit_Test
[PASS] test_Log2_NotPowerOfTwo() (gas: 960551)
[PASS] test_Log2_PowerOfTwo() (gas: 544978)
[PASS] test_RevertWhen_Negative() (gas: 3603)
[PASS] test_RevertWhen_Zero() (gas: 3637)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 771.83µs (563.00µs CPU time)

Ran 3 tests for test/unit/ud60x18/math/sqrt/sqrt.t.sol:Sqrt_Unit_Test
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3735)
[PASS] test_Sqrt() (gas: 817265)
[PASS] test_Sqrt_Zero() (gas: 3692)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 391.96µs (184.62µs CPU time)

Ran 2 tests for test/unit/ud60x18/math/ln/ln.t.sol:Ln_Unit_Test
[PASS] test_Ln() (gas: 580417)
[PASS] test_RevertWhen_LtUnit() (gas: 3790)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 405.71µs (206.83µs CPU time)

Ran 2 tests for test/unit/ud60x18/conversion/convert-to/convertTo.t.sol:ConvertTo_Unit_Test
[PASS] test_ConvertTo() (gas: 463507)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3729)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 276.25µs (84.96µs CPU time)

Ran 4 tests for test/unit/sd59x18/math/sqrt/sqrt.t.sol:Sqrt_Unit_Test
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3941)
[PASS] test_RevertWhen_Negative() (gas: 3619)
[PASS] test_Sqrt() (gas: 819035)
[PASS] test_Sqrt_Zero() (gas: 3812)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 401.13µs (203.13µs CPU time)

Ran 4 tests for test/unit/ud60x18/math/mul/mul.t.sol:Mul_Unit_Test
[PASS] test_Mul() (gas: 1247597)
[PASS] test_Mul_OneOperandZero() (gas: 112570)
[PASS] test_RevertWhen_ResultOverflowUD60x18_Function() (gas: 4123)
[PASS] test_RevertWhen_ResultOverflowUD60x18_Operator() (gas: 4079)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 469.75µs (268.25µs CPU time)

Ran 2 tests for test/unit/sd59x18/conversion/convert-from/convertFrom.t.sol:ConvertFrom_Unit_Test
[PASS] test_ConvertFrom() (gas: 1100150)
[PASS] test_ConvertFrom_LtAbsoluteUnit() (gas: 176487)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 420.42µs (219.83µs CPU time)

Ran 4 tests for test/unit/sd59x18/math/abs/abs.t.sol:Abs_Unit_Test
[PASS] test_Abs() (gas: 561245)
[PASS] test_Abs_Negative() (gas: 562045)
[PASS] test_Abs_Zero() (gas: 3617)
[PASS] test_RevertWhen_MinSD59x18() (gas: 3479)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 391.42µs (195.08µs CPU time)

Ran 3 tests for test/unit/sd59x18/math/ln/ln.t.sol:Ln_Unit_Test
[PASS] test_Ln() (gas: 1082175)
[PASS] test_RevertWhen_Negative() (gas: 3658)
[PASS] test_RevertWhen_Zero() (gas: 3648)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 661.92µs (462.21µs CPU time)

Ran 3 tests for test/unit/sd59x18/conversion/convert-to/convertTo.t.sol:ConvertTo_Unit_Test
[PASS] test_ConvertTo() (gas: 907330)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3973)
[PASS] test_RevertWhen_LtMinPermitted() (gas: 3829)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 361.46µs (168.08µs CPU time)

Ran 5 tests for test/unit/ud60x18/math/avg/avg.t.sol:Avg_Unit_Test
[PASS] test_Avg_BothOperandsZero() (gas: 3643)
[PASS] test_Avg_NeitherOperandZero_BothOperandsEven() (gas: 435671)
[PASS] test_Avg_NeitherOperandZero_BothOperandsOdd() (gas: 504581)
[PASS] test_Avg_NeitherOperandZero_OneOperandEvenTheOtherOdd() (gas: 504603)
[PASS] test_Avg_OnlyOneOperandZero() (gas: 169332)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 392.63µs (196.88µs CPU time)

Ran 3 tests for test/unit/ud60x18/math/log10/log10.t.sol:Log10_Unit_Test
[PASS] test_Log10_NotPowerOfTen() (gas: 737914)
[PASS] test_Log10_PowerOfTen() (gas: 401254)
[PASS] test_RevertWhen_LtUnit() (gas: 3758)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 610.88µs (397.71µs CPU time)

Ran 6 tests for test/unit/ud60x18/math/div/div.t.sol:Div_Unit_Test
[PASS] test_Div() (gas: 1177735)
[PASS] test_Div_NumeratorZero() (gas: 173801)
[PASS] test_RevertWhen_DenominatorZero_Function() (gas: 3688)
[PASS] test_RevertWhen_DenominatorZero_Operator() (gas: 3710)
[PASS] test_RevertWhen_ResultOverflowUD60x18_Function() (gas: 4123)
[PASS] test_RevertWhen_ResultOverflowUD60x18_Operator() (gas: 4102)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 491.63µs (292.54µs CPU time)

Ran 8 tests for test/unit/sd59x18/math/mul/mul.t.sol:Mul_Unit_Test
[PASS] test_Mul_OneOperandZero() (gas: 175880)
[PASS] test_Mul_OperandsDifferentSign() (gas: 2279113)
[PASS] test_Mul_OperandsSameSign() (gas: 2278820)
[PASS] test_RevertWhen_OneOperandMinSD59x18_Function() (gas: 3181)
[PASS] test_RevertWhen_OneOperandMinSD59x18_Operator() (gas: 3171)
[PASS] test_RevertWhen_ResultOverflowSD59x18_A() (gas: 4291)
[PASS] test_RevertWhen_ResultOverflowSD59x18_B() (gas: 4324)
[PASS] test_RevertWhen_ResultOverflowUint256() (gas: 359839)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.22ms (980.33µs CPU time)

Ran 2 tests for test/unit/ud60x18/math/frac/frac.t.sol:Frac_Unit_Test
[PASS] test_Frac() (gas: 480762)
[PASS] test_Frac_Zero() (gas: 3528)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 933.71µs (329.92µs CPU time)

Ran 3 tests for test/unit/sd59x18/math/frac/frac.t.sol:Frac_Unit_Test
[PASS] test_Frac() (gas: 481879)
[PASS] test_Frac_Negative() (gas: 481880)
[PASS] test_Frac_Zero() (gas: 3648)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 381.08µs (186.33µs CPU time)

Ran 4 tests for test/unit/sd59x18/math/log10/log10.t.sol:Log10_Unit_Test
[PASS] test_Log10_NotPowerOfTen() (gas: 1086187)
[PASS] test_Log10_PowerOfTen() (gas: 794934)
[PASS] test_RevertWhen_Negative() (gas: 3629)
[PASS] test_RevertWhen_Zero() (gas: 5452)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 886.13µs (671.62µs CPU time)

Ran 3 tests for test/unit/ud60x18/math/gm/gm.t.sol:Gm_Unit_Test
[PASS] test_Gm() (gas: 788856)
[PASS] test_Gm_OneOperandZero() (gas: 109723)
[PASS] test_RevertWhen_ProductOverflows() (gas: 4096)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 357.96µs (159.63µs CPU time)

Ran 11 tests for test/unit/sd59x18/math/div/div.t.sol:Div_Unit_Test
[PASS] test_Div_NumeratorDenominatorDifferentSign() (gas: 2280554)
[PASS] test_Div_NumeratorDenominatorSameSign() (gas: 2279570)
[PASS] test_Div_NumeratorZero() (gas: 300073)
[PASS] test_RevertWhen_DenominatorMinSD59x18_Function() (gas: 3193)
[PASS] test_RevertWhen_DenominatorMinSD59x18_Operator() (gas: 3170)
[PASS] test_RevertWhen_DenominatorZero_Function() (gas: 3863)
[PASS] test_RevertWhen_DenominatorZero_Operator() (gas: 3907)
[PASS] test_RevertWhen_NumeratorMinSD59x18_Function() (gas: 3497)
[PASS] test_RevertWhen_NumeratorMinSD59x18_Operator() (gas: 3519)
[PASS] test_RevertWhen_ResultOverflowSD59x18_Function() (gas: 4239)
[PASS] test_RevertWhen_ResultOverflowSD59x18_Operator() (gas: 4304)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 1.27ms (1.03ms CPU time)

Ran 8 tests for test/unit/sd59x18/math/gm/gm.t.sol:Gm_Unit_Test
[PASS] test_Gm() (gas: 1416936)
[PASS] test_Gm_OneOperandZero() (gas: 109746)
[PASS] test_RevertWhen_ProductNegative_A() (gas: 3890)
[PASS] test_RevertWhen_ProductNegative_B() (gas: 3880)
[PASS] test_RevertWhen_ProductOverflow_A() (gas: 3882)
[PASS] test_RevertWhen_ProductOverflow_B() (gas: 4007)
[PASS] test_RevertWhen_ProductOverflow_C() (gas: 4232)
[PASS] test_RevertWhen_ProductOverflow_D() (gas: 3848)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 512.92µs (305.38µs CPU time)

Ran 3 tests for test/unit/ud60x18/math/exp/exp.t.sol:Exp_Unit_Test
[PASS] test_Exp() (gas: 893254)
[PASS] test_Exp_Zero() (gas: 4050)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3758)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 461.25µs (256.83µs CPU time)

Ran 5 tests for test/unit/sd59x18/math/exp/exp.t.sol:Exp_Unit_Test
[PASS] test_Exp_Negative_GteMinPermitted() (gas: 798729)
[PASS] test_Exp_Negative_LtThreshold() (gas: 138733)
[PASS] test_Exp_Positive_LteMaxPermitted() (gas: 893411)
[PASS] test_Exp_Zero() (gas: 4061)
[PASS] test_RevertWhen_Positive_GtMaxPermitted() (gas: 3824)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 713.50µs (498.08µs CPU time)

Ran 7 tests for test/unit/sd59x18/math/avg/avg.t.sol:Avg_Unit_Test
[PASS] test_Avg_BothOperandsEven() (gas: 435942)
[PASS] test_Avg_BothOperandsNegative() (gas: 504940)
[PASS] test_Avg_BothOperandsOdd() (gas: 513052)
[PASS] test_Avg_BothOperandsZero() (gas: 3673)
[PASS] test_Avg_OneOperandEvenTheOtherOdd() (gas: 504925)
[PASS] test_Avg_OneOperandNegativeTheOtherPositive() (gas: 494311)
[PASS] test_Avg_OnlyOneOperandZero() (gas: 267508)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 3.06ms (3.02ms CPU time)

Ran 7 tests for test/unit/sd59x18/math/pow/pow.t.sol:Pow_Unit_Test
[PASS] test_Pow_BaseUnit() (gas: 3665)
[PASS] test_Pow_BaseZero_ExponentNotZero() (gas: 3643)
[PASS] test_Pow_BaseZero_ExponentZero() (gas: 3685)
[PASS] test_Pow_ExponentUnit() (gas: 3732)
[PASS] test_Pow_ExponentZero() (gas: 3666)
[PASS] test_Pow_NegativeExponent() (gas: 1442754)
[PASS] test_Pow_PositiveExponent() (gas: 1550424)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 1.41ms (1.19ms CPU time)

Ran 3 tests for test/unit/ud60x18/math/exp2/exp2.t.sol:Exp2_Unit_Test
[PASS] test_Exp2() (gas: 1079986)
[PASS] test_Exp2_Zero() (gas: 3958)
[PASS] test_RevertWhen_GtMaxPermitted() (gas: 3757)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 467.58µs (262.67µs CPU time)

Ran 5 tests for test/unit/sd59x18/math/exp2/exp2.t.sol:Exp2_Unit_Test
[PASS] test_Exp2_Negative_GteMinPermitted() (gas: 786459)
[PASS] test_Exp2_Negative_LtThreshold() (gas: 138894)
[PASS] test_Exp2_Positive_LTePermittedMax() (gas: 1079619)
[PASS] test_Exp2_Zero() (gas: 3953)
[PASS] test_RevertWhen_Positive_GtMaxPermitted() (gas: 3823)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 675.00µs (460.50µs CPU time)

Ran 5 tests for test/unit/ud60x18/math/powu/powu.t.sol:Powu_Unit_Test
[PASS] test_Powu() (gas: 1204264)
[PASS] test_Powu_BaseAndExponentZero() (gas: 3641)
[PASS] test_Powu_BaseZeroExponentNotZero() (gas: 139726)
[PASS] test_Powu_ExponentZero() (gas: 218632)
[PASS] test_RevertWhen_ResultOverflowsUD60x18() (gas: 3925)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.71ms (2.47ms CPU time)

Ran 4 tests for test/fuzz/ud60x18/math/pow/pow.t.sol:Pow_Fuzz_Test
[PASS] testFuzz_Pow_BaseUnit(uint256) (runs: 256, μ: 3739, ~: 3739)
[PASS] testFuzz_Pow_BaseZero_ExponentNotZero(uint256) (runs: 256, μ: 4055, ~: 4055)
[PASS] testFuzz_Pow_ExponentUnit(uint256) (runs: 256, μ: 4151, ~: 4151)
[PASS] testFuzz_Pow_ExponentZero(uint256) (runs: 256, μ: 4121, ~: 4121)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 11.83ms (11.63ms CPU time)

Ran 7 tests for test/unit/ud60x18/math/pow/pow.t.sol:Pow_Unit_Test
[PASS] test_Pow_BaseGtUnit() (gas: 1012400)
[PASS] test_Pow_BaseLtUnit() (gas: 982361)
[PASS] test_Pow_BaseUnit() (gas: 3642)
[PASS] test_Pow_BaseZero_ExponentNotZero() (gas: 3665)
[PASS] test_Pow_BaseZero_ExponentZero() (gas: 3641)
[PASS] test_Pow_ExponentUnit(uint256) (runs: 256, μ: 4218, ~: 4218)
[PASS] test_Pow_ExponentZero() (gas: 3666)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 4.22ms (4.01ms CPU time)

Ran 6 tests for test/fuzz/casting/CastingUint128.t.sol:CastingUint128_Test
[PASS] testFuzz_RevertWhen_OverflowSD1x18(uint128) (runs: 256, μ: 4472, ~: 4761)
[PASS] testFuzz_RevertWhen_OverflowUD2x18(uint128) (runs: 256, μ: 4521, ~: 4749)
[PASS] testFuzz_intoSD1x18(uint128) (runs: 256, μ: 4138, ~: 3920)
[PASS] testFuzz_intoSD59x18(uint128) (runs: 256, μ: 3636, ~: 3636)
[PASS] testFuzz_intoUD2x18(uint128) (runs: 256, μ: 4139, ~: 3917)
[PASS] testFuzz_intoUD60x18(uint128) (runs: 256, μ: 3681, ~: 3681)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 38.13ms (28.09ms CPU time)

Ran 7 tests for test/fuzz/casting/CastingUint256.t.sol:CastingUint256_Test
[PASS] testFuzz_RevertWhen_OverflowSD1x18(uint256) (runs: 256, μ: 4270, ~: 4091)
[PASS] testFuzz_RevertWhen_OverflowSD59x18(uint256) (runs: 256, μ: 4601, ~: 4639)
[PASS] testFuzz_RevertWhen_OverflowUD2x18(uint256) (runs: 256, μ: 4255, ~: 4071)
[PASS] testFuzz_intoSD1x18(uint256) (runs: 256, μ: 4186, ~: 4391)
[PASS] testFuzz_intoSD59x18(uint256) (runs: 256, μ: 3897, ~: 3856)
[PASS] testFuzz_intoUD2x18(uint256) (runs: 256, μ: 4172, ~: 4374)
[PASS] testFuzz_intoUD60x18(uint256) (runs: 256, μ: 3575, ~: 3575)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 17.93ms (21.90ms CPU time)

Ran 15 tests for test/fuzz/sd1x18/casting/Casting.t.sol:Casting_Fuzz_Test
[PASS] testFuzz_IntoSD59x18(int64) (runs: 256, μ: 3696, ~: 3696)
[PASS] testFuzz_IntoUD2x18(int64) (runs: 256, μ: 5137, ~: 5396)
[PASS] testFuzz_IntoUD60x18(int64) (runs: 256, μ: 5167, ~: 5418)
[PASS] testFuzz_IntoUint128(int64) (runs: 256, μ: 5153, ~: 5412)
[PASS] testFuzz_IntoUint256(int64) (runs: 256, μ: 5076, ~: 5335)
[PASS] testFuzz_IntoUint40(int64) (runs: 256, μ: 5230, ~: 5392)
[PASS] testFuzz_RevertWhen_OverflowUint40(int64) (runs: 256, μ: 5492, ~: 5616)
[PASS] testFuzz_RevertWhen_UnderflowUD2x18(int64) (runs: 256, μ: 5140, ~: 4939)
[PASS] testFuzz_RevertWhen_UnderflowUD60x18(int64) (runs: 256, μ: 5124, ~: 4926)
[PASS] testFuzz_RevertWhen_UnderflowUint128(int64) (runs: 256, μ: 5146, ~: 4971)
[PASS] testFuzz_RevertWhen_UnderflowUint256(int64) (runs: 256, μ: 5170, ~: 4972)
[PASS] testFuzz_RevertWhen_UnderflowUint40(int64) (runs: 256, μ: 5133, ~: 4918)
[PASS] testFuzz_Unwrap(int64) (runs: 256, μ: 3706, ~: 3706)
[PASS] testFuzz_Wrap(int64) (runs: 256, μ: 3722, ~: 3722)
[PASS] testFuzz_sd1x18(int64) (runs: 256, μ: 3700, ~: 3700)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 79.37ms (77.30ms CPU time)

Ran 11 tests for test/fuzz/ud2x18/casting/Casting.t.sol:UD2x18_Casting_Fuzz_Test
[PASS] testFuzz_IntoSD1x18(uint64) (runs: 256, μ: 4027, ~: 3996)
[PASS] testFuzz_IntoSD59x18(uint64) (runs: 256, μ: 3688, ~: 3688)
[PASS] testFuzz_IntoUD60x18(uint64) (runs: 256, μ: 3710, ~: 3710)
[PASS] testFuzz_IntoUint128(uint64) (runs: 256, μ: 3627, ~: 3627)
[PASS] testFuzz_IntoUint256(uint64) (runs: 256, μ: 3692, ~: 3692)
[PASS] testFuzz_IntoUint40(uint64) (runs: 256, μ: 4159, ~: 3996)
[PASS] testFuzz_RevertWhen_OverflowSD1x18(uint64) (runs: 256, μ: 4746, ~: 4824)
[PASS] testFuzz_RevertWhen_OverflowUint40(uint64) (runs: 256, μ: 4586, ~: 4792)
[PASS] testFuzz_Unwrap(uint64) (runs: 256, μ: 3649, ~: 3649)
[PASS] testFuzz_Wrap(uint64) (runs: 256, μ: 3706, ~: 3706)
[PASS] testFuzz_ud2x18(uint64) (runs: 256, μ: 3660, ~: 3660)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 30.71ms (54.69ms CPU time)

Ran 15 tests for test/fuzz/ud60x18/casting/Casting.t.sol:UD60x18_Casting_Fuzz_Test
[PASS] testFuzz_RevertWhen_OverflowSD1x18(uint256) (runs: 256, μ: 4352, ~: 4304)
[PASS] testFuzz_RevertWhen_OverflowSD59x18(uint256) (runs: 256, μ: 4642, ~: 4688)
[PASS] testFuzz_RevertWhen_OverflowUD2x18(uint256) (runs: 256, μ: 4314, ~: 4262)
[PASS] testFuzz_RevertWhen_OverflowUint128(uint256) (runs: 256, μ: 4435, ~: 4722)
[PASS] testFuzz_RevertWhen_OverflowUint40(uint256) (runs: 256, μ: 4323, ~: 4047)
[PASS] testFuzz_UD60x18(uint256) (runs: 256, μ: 3619, ~: 3619)
[PASS] testFuzz_Ud(uint256) (runs: 256, μ: 3663, ~: 3663)
[PASS] testFuzz_Unwrap(uint256) (runs: 256, μ: 3580, ~: 3580)
[PASS] testFuzz_Wrap(uint256) (runs: 256, μ: 3640, ~: 3640)
[PASS] testFuzz_intoSD1x18(uint256) (runs: 256, μ: 4321, ~: 4560)
[PASS] testFuzz_intoSD59x18(uint256) (runs: 256, μ: 3968, ~: 3940)
[PASS] testFuzz_intoUD2x18(uint256) (runs: 256, μ: 4269, ~: 3931)
[PASS] testFuzz_intoUint128(uint256) (runs: 256, μ: 4082, ~: 3871)
[PASS] testFuzz_intoUint256(uint256) (runs: 256, μ: 3602, ~: 3602)
[PASS] testFuzz_intoUint40(uint256) (runs: 256, μ: 4246, ~: 4456)
Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 79.51ms (66.34ms CPU time)

Ran 21 tests for test/fuzz/sd59x18/casting/Casting.t.sol:SD59x18_Casting_Fuzz_Test
[PASS] testFuzz_IntoInt256(int256) (runs: 256, μ: 3626, ~: 3626)
[PASS] testFuzz_IntoSD1x18(int256) (runs: 256, μ: 4940, ~: 4732)
[PASS] testFuzz_IntoUD2x18(int256) (runs: 256, μ: 4911, ~: 5210)
[PASS] testFuzz_IntoUD60x18(int256) (runs: 256, μ: 4724, ~: 4484)
[PASS] testFuzz_IntoUint128(int256) (runs: 256, μ: 4817, ~: 4481)
[PASS] testFuzz_IntoUint256(int256) (runs: 256, μ: 4696, ~: 4444)
[PASS] testFuzz_IntoUint40(int256) (runs: 256, μ: 4900, ~: 5097)
[PASS] testFuzz_RevertWhen_OverflowSD1x18(int256) (runs: 256, μ: 5226, ~: 5386)
[PASS] testFuzz_RevertWhen_OverflowUD2x18(int256) (runs: 256, μ: 5253, ~: 5397)
[PASS] testFuzz_RevertWhen_OverflowUint128(int256) (runs: 256, μ: 5252, ~: 5407)
[PASS] testFuzz_RevertWhen_OverflowUint40(int256) (runs: 256, μ: 5153, ~: 5352)
[PASS] testFuzz_RevertWhen_UnderflowSD1x18(int256) (runs: 256, μ: 5446, ~: 5562)
[PASS] testFuzz_RevertWhen_UnderflowUD2x18(int256) (runs: 256, μ: 5280, ~: 5464)
[PASS] testFuzz_RevertWhen_UnderflowUD60x18(int256) (runs: 256, μ: 5239, ~: 5441)
[PASS] testFuzz_RevertWhen_UnderflowUint128(int256) (runs: 256, μ: 5269, ~: 5455)
[PASS] testFuzz_RevertWhen_UnderflowUint256(int256) (runs: 256, μ: 5194, ~: 5408)
[PASS] testFuzz_RevertWhen_UnderflowUint40(int256) (runs: 256, μ: 5279, ~: 5487)
[PASS] testFuzz_Sd(int256) (runs: 256, μ: 3667, ~: 3667)
[PASS] testFuzz_Unwrap(int256) (runs: 256, μ: 3582, ~: 3582)
[PASS] testFuzz_Wrap(int256) (runs: 256, μ: 3644, ~: 3644)
[PASS] testFuzz_sd59x18(int256) (runs: 256, μ: 3644, ~: 3644)
Suite result: ok. 21 passed; 0 failed; 0 skipped; finished in 46.42ms (92.02ms CPU time)

Ran 4 tests for test/fuzz/casting/CastingUint40.t.sol:CastingUint40_Test
[PASS] testFuzz_intoSD1x18(uint40) (runs: 256, μ: 3674, ~: 3674)
[PASS] testFuzz_intoSD59x18(uint40) (runs: 256, μ: 3637, ~: 3637)
[PASS] testFuzz_intoUD2x18(uint40) (runs: 256, μ: 3626, ~: 3626)
[PASS] testFuzz_intoUD60x18(uint40) (runs: 256, μ: 3659, ~: 3659)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 80.15ms (20.20ms CPU time)

Ran 18 tests for test/fuzz/ud60x18/helpers/Helpers.t.sol:UD60x18_Helpers_Fuzz_Test
[PASS] testFuzz_Add(uint256,uint256) (runs: 256, μ: 5387, ~: 5351)
[PASS] testFuzz_And(uint256,uint256) (runs: 256, μ: 4558, ~: 4558)
[PASS] testFuzz_Eq(uint256) (runs: 256, μ: 4306, ~: 4306)
[PASS] testFuzz_Gt(uint256,uint256) (runs: 256, μ: 4700, ~: 4700)
[PASS] testFuzz_Gte(uint256,uint256) (runs: 256, μ: 4715, ~: 4715)
[PASS] testFuzz_IsZero(uint256) (runs: 256, μ: 3639, ~: 3639)
[PASS] testFuzz_Lshift(uint256,uint256) (runs: 256, μ: 4060, ~: 4060)
[PASS] testFuzz_Lt(uint256,uint256) (runs: 256, μ: 4678, ~: 4678)
[PASS] testFuzz_Lte(uint256,uint256) (runs: 256, μ: 4758, ~: 4758)
[PASS] testFuzz_Mod(uint256,uint256) (runs: 256, μ: 5122, ~: 5122)
[PASS] testFuzz_Neq(uint256,uint256) (runs: 256, μ: 4757, ~: 4757)
[PASS] testFuzz_Not(uint256) (runs: 256, μ: 4515, ~: 4515)
[PASS] testFuzz_Or(uint256,uint256) (runs: 256, μ: 4594, ~: 4594)
[PASS] testFuzz_Rshift(uint256,uint256) (runs: 256, μ: 4038, ~: 4038)
[PASS] testFuzz_Sub(uint256,uint256) (runs: 256, μ: 5149, ~: 5149)
[PASS] testFuzz_UncheckedAdd(uint256,uint256) (runs: 256, μ: 3750, ~: 3750)
[PASS] testFuzz_UncheckedSub(uint256,uint256) (runs: 256, μ: 3726, ~: 3726)
[PASS] testFuzz_Xor(uint256,uint256) (runs: 256, μ: 4572, ~: 4572)
Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 59.02ms (155.61ms CPU time)

Ran 4 tests for test/fuzz/sd59x18/math/pow/pow.t.sol:Pow_Fuzz_Test
[PASS] testFuzz_Pow_BaseUnit(int256) (runs: 256, μ: 3695, ~: 3695)
[PASS] testFuzz_Pow_BaseZero_ExponentNotZero(int256) (runs: 256, μ: 4077, ~: 4077)
[PASS] testFuzz_Pow_ExponentUnit(int256) (runs: 256, μ: 4196, ~: 4196)
[PASS] testFuzz_Pow_ExponentZero(int256) (runs: 256, μ: 4120, ~: 4120)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 80.16ms (17.44ms CPU time)

Ran 19 tests for test/fuzz/sd59x18/helpers/Helpers.t.sol:SD59x18_Helpers_Fuzz_Test
[PASS] testFuzz_Add(int256,int256) (runs: 256, μ: 7320, ~: 7257)
[PASS] testFuzz_And(int256,int256) (runs: 256, μ: 4581, ~: 4581)
[PASS] testFuzz_Eq(int256) (runs: 256, μ: 4327, ~: 4327)
[PASS] testFuzz_Gt(int256,int256) (runs: 256, μ: 4680, ~: 4680)
[PASS] testFuzz_Gte(int256,int256) (runs: 256, μ: 4746, ~: 4746)
[PASS] testFuzz_IsZero(int256) (runs: 256, μ: 3594, ~: 3594)
[PASS] testFuzz_Lshift(int256,uint256) (runs: 256, μ: 4488, ~: 4555)
[PASS] testFuzz_Lt(int256,int256) (runs: 256, μ: 4678, ~: 4678)
[PASS] testFuzz_Lte(int256,int256) (runs: 256, μ: 4715, ~: 4715)
[PASS] testFuzz_Mod(int256,int256) (runs: 256, μ: 5143, ~: 5143)
[PASS] testFuzz_Neq(int256,int256) (runs: 256, μ: 4736, ~: 4736)
[PASS] testFuzz_Not(int256) (runs: 256, μ: 4537, ~: 4537)
[PASS] testFuzz_Or(int256,int256) (runs: 256, μ: 4573, ~: 4573)
[PASS] testFuzz_Rshift(int256,uint256) (runs: 256, μ: 4476, ~: 4535)
[PASS] testFuzz_Sub(int256,int256) (runs: 256, μ: 7246, ~: 7208)
[PASS] testFuzz_Unary(int256) (runs: 256, μ: 5700, ~: 5664)
[PASS] testFuzz_UncheckedAdd(int256,int256) (runs: 256, μ: 3750, ~: 3750)
[PASS] testFuzz_UncheckedSub(int256,int256) (runs: 256, μ: 3728, ~: 3728)
[PASS] testFuzz_Xor(int256,int256) (runs: 256, μ: 4595, ~: 4595)
Suite result: ok. 19 passed; 0 failed; 0 skipped; finished in 65.57ms (103.41ms CPU time)

Ran 48 test suites in 213.33ms (670.65ms CPU time): 281 tests passed, 0 failed, 0 skipped (281 total tests)

Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: b8ad4ba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@galargh galargh requested a review from kanej October 7, 2024 14:55
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Oct 7, 2024
Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 2:56pm

Copy link
Contributor

github-actions bot commented Oct 7, 2024

hardhat

Total size of the bundle: 80M
Total number of dependencies (including transitive): 120

List of dependencies (sorted by size)
78M	total
23M	solc
20M	esbuild
5.0M	lodash
2.9M	fp-ts
2.8M	@sentry/tracing
2.1M	secp256k1
1.9M	@noble/curves
1.6M	undici
1.2M	@sentry/types
1.2M	@noble/hashes
1.1M	@ignored/hardhat-vnext-build-system
996K	@nomicfoundation/ethereumjs-util
952K	node-addon-api
932K	@sentry/node
920K	@sentry/utils
892K	keccak
824K	zod
712K	@ignored/hardhat-vnext-utils
576K	tsx
556K	resolve
548K	@sentry/core
504K	fast-equals
492K	@scure/bip39
464K	@ignored/edr
368K	ethereum-cryptography
344K	@sentry/hub
320K	enquirer
284K	semver
268K	fs-extra
248K	scrypt-js
244K	io-ts
204K	@ignored/hardhat-vnext-errors
200K	undici-types
196K	readable-stream
192K	@nomicfoundation/ethereumjs-rlp
180K	blakejs
176K	elliptic
168K	@scure/base
136K	adm-zip
128K	get-tsconfig
112K	bn.js
104K	hash.js
96K	commander
96K	browserify-aes
96K	@scure/bip32
92K	chalk
88K	tslib
88K	@sentry/minimal
84K	js-sha3
76K	agent-base
72K	sha.js
72K	@nomicfoundation/solidity-analyzer
68K	glob
68K	debug
64K	lru_map
64K	https-proxy-agent
60K	@ignored/hardhat-vnext-zod-utils
56K	rfdc
56K	graceful-fs
56K	follow-redirects
52K	pbkdf2
52K	hmac-drbg
48K	safe-buffer
48K	minimatch
48K	memorystream
48K	command-exists
48K	ansi-colors
44K	tmp
44K	node-gyp-build
40K	resolve-pkg-maps
40K	buffer-xor
36K	klaw
36K	concat-map
32K	string_decoder
32K	jsonfile
32K	fs.realpath
32K	create-hash
32K	cookie
28K	util-deprecate
28K	ripemd160
28K	randombytes
28K	minimalistic-crypto-utils
28K	create-hmac
28K	base-x
24K	strip-ansi
24K	p-map
24K	md5.js
24K	inherits
24K	indent-string
24K	env-paths
24K	clean-stack
24K	cipher-base
24K	bs58check
24K	brorand
24K	brace-expansion
24K	ansi-regex
24K	aggregate-error
24K	@types/secp256k1
20K	wrappy
20K	universalify
20K	setimmediate
20K	require-from-string
20K	path-parse
20K	path-is-absolute
20K	path-exists
20K	p-try
20K	p-locate
20K	p-limit
20K	os-tmpdir
20K	once
20K	ms
20K	minimalistic-assert
20K	locate-path
20K	inflight
20K	hash-base
20K	find-up
20K	evp_bytestokey
20K	bs58
20K	balanced-match
20K	@types/pbkdf2

@galargh
Copy link
Member Author

galargh commented Oct 11, 2024

I'm going to close it and prepare a research/design doc in Notion, instead.

@galargh galargh closed this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant