From 2eb0f03e447869bf3566e7eaaf0260459a88ec0e Mon Sep 17 00:00:00 2001 From: David Meister Date: Thu, 20 Aug 2026 16:42:37 +0000 Subject: [PATCH] Strip deploy + Rust/npm surface: library becomes pure Solidity Per rain.math.float#262 (Split into library + rain.math.float.deploy) and the Hard Case A ruling, this repo becomes the pure Solidity math library that publishes only the `rain-math-float` Soldeer package. The deployed concrete, deploy pins/snapshot, deploy scripts/tests, and the Rust/WASM/npm bindings move to rain.math.float.deploy. Removed (77 files): - Deploy Solidity: src/concrete/DecimalFloat.sol, src/generated/*, src/lib/deploy/LibDecimalFloatDeploy.sol, script/{Deploy,BuildPointers, check-published-deploy-constants.sh}, deploy tests, LibLogTable.bytes.t.sol. - Rust/npm: crates/**, Cargo.*, package*.json, tsconfig.json, .prettierignore, test_js/**, scripts/*.js, the CopyArtifacts bridge (script + lib + test), and TestDecimalFloat harness + its two wrapper tests. - Workflows: copy-artifacts, manual-sol-artifacts, rainix-rs-{static,test,wasm}. Added / changed: - test/abstract/LogTest.sol rewritten self-contained (Hard Case C): rebuilds the combined log tables from LibLogTable source and deploys them via LibDataContract at a `create` address, so the transcendental tests (log10/pow/pow10/sqrt) run with no Zoltu deploy pin and no src/generated snapshot. - foundry.toml: drop rain-deploy + rain-sol-codegen deps, [rpc_endpoints], [etherscan], fs_permissions, ffi. Pragma stays `^`. - package-release.yaml: publish only the rain-math-float Soldeer package (drop crate + npm-package inputs). - flake.nix: drop test-wasm-build + test-js-bindings tasks. - CLAUDE.md/README/REUSE.toml/.soldeerignore/.gitignore/remappings: library-only. - .gas-snapshot + soldeer.lock regenerated for the stripped tree. Co-Authored-By: Claude Opus 4.8 --- .gas-snapshot | 583 +-- .github/workflows/copy-artifacts.yaml | 9 - .github/workflows/manual-sol-artifacts.yaml | 17 - .github/workflows/package-release.yaml | 2 - .github/workflows/rainix-rs-static.yaml | 5 - .github/workflows/rainix-rs-test.yaml | 5 - .github/workflows/rainix-rs-wasm.yaml | 5 - .gitignore | 3 - .prettierignore | 1 - .soldeerignore | 10 - CLAUDE.md | 123 +- Cargo.lock | 3525 ----------------- Cargo.toml | 25 - REUSE.toml | 9 - crates/float-wasm/Cargo.toml | 12 - crates/float-wasm/src/lib.rs | 8 - crates/float/Cargo.toml | 55 - crates/float/abi/DecimalFloat.json | 1110 ------ crates/float/abi/TestDecimalFloat.json | 90 - .../float/proptest-regressions/fuzz_ops.txt | 8 - crates/float/proptest-regressions/lib.txt | 8 - crates/float/src/error.rs | 284 -- crates/float/src/evm.rs | 96 - crates/float/src/fuzz_ops.rs | 306 -- crates/float/src/js_api.rs | 989 ----- crates/float/src/lib.rs | 2316 ----------- crates/float/src/tables.rs | 644 --- flake.nix | 24 +- foundry.toml | 24 - package-lock.json | 2357 ----------- package.json | 45 - remappings.txt | 3 - script/BuildPointers.sol | 47 - script/CopyArtifacts.sol | 26 - script/Deploy.sol | 72 - script/check-published-deploy-constants.sh | 51 - script/lib/LibCopyArtifacts.sol | 48 - script/lib/LibEtchLogTables.sol | 29 - scripts/build.js | 84 - scripts/prepublish.js | 10 - soldeer.lock | 14 - src/concrete/DecimalFloat.sol | 328 -- src/generated/LogTables.pointers.sol | 33 - src/lib/deploy/LibDecimalFloatDeploy.sol | 87 - test/abstract/LogTest.sol | 36 +- test/concrete/DecimalFloat.packLossless.t.sol | 26 - test/concrete/TestDecimalFloat.sol | 27 - test/concrete/TestDecimalFloat.unpack.t.sol | 29 - test/script/CopyArtifacts.t.sol | 27 - test/src/concrete/DecimalFloat.abs.t.sol | 28 - test/src/concrete/DecimalFloat.add.t.sol | 28 - test/src/concrete/DecimalFloat.ceil.t.sol | 28 - .../src/concrete/DecimalFloat.constants.t.sol | 113 - .../concrete/DecimalFloat.constructor.t.sol | 82 - test/src/concrete/DecimalFloat.div.t.sol | 28 - test/src/concrete/DecimalFloat.eq.t.sol | 28 - test/src/concrete/DecimalFloat.floor.t.sol | 28 - test/src/concrete/DecimalFloat.format.t.sol | 87 - test/src/concrete/DecimalFloat.frac.t.sol | 28 - ...ecimalFloat.fromFixedDecimalLossless.t.sol | 28 - .../DecimalFloat.fromFixedDecimalLossy.t.sol | 29 - test/src/concrete/DecimalFloat.gt.t.sol | 28 - test/src/concrete/DecimalFloat.gte.t.sol | 28 - test/src/concrete/DecimalFloat.integer.t.sol | 28 - test/src/concrete/DecimalFloat.inv.t.sol | 28 - test/src/concrete/DecimalFloat.isZero.t.sol | 28 - test/src/concrete/DecimalFloat.log10.t.sol | 29 - test/src/concrete/DecimalFloat.lt.t.sol | 28 - test/src/concrete/DecimalFloat.lte.t.sol | 28 - test/src/concrete/DecimalFloat.max.t.sol | 28 - test/src/concrete/DecimalFloat.min.t.sol | 28 - test/src/concrete/DecimalFloat.minus.t.sol | 28 - test/src/concrete/DecimalFloat.mul.t.sol | 28 - test/src/concrete/DecimalFloat.parse.t.sol | 30 - test/src/concrete/DecimalFloat.pow.t.sol | 29 - test/src/concrete/DecimalFloat.pow10.t.sol | 29 - test/src/concrete/DecimalFloat.sqrt.t.sol | 29 - test/src/concrete/DecimalFloat.sub.t.sol | 28 - .../DecimalFloat.toFixedDecimalLossless.t.sol | 28 - .../DecimalFloat.toFixedDecimalLossy.t.sol | 50 - ...alFloatDeploy.checkLogTablesDeployed.t.sol | 82 - .../lib/deploy/LibDecimalFloatDeploy.t.sol | 65 - .../deploy/LibDecimalFloatDeployProd.t.sol | 53 - ...LibDecimalFloatDeployTaggedConstants.t.sol | 43 - test/src/lib/table/LibLogTable.bytes.t.sol | 48 - test_js/float.test.ts | 314 -- test_js/tsconfig.json | 19 - tsconfig.json | 18 - 88 files changed, 374 insertions(+), 15038 deletions(-) delete mode 100644 .github/workflows/copy-artifacts.yaml delete mode 100644 .github/workflows/manual-sol-artifacts.yaml delete mode 100644 .github/workflows/rainix-rs-static.yaml delete mode 100644 .github/workflows/rainix-rs-test.yaml delete mode 100644 .github/workflows/rainix-rs-wasm.yaml delete mode 100644 .prettierignore delete mode 100644 Cargo.lock delete mode 100644 Cargo.toml delete mode 100644 crates/float-wasm/Cargo.toml delete mode 100644 crates/float-wasm/src/lib.rs delete mode 100644 crates/float/Cargo.toml delete mode 100644 crates/float/abi/DecimalFloat.json delete mode 100644 crates/float/abi/TestDecimalFloat.json delete mode 100644 crates/float/proptest-regressions/fuzz_ops.txt delete mode 100644 crates/float/proptest-regressions/lib.txt delete mode 100644 crates/float/src/error.rs delete mode 100644 crates/float/src/evm.rs delete mode 100644 crates/float/src/fuzz_ops.rs delete mode 100644 crates/float/src/js_api.rs delete mode 100644 crates/float/src/lib.rs delete mode 100644 crates/float/src/tables.rs delete mode 100644 package-lock.json delete mode 100644 package.json delete mode 100644 script/BuildPointers.sol delete mode 100644 script/CopyArtifacts.sol delete mode 100644 script/Deploy.sol delete mode 100644 script/check-published-deploy-constants.sh delete mode 100644 script/lib/LibCopyArtifacts.sol delete mode 100644 script/lib/LibEtchLogTables.sol delete mode 100644 scripts/build.js delete mode 100644 scripts/prepublish.js delete mode 100644 src/concrete/DecimalFloat.sol delete mode 100644 src/generated/LogTables.pointers.sol delete mode 100644 src/lib/deploy/LibDecimalFloatDeploy.sol delete mode 100644 test/concrete/DecimalFloat.packLossless.t.sol delete mode 100644 test/concrete/TestDecimalFloat.sol delete mode 100644 test/concrete/TestDecimalFloat.unpack.t.sol delete mode 100644 test/script/CopyArtifacts.t.sol delete mode 100644 test/src/concrete/DecimalFloat.abs.t.sol delete mode 100644 test/src/concrete/DecimalFloat.add.t.sol delete mode 100644 test/src/concrete/DecimalFloat.ceil.t.sol delete mode 100644 test/src/concrete/DecimalFloat.constants.t.sol delete mode 100644 test/src/concrete/DecimalFloat.constructor.t.sol delete mode 100644 test/src/concrete/DecimalFloat.div.t.sol delete mode 100644 test/src/concrete/DecimalFloat.eq.t.sol delete mode 100644 test/src/concrete/DecimalFloat.floor.t.sol delete mode 100644 test/src/concrete/DecimalFloat.format.t.sol delete mode 100644 test/src/concrete/DecimalFloat.frac.t.sol delete mode 100644 test/src/concrete/DecimalFloat.fromFixedDecimalLossless.t.sol delete mode 100644 test/src/concrete/DecimalFloat.fromFixedDecimalLossy.t.sol delete mode 100644 test/src/concrete/DecimalFloat.gt.t.sol delete mode 100644 test/src/concrete/DecimalFloat.gte.t.sol delete mode 100644 test/src/concrete/DecimalFloat.integer.t.sol delete mode 100644 test/src/concrete/DecimalFloat.inv.t.sol delete mode 100644 test/src/concrete/DecimalFloat.isZero.t.sol delete mode 100644 test/src/concrete/DecimalFloat.log10.t.sol delete mode 100644 test/src/concrete/DecimalFloat.lt.t.sol delete mode 100644 test/src/concrete/DecimalFloat.lte.t.sol delete mode 100644 test/src/concrete/DecimalFloat.max.t.sol delete mode 100644 test/src/concrete/DecimalFloat.min.t.sol delete mode 100644 test/src/concrete/DecimalFloat.minus.t.sol delete mode 100644 test/src/concrete/DecimalFloat.mul.t.sol delete mode 100644 test/src/concrete/DecimalFloat.parse.t.sol delete mode 100644 test/src/concrete/DecimalFloat.pow.t.sol delete mode 100644 test/src/concrete/DecimalFloat.pow10.t.sol delete mode 100644 test/src/concrete/DecimalFloat.sqrt.t.sol delete mode 100644 test/src/concrete/DecimalFloat.sub.t.sol delete mode 100644 test/src/concrete/DecimalFloat.toFixedDecimalLossless.t.sol delete mode 100644 test/src/concrete/DecimalFloat.toFixedDecimalLossy.t.sol delete mode 100644 test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol delete mode 100644 test/src/lib/deploy/LibDecimalFloatDeploy.t.sol delete mode 100644 test/src/lib/deploy/LibDecimalFloatDeployProd.t.sol delete mode 100644 test/src/lib/deploy/LibDecimalFloatDeployTaggedConstants.t.sol delete mode 100644 test/src/lib/table/LibLogTable.bytes.t.sol delete mode 100644 test_js/float.test.ts delete mode 100644 test_js/tsconfig.json delete mode 100644 tsconfig.json diff --git a/.gas-snapshot b/.gas-snapshot index a7cb8569..bf9fa77b 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,126 +1,102 @@ -DecimalFloatAbsTest:testAbsDeployed(bytes32) (runs: 5096, μ: 3653504, ~: 3653437) -DecimalFloatAddTest:testAddDeployed(bytes32,bytes32) (runs: 5096, μ: 3658502, ~: 3658911) -DecimalFloatCeilTest:testCeilDeployed(bytes32) (runs: 5096, μ: 3653468, ~: 3653029) -DecimalFloatConstantsTest:testEDeployed() (gas: 3652610) -DecimalFloatConstantsTest:testMaxNegativeValueDeployed() (gas: 3652600) -DecimalFloatConstantsTest:testMaxPositiveValueDeployed() (gas: 3652644) -DecimalFloatConstantsTest:testMinNegativeValueDeployed() (gas: 3652554) -DecimalFloatConstantsTest:testMinPositiveValueDeployed() (gas: 3652577) -DecimalFloatConstantsTest:testZeroDeployed() (gas: 3652597) -DecimalFloatDivTest:testDivDeployed(bytes32,bytes32) (runs: 5096, μ: 3660462, ~: 3660681) -DecimalFloatEqTest:testEqDeployed(bytes32,bytes32) (runs: 5096, μ: 3653831, ~: 3653731) -DecimalFloatFloorTest:testFloorDeployed(bytes32) (runs: 5096, μ: 3653562, ~: 3653072) -DecimalFloatFormatTest:testFormatConstants() (gas: 3653151) -DecimalFloatFormatTest:testFormatDeployed(bytes32,bytes32,bytes32) (runs: 5096, μ: 3678438, ~: 3685035) -DecimalFloatFracTest:testFracDeployed(bytes32) (runs: 5096, μ: 3653600, ~: 3653559) -DecimalFloatFromFixedDecimalLosslessTest:testFromFixedDecimalLosslessDeployed(uint256,uint8) (runs: 5096, μ: 3654494, ~: 3654149) -DecimalFloatFromFixedDecimalLossyTest:testFromFixedDecimalLossyDeployed(uint256,uint8) (runs: 5096, μ: 3654373, ~: 3654306) -DecimalFloatGtTest:testGtDeployed(bytes32,bytes32) (runs: 5096, μ: 3653753, ~: 3653653) -DecimalFloatGteTest:testGteDeployed(bytes32,bytes32) (runs: 5096, μ: 3653803, ~: 3653703) -DecimalFloatIntegerTest:testIntegerDeployed(bytes32) (runs: 5096, μ: 3653570, ~: 3653576) -DecimalFloatInvTest:testInvDeployed(bytes32) (runs: 5096, μ: 3658828, ~: 3658941) -DecimalFloatIsZeroTest:testIsZeroDeployed(bytes32) (runs: 5096, μ: 3652923, ~: 3652923) -DecimalFloatLtTest:testLtDeployed(bytes32,bytes32) (runs: 5096, μ: 3653731, ~: 3653630) -DecimalFloatLteTest:testLteDeployed(bytes32,bytes32) (runs: 5096, μ: 3653783, ~: 3653683) -DecimalFloatMaxTest:testMaxDeployed(bytes32,bytes32) (runs: 5096, μ: 3653805, ~: 3653718) -DecimalFloatMinTest:testMinDeployed(bytes32,bytes32) (runs: 5096, μ: 3653805, ~: 3653717) -DecimalFloatMinusTest:testMinusDeployed(bytes32) (runs: 5096, μ: 3653579, ~: 3653582) -DecimalFloatMulTest:testMulDeployed(bytes32,bytes32) (runs: 5096, μ: 3657863, ~: 3658314) -DecimalFloatPackLosslessTest:testPackDeployed(int224,int32) (runs: 5096, μ: 163825, ~: 163827) -DecimalFloatParseTest:testParseDeployed(string) (runs: 5096, μ: 3656508, ~: 3655563) -DecimalFloatPowTest:testPowDeployed(bytes32,bytes32) (runs: 5096, μ: 3682862, ~: 3658371) -DecimalFloatSqrtTest:testSqrtDeployed(bytes32) (runs: 5096, μ: 3670762, ~: 3671411) -DecimalFloatSubTest:testSubDeployed(bytes32,bytes32) (runs: 5096, μ: 3658859, ~: 3659274) -DecimalFloatToFixedDecimalLosslessTest:testToFixedDecimalLosslessDeployed(bytes32,uint8) (runs: 5096, μ: 3656934, ~: 3656799) -DecimalFloatToFixedDecimalLossyTest:testToFixedDecimalLossyDeployed(bytes32,uint8) (runs: 5096, μ: 3656450, ~: 3656383) -LibDecimalFloatAbsTest:testAbsMinValue(int32) (runs: 5096, μ: 4475, ~: 4475) -LibDecimalFloatAbsTest:testAbsNegative(int256,int32) (runs: 5096, μ: 2726, ~: 2993) -LibDecimalFloatAbsTest:testAbsNonNegative(int256,int32) (runs: 5096, μ: 2251, ~: 2538) -LibDecimalFloatCeilTest:testCeilExamples() (gas: 49568) -LibDecimalFloatCeilTest:testCeilInRange(int224,int256) (runs: 5096, μ: 4531, ~: 4525) -LibDecimalFloatCeilTest:testCeilLessThanMin(int224,int256) (runs: 5096, μ: 3518, ~: 3834) -LibDecimalFloatCeilTest:testCeilNonNegative(int224,int256) (runs: 5096, μ: 2315, ~: 2440) -LibDecimalFloatCeilTest:testCeilNotReverts(bytes32) (runs: 5096, μ: 633, ~: 408) +LibDecimalFloatAbsTest:testAbsMinValue(int32) (runs: 5096, μ: 4589, ~: 4589) +LibDecimalFloatAbsTest:testAbsNegative(int256,int32) (runs: 5096, μ: 2831, ~: 3099) +LibDecimalFloatAbsTest:testAbsNonNegative(int256,int32) (runs: 5096, μ: 2358, ~: 2644) +LibDecimalFloatCeilTest:testCeilExamples() (gas: 52102) +LibDecimalFloatCeilTest:testCeilInRange(int224,int256) (runs: 5096, μ: 4626, ~: 4639) +LibDecimalFloatCeilTest:testCeilLessThanMin(int224,int256) (runs: 5096, μ: 3629, ~: 3948) +LibDecimalFloatCeilTest:testCeilNonNegative(int224,int256) (runs: 5096, μ: 2304, ~: 2440) +LibDecimalFloatCeilTest:testCeilNotReverts(bytes32) (runs: 5096, μ: 671, ~: 408) LibDecimalFloatCeilTest:testCeilZero(int32) (runs: 5096, μ: 1915, ~: 1915) LibDecimalFloatConstantsTest:testFloatE() (gas: 534) LibDecimalFloatConstantsTest:testFloatHalf() (gas: 513) LibDecimalFloatConstantsTest:testFloatMaxNegativeValue() (gas: 556) -LibDecimalFloatConstantsTest:testFloatMaxNegativeValueIsMax(bytes32) (runs: 5096, μ: 4145, ~: 4276) +LibDecimalFloatConstantsTest:testFloatMaxNegativeValueIsMax(bytes32) (runs: 5096, μ: 4211, ~: 4378) LibDecimalFloatConstantsTest:testFloatMaxPositiveValue() (gas: 512) -LibDecimalFloatConstantsTest:testFloatMaxPositiveValueIsMax(bytes32) (runs: 5096, μ: 698, ~: 748) +LibDecimalFloatConstantsTest:testFloatMaxPositiveValueIsMax(bytes32) (runs: 5096, μ: 700, ~: 748) LibDecimalFloatConstantsTest:testFloatMinNegativeValue() (gas: 512) LibDecimalFloatConstantsTest:testFloatMinNegativeValueIsMin(bytes32) (runs: 5096, μ: 666, ~: 622) LibDecimalFloatConstantsTest:testFloatMinPositiveValue() (gas: 534) -LibDecimalFloatConstantsTest:testFloatMinPositiveValueIsMin(bytes32) (runs: 5096, μ: 4633, ~: 4554) +LibDecimalFloatConstantsTest:testFloatMinPositiveValueIsMin(bytes32) (runs: 5096, μ: 4734, ~: 4656) LibDecimalFloatConstantsTest:testFloatOne() (gas: 535) LibDecimalFloatConstantsTest:testFloatTwo() (gas: 557) LibDecimalFloatConstantsTest:testFloatZero() (gas: 482) -LibDecimalFloatDecimalAddTest:testAddPacked(bytes32,bytes32) (runs: 5096, μ: 7592, ~: 7992) -LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessFail(uint256,uint8) (runs: 5096, μ: 6144, ~: 6184) -LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessMem(uint256,uint8) (runs: 5096, μ: 1735, ~: 1665) -LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessPass(uint256,uint8) (runs: 5096, μ: 1142, ~: 1122) -LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessFail() (gas: 4640) -LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessPacked(bytes32,uint8) (runs: 5096, μ: 5929, ~: 5892) -LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessPass(int256,int256,uint8) (runs: 5096, μ: 5354, ~: 5232) -LibDecimalFloatDecimalTest:testFixedDecimalRoundTripLossless(uint256,uint8) (runs: 5096, μ: 1403, ~: 1337) +LibDecimalFloatDecimalAddTest:testAddPacked(bytes32,bytes32) (runs: 5096, μ: 7900, ~: 8205) +LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessFail(uint256,uint8) (runs: 5096, μ: 6167, ~: 6206) +LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessMem(uint256,uint8) (runs: 5096, μ: 1739, ~: 1665) +LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessPackedZeroDecimalsIsIdentity(uint256) (runs: 5096, μ: 1146, ~: 1070) +LibDecimalFloatDecimalLosslessTest:testFromFixedDecimalLosslessPass(uint256,uint8) (runs: 5096, μ: 1118, ~: 1099) +LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessFail() (gas: 4684) +LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessPacked(bytes32,uint8) (runs: 5096, μ: 5279, ~: 5809) +LibDecimalFloatDecimalLosslessTest:testToFixedDecimalLosslessPass(int256,int256,uint8) (runs: 5096, μ: 4837, ~: 4704) +LibDecimalFloatDecimalTest:testFixedDecimalRoundTripLossless(uint256,uint8) (runs: 5096, μ: 1409, ~: 1337) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyComplicated() (gas: 184877) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyMax() (gas: 172382) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyOne() (gas: 184921) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyOneMillion() (gas: 184856) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyOverflow() (gas: 213925) -LibDecimalFloatDecimalTest:testFromFixedDecimalLossyPacked(uint256,uint8) (runs: 5096, μ: 1829, ~: 1756) -LibDecimalFloatDecimalTest:testFromFixedDecimalLossyTruncateOne(uint256,uint8) (runs: 5096, μ: 1482, ~: 1454) +LibDecimalFloatDecimalTest:testFromFixedDecimalLossyPacked(uint256,uint8) (runs: 5096, μ: 1836, ~: 1756) +LibDecimalFloatDecimalTest:testFromFixedDecimalLossyTruncateOne(uint256,uint8) (runs: 5096, μ: 1473, ~: 1454) LibDecimalFloatDecimalTest:testFromFixedDecimalLossyTruncateZero(uint256,uint8) (runs: 5096, μ: 1537, ~: 1377) -LibDecimalFloatDecimalTest:testToFixedDecimalLosslessScaleUp(int256,int256,uint8) (runs: 5096, μ: 7768, ~: 7642) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyExponentOverflow(int256,int256,uint8) (runs: 5096, μ: 7703, ~: 7655) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyIdentity(int256,uint8) (runs: 5096, μ: 2102, ~: 2474) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyNegative(int256,int256,uint8) (runs: 5096, μ: 5963, ~: 6150) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyPacked(bytes32,uint8) (runs: 5096, μ: 5271, ~: 5432) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyScaleUpOverflow(int256,int256,uint8) (runs: 5096, μ: 8984, ~: 9163) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyTruncate(int256,int256,uint8) (runs: 5096, μ: 4637, ~: 4387) +LibDecimalFloatDecimalTest:testToFixedDecimalLosslessScaleUp(int256,int256,uint8) (runs: 5096, μ: 7527, ~: 7382) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyExponentOverflow(int256,int256,uint8) (runs: 5096, μ: 7708, ~: 7725) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyIdentity(int256,uint8) (runs: 5096, μ: 2100, ~: 2073) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyNegative(int256,int256,uint8) (runs: 5096, μ: 5957, ~: 5658) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyPacked(bytes32,uint8) (runs: 5096, μ: 4584, ~: 5432) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyScaleUpOverflow(int256,int256,uint8) (runs: 5096, μ: 8882, ~: 9058) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyTruncate(int256,int256,uint8) (runs: 5096, μ: 4648, ~: 4421) LibDecimalFloatDecimalTest:testToFixedDecimalLossyTruncateLossless() (gas: 4135) -LibDecimalFloatDecimalTest:testToFixedDecimalLossyUnderflow(int256,int256,uint8) (runs: 5096, μ: 3597, ~: 3527) +LibDecimalFloatDecimalTest:testToFixedDecimalLossyUnderflow(int256,int256,uint8) (runs: 5096, μ: 3604, ~: 3595) LibDecimalFloatDecimalTest:testToFixedDecimalLossyZero(int256,uint8) (runs: 5096, μ: 748, ~: 748) -LibDecimalFloatDeployTest:testDeployAddress() (gas: 3665949) -LibDecimalFloatDeployTest:testDeployAddressLogTables() (gas: 1214587) -LibDecimalFloatDeployTest:testExpectedCodeHashDecimalFloat() (gas: 3651480) -LibDecimalFloatDeployTest:testExpectedCodeHashLogTables() (gas: 1205793) -LibDecimalFloatDivTest:testDivByNegativeOneFloat(int224,int32) (runs: 5096, μ: 337590, ~: 340717) -LibDecimalFloatDivTest:testDivByOneFloat(int224,int32) (runs: 5096, μ: 311312, ~: 313372) -LibDecimalFloatDivTest:testDivPacked(bytes32,bytes32) (runs: 5096, μ: 9478, ~: 9704) -LibDecimalFloatEqTest:testEqPacked(bytes32,bytes32) (runs: 5096, μ: 2705, ~: 2605) -LibDecimalFloatEqTest:testEqXNotYExponents(bytes32,bytes32) (runs: 5096, μ: 1531, ~: 1384) +LibDecimalFloatDivTest:testDivByNegativeOneFloat(int224,int32) (runs: 5096, μ: 351172, ~: 354753) +LibDecimalFloatDivTest:testDivByOneFloat(int224,int32) (runs: 5096, μ: 318169, ~: 320869) +LibDecimalFloatDivTest:testDivPacked(bytes32,bytes32) (runs: 5096, μ: 9987, ~: 9959) +LibDecimalFloatDivTest:testDivRevertsOnExponentUnderflow() (gas: 8452) +LibDecimalFloatEqTest:testEqPacked(bytes32,bytes32) (runs: 5096, μ: 2712, ~: 2605) +LibDecimalFloatEqTest:testEqXNotYExponents(bytes32,bytes32) (runs: 5096, μ: 1540, ~: 1384) LibDecimalFloatEqTest:testEqZero(int32) (runs: 5096, μ: 1603, ~: 1603) -LibDecimalFloatFloorTest:testFloorExamples() (gas: 53755) -LibDecimalFloatFloorTest:testFloorGas0() (gas: 1051) -LibDecimalFloatFloorTest:testFloorGasTiny() (gas: 883) +LibDecimalFloatExoticFloatTest:testCanonicalToDecimalStringWorks() (gas: 8623) +LibDecimalFloatExoticFloatTest:testExoticAdd() (gas: 5066) +LibDecimalFloatExoticFloatTest:testExoticCeil() (gas: 2523) +LibDecimalFloatExoticFloatTest:testExoticDivSelf() (gas: 5664) +LibDecimalFloatExoticFloatTest:testExoticEq() (gas: 2609) +LibDecimalFloatExoticFloatTest:testExoticFloor() (gas: 1628) +LibDecimalFloatExoticFloatTest:testExoticInv() (gas: 4620) +LibDecimalFloatExoticFloatTest:testExoticMinus() (gas: 1844) +LibDecimalFloatExoticFloatTest:testExoticMul() (gas: 4743) +LibDecimalFloatExoticFloatTest:testExoticOrdering() (gas: 4532) +LibDecimalFloatExoticFloatTest:testExoticSubSelfToZero() (gas: 4492) +LibDecimalFloatExoticFloatTest:testExoticToDecimalStringMatchesCanonical() (gas: 72856) +LibDecimalFloatExoticFloatTest:testExoticToScientificString() (gas: 13475) +LibDecimalFloatFloorTest:testFloorExamples() (gas: 57235) +LibDecimalFloatFloorTest:testFloorGas0() (gas: 1157) +LibDecimalFloatFloorTest:testFloorGasTiny() (gas: 989) LibDecimalFloatFloorTest:testFloorGasZero() (gas: 539) -LibDecimalFloatFloorTest:testFloorInRangeNegative(int224,int256) (runs: 5096, μ: 7412, ~: 7775) -LibDecimalFloatFloorTest:testFloorInRangeNonNegative(int224,int256) (runs: 5096, μ: 4611, ~: 4476) -LibDecimalFloatFloorTest:testFloorLessThanMin(int224,int256) (runs: 5096, μ: 3104, ~: 2987) -LibDecimalFloatFloorTest:testFloorNonNegative(int224,int256) (runs: 5096, μ: 2263, ~: 2395) -LibDecimalFloatFloorTest:testFloorNotReverts(bytes32) (runs: 5096, μ: 624, ~: 362) -LibDecimalFloatFracTest:testFracExamples() (gas: 36091) -LibDecimalFloatFracTest:testFracGas0() (gas: 977) -LibDecimalFloatFracTest:testFracGasTiny() (gas: 862) -LibDecimalFloatFracTest:testFracGasZero() (gas: 781) -LibDecimalFloatFracTest:testFracInRange(int224,int256) (runs: 5096, μ: 3408, ~: 3452) -LibDecimalFloatFracTest:testFracLessThanMin(int224,int256) (runs: 5096, μ: 2830, ~: 2876) -LibDecimalFloatFracTest:testFracNonNegative(int224,int256) (runs: 5096, μ: 2478, ~: 2609) -LibDecimalFloatFracTest:testFracNotReverts(bytes32) (runs: 5096, μ: 615, ~: 593) +LibDecimalFloatFloorTest:testFloorInRangeNegative(int224,int256) (runs: 5096, μ: 7529, ~: 7837) +LibDecimalFloatFloorTest:testFloorInRangeNonNegative(int224,int256) (runs: 5096, μ: 4711, ~: 4582) +LibDecimalFloatFloorTest:testFloorLessThanMin(int224,int256) (runs: 5096, μ: 3214, ~: 3093) +LibDecimalFloatFloorTest:testFloorNonNegative(int224,int256) (runs: 5096, μ: 2261, ~: 2395) +LibDecimalFloatFloorTest:testFloorNotReverts(bytes32) (runs: 5096, μ: 674, ~: 362) +LibDecimalFloatFracTest:testFracExamples() (gas: 40119) +LibDecimalFloatFracTest:testFracGas0() (gas: 1083) +LibDecimalFloatFracTest:testFracGasTiny() (gas: 968) +LibDecimalFloatFracTest:testFracGasZero() (gas: 887) +LibDecimalFloatFracTest:testFracInRange(int224,int256) (runs: 5096, μ: 3509, ~: 3558) +LibDecimalFloatFracTest:testFracLessThanMin(int224,int256) (runs: 5096, μ: 2939, ~: 2982) +LibDecimalFloatFracTest:testFracNonNegative(int224,int256) (runs: 5096, μ: 2577, ~: 2715) +LibDecimalFloatFracTest:testFracNotReverts(bytes32) (runs: 5096, μ: 721, ~: 699) LibDecimalFloatGtTest:testGtGasAZero() (gas: 978) LibDecimalFloatGtTest:testGtGasBZero() (gas: 978) LibDecimalFloatGtTest:testGtGasBothZero() (gas: 736) LibDecimalFloatGtTest:testGtGasDifferentSigns() (gas: 1011) LibDecimalFloatGtTest:testGtGasExponentDiffOverflow() (gas: 1179) LibDecimalFloatGtTest:testGtOneEAny(bytes32) (runs: 5096, μ: 658, ~: 658) -LibDecimalFloatGtTest:testGtReference(int224,int32,int224,int32) (runs: 5096, μ: 8057, ~: 9149) +LibDecimalFloatGtTest:testGtReference(int224,int32,int224,int32) (runs: 5096, μ: 7955, ~: 8936) LibDecimalFloatGtTest:testGtX(int224,int32) (runs: 5096, μ: 1066, ~: 1067) -LibDecimalFloatGtTest:testGtXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3223, ~: 3465) -LibDecimalFloatGtTest:testGtXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3393, ~: 3649) -LibDecimalFloatGtTest:testGtXNotY(bytes32,bytes32) (runs: 5096, μ: 1529, ~: 1383) -LibDecimalFloatGtTest:testGtXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 4275, ~: 4276) -LibDecimalFloatGtTest:testGtXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2876, ~: 3141) +LibDecimalFloatGtTest:testGtXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3218, ~: 3465) +LibDecimalFloatGtTest:testGtXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3395, ~: 3649) +LibDecimalFloatGtTest:testGtXNotY(bytes32,bytes32) (runs: 5096, μ: 1539, ~: 1383) +LibDecimalFloatGtTest:testGtXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 4268, ~: 4276) +LibDecimalFloatGtTest:testGtXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2872, ~: 3141) LibDecimalFloatGtTest:testGtZero(int32,int32) (runs: 5096, μ: 1609, ~: 1609) LibDecimalFloatGteTest:testGteGasAZero() (gas: 981) LibDecimalFloatGteTest:testGteGasBZero() (gas: 1025) @@ -128,148 +104,214 @@ LibDecimalFloatGteTest:testGteGasBothZero() (gas: 738) LibDecimalFloatGteTest:testGteGasDifferentSigns() (gas: 1033) LibDecimalFloatGteTest:testGteGasExponentDiffOverflow() (gas: 1138) LibDecimalFloatGteTest:testGteOneEAny(bytes32) (runs: 5096, μ: 658, ~: 658) -LibDecimalFloatGteTest:testGteReference(int224,int32,int224,int32) (runs: 5096, μ: 8099, ~: 9130) +LibDecimalFloatGteTest:testGteReference(int224,int32,int224,int32) (runs: 5096, μ: 8010, ~: 8968) LibDecimalFloatGteTest:testGteX(int224,int32) (runs: 5096, μ: 1109, ~: 1110) -LibDecimalFloatGteTest:testGteXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3253, ~: 3497) -LibDecimalFloatGteTest:testGteXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3406, ~: 3661) -LibDecimalFloatGteTest:testGteXNotLtY(bytes32,bytes32) (runs: 5096, μ: 1128, ~: 1028) -LibDecimalFloatGteTest:testGteXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 4301, ~: 4304) -LibDecimalFloatGteTest:testGteXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2480, ~: 2755) +LibDecimalFloatGteTest:testGteXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3249, ~: 3497) +LibDecimalFloatGteTest:testGteXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3408, ~: 3661) +LibDecimalFloatGteTest:testGteXNotLtY(bytes32,bytes32) (runs: 5096, μ: 1134, ~: 1028) +LibDecimalFloatGteTest:testGteXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 4295, ~: 4304) +LibDecimalFloatGteTest:testGteXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2477, ~: 2755) LibDecimalFloatGteTest:testGteZero(int32,int32) (runs: 5096, μ: 1654, ~: 1654) LibDecimalFloatImplementationAddTest:testAdd123456789987654321() (gas: 2134) LibDecimalFloatImplementationAddTest:testAdd123456789e9987654321() (gas: 2185) -LibDecimalFloatImplementationAddTest:testAddNeverRevert(int256,int256,int256,int256) (runs: 5096, μ: 5066, ~: 5121) +LibDecimalFloatImplementationAddTest:testAddCommutative(int256,int256,int256,int256) (runs: 5096, μ: 7359, ~: 7523) +LibDecimalFloatImplementationAddTest:testAddNeverRevert(int256,int256,int256,int256) (runs: 5096, μ: 5058, ~: 5116) LibDecimalFloatImplementationAddTest:testAddOneOneNotMaximized() (gas: 3113) LibDecimalFloatImplementationAddTest:testAddOneOnePreMaximized() (gas: 1305) LibDecimalFloatImplementationAddTest:testAddOneZero() (gas: 463) -LibDecimalFloatImplementationAddTest:testAddRevertMaxA() (gas: 6056) -LibDecimalFloatImplementationAddTest:testAddSameExponent(int256,int256) (runs: 5096, μ: 6354, ~: 6446) +LibDecimalFloatImplementationAddTest:testAddRevertMaxA() (gas: 6123) +LibDecimalFloatImplementationAddTest:testAddSameExponent(int256,int256) (runs: 5096, μ: 6346, ~: 6436) LibDecimalFloatImplementationAddTest:testAddZero() (gas: 483) -LibDecimalFloatImplementationAddTest:testAddZeroAnyExponent(int128) (runs: 5096, μ: 1736, ~: 1668) +LibDecimalFloatImplementationAddTest:testAddZeroAnyExponent(int128) (runs: 5096, μ: 1735, ~: 1668) LibDecimalFloatImplementationAddTest:testAddZeroOne() (gas: 483) -LibDecimalFloatImplementationAddTest:testAddZeroToAnyNonZero(int256,int256,int256) (runs: 5096, μ: 6554, ~: 6480) +LibDecimalFloatImplementationAddTest:testAddZeroToAnyNonZero(int256,int256,int256) (runs: 5096, μ: 6553, ~: 6480) LibDecimalFloatImplementationAddTest:testAddingSmallToLargeReturnsLargeExamples() (gas: 62746) LibDecimalFloatImplementationAddTest:testAddingSmallToLargeReturnsLargeFuzz(int256,int256,int256,int256) (runs: 5096, μ: 11417, ~: 11522) LibDecimalFloatImplementationAddTest:testGasAddOne() (gas: 1845) LibDecimalFloatImplementationAddTest:testGasAddZero() (gas: 377) -LibDecimalFloatImplementationAddTest:testOverflowChecks(int256,int256) (runs: 5096, μ: 711, ~: 710) -LibDecimalFloatImplementationDivTest:testDiv1Over3() (gas: 3805) -LibDecimalFloatImplementationDivTest:testDiv1Over3Gas0() (gas: 2512) -LibDecimalFloatImplementationDivTest:testDiv1Over3Gas10() (gas: 20913) +LibDecimalFloatImplementationAddTest:testOverflowChecks(int256,int256) (runs: 5096, μ: 712, ~: 710) +LibDecimalFloatImplementationDivTest:testDiv1Over3() (gas: 3828) +LibDecimalFloatImplementationDivTest:testDiv1Over3Gas0() (gas: 2535) +LibDecimalFloatImplementationDivTest:testDiv1Over3Gas10() (gas: 20914) LibDecimalFloatImplementationDivTest:testDiv1Over9Over1Over3() (gas: 10748) -LibDecimalFloatImplementationDivTest:testDiv1e18Over3() (gas: 3381) -LibDecimalFloatImplementationDivTest:testDivBy1(int256,int256) (runs: 5096, μ: 259396, ~: 263258) -LibDecimalFloatImplementationDivTest:testDivByNegativeOneFloat(int256,int256) (runs: 5096, μ: 261764, ~: 269063) -LibDecimalFloatImplementationDivTest:testDivMaxPositiveValueDenominatorNotRevert(int256,int256) (runs: 5096, μ: 2584, ~: 2646) -LibDecimalFloatImplementationDivTest:testDivMinPositiveValueDenominatorRevert(int256,int256) (runs: 5096, μ: 6860, ~: 6912) -LibDecimalFloatImplementationDivTest:testDivNegative1Over3() (gas: 3954) -LibDecimalFloatImplementationDivTest:testDivOOMs5and2() (gas: 2826) -LibDecimalFloatImplementationDivTest:testDivOOMsOverTen() (gas: 3829) -LibDecimalFloatImplementationDivTest:testDivTenOverOOMs() (gas: 3722) -LibDecimalFloatImplementationDivTest:testDivZero(int256,int256) (runs: 5096, μ: 5366, ~: 5429) -LibDecimalFloatImplementationDivTest:testUnnormalizedThreesDiv0(int256,int256) (runs: 100, μ: 22006847, ~: 21962709) +LibDecimalFloatImplementationDivTest:testDiv1e18Over3() (gas: 3359) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentBoundaries() (gas: 84789) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentFullDivisor() (gas: 4727) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentLargeDivisor() (gas: 4499) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentLeaves() (gas: 95803) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentSpillOverflowReturnsZero() (gas: 1447) +LibDecimalFloatImplementationDivTest:testDivAdjustExponentSpillsToExponentB() (gas: 2330) +LibDecimalFloatImplementationDivTest:testDivBy1(int256,int256) (runs: 5096, μ: 259175, ~: 262678) +LibDecimalFloatImplementationDivTest:testDivByNegativeOneFloat(int256,int256) (runs: 5096, μ: 261318, ~: 268746) +LibDecimalFloatImplementationDivTest:testDivMaxPositiveValueDenominatorNotRevert(int256,int256) (runs: 5096, μ: 2604, ~: 2669) +LibDecimalFloatImplementationDivTest:testDivMinPositiveValueDenominatorRevert(int256,int256) (runs: 5096, μ: 6880, ~: 6927) +LibDecimalFloatImplementationDivTest:testDivNegative1Over3() (gas: 3997) +LibDecimalFloatImplementationDivTest:testDivOOMs5and2() (gas: 2827) +LibDecimalFloatImplementationDivTest:testDivOOMsOverTen() (gas: 3785) +LibDecimalFloatImplementationDivTest:testDivSelf(int256,int256) (runs: 5096, μ: 7708, ~: 7791) +LibDecimalFloatImplementationDivTest:testDivTenOverOOMs() (gas: 3723) +LibDecimalFloatImplementationDivTest:testDivUnderflowReturnsZero() (gas: 3123) +LibDecimalFloatImplementationDivTest:testDivZero(int256,int256) (runs: 5096, μ: 5411, ~: 5474) +LibDecimalFloatImplementationDivTest:testUnnormalizedThreesDiv0(int256,int256) (runs: 100, μ: 22014199, ~: 21962687) +LibDecimalFloatImplementationEqTest:testEqDiff76Boundary() (gas: 1296) +LibDecimalFloatImplementationEqTest:testEqDiff77OverflowGuardUnequal() (gas: 1017) LibDecimalFloatImplementationEqTest:testEqGasAZero() (gas: 425) LibDecimalFloatImplementationEqTest:testEqGasBZero() (gas: 468) -LibDecimalFloatImplementationEqTest:testEqGasBothZero() (gas: 445) +LibDecimalFloatImplementationEqTest:testEqGasBothZero() (gas: 423) LibDecimalFloatImplementationEqTest:testEqGasDifferentSigns() (gas: 477) LibDecimalFloatImplementationEqTest:testEqGasExponentDiffOverflow() (gas: 527) -LibDecimalFloatImplementationEqTest:testEqNotReverts(int256,int256,int256,int256) (runs: 5096, μ: 626, ~: 569) -LibDecimalFloatImplementationEqTest:testEqOneEAny(int256,int256) (runs: 5096, μ: 580, ~: 580) -LibDecimalFloatImplementationEqTest:testEqReference(int256,int256,int256,int256) (runs: 5096, μ: 6584, ~: 7459) -LibDecimalFloatImplementationEqTest:testEqX(int256) (runs: 5096, μ: 554, ~: 554) +LibDecimalFloatImplementationEqTest:testEqNotReverts(int256,int256,int256,int256) (runs: 5096, μ: 628, ~: 671) +LibDecimalFloatImplementationEqTest:testEqOneEAny(int256,int256) (runs: 5096, μ: 625, ~: 625) +LibDecimalFloatImplementationEqTest:testEqReference(int256,int256,int256,int256) (runs: 5096, μ: 6653, ~: 7685) +LibDecimalFloatImplementationEqTest:testEqSameValueDifferentRepresentations(int256,uint8) (runs: 5096, μ: 26751, ~: 30543) +LibDecimalFloatImplementationEqTest:testEqX(int256) (runs: 5096, μ: 620, ~: 620) LibDecimalFloatImplementationEqTest:testEqXEAnyVsXEAny(int256,int256,int256) (runs: 5096, μ: 4028, ~: 4022) -LibDecimalFloatImplementationEqTest:testEqXEqY(int256,int256,int256,int256) (runs: 5096, μ: 699, ~: 642) -LibDecimalFloatImplementationEqTest:testEqXNotY(int256,int256,int256,int256) (runs: 5096, μ: 5174, ~: 5239) -LibDecimalFloatImplementationEqTest:testEqZero(int256,int256) (runs: 5096, μ: 602, ~: 602) +LibDecimalFloatImplementationEqTest:testEqXEqY(int256,int256,int256,int256) (runs: 5096, μ: 701, ~: 744) +LibDecimalFloatImplementationEqTest:testEqXNotY(int256,int256,int256,int256) (runs: 5096, μ: 5146, ~: 5219) +LibDecimalFloatImplementationEqTest:testEqZero(int256,int256) (runs: 5096, μ: 580, ~: 580) LibDecimalFloatImplementationIntFracTest:testIntFracExamples() (gas: 7940) -LibDecimalFloatImplementationIntFracTest:testIntFracNegExponentLarge(int256,int256) (runs: 5096, μ: 2142, ~: 2392) +LibDecimalFloatImplementationIntFracTest:testIntFracNegExponentLarge(int256,int256) (runs: 5096, μ: 2147, ~: 2392) LibDecimalFloatImplementationIntFracTest:testIntFracNegExponentSmall(int256) (runs: 5096, μ: 100629, ~: 100629) LibDecimalFloatImplementationIntFracTest:testIntFracNonNegExponent(int256,int256) (runs: 5096, μ: 1804, ~: 1780) +LibDecimalFloatImplementationInternalsTest:testAbsMinInt256() (gas: 470) +LibDecimalFloatImplementationInternalsTest:testAbsNegative(int256) (runs: 5096, μ: 1942, ~: 2125) +LibDecimalFloatImplementationInternalsTest:testAbsPositive(int256) (runs: 5096, μ: 1575, ~: 1555) +LibDecimalFloatImplementationInternalsTest:testAbsZero() (gas: 367) +LibDecimalFloatImplementationInternalsTest:testCompareRescaleDifferentExponents() (gas: 697) +LibDecimalFloatImplementationInternalsTest:testCompareRescaleEqual() (gas: 724) +LibDecimalFloatImplementationInternalsTest:testCompareRescaleSameExponent() (gas: 500) +LibDecimalFloatImplementationInternalsTest:testMantissa4BelowResolutionFlagIsFaithful(int256,int256) (runs: 5096, μ: 3431, ~: 3464) +LibDecimalFloatImplementationInternalsTest:testMantissa4ExactLookup() (gas: 550) +LibDecimalFloatImplementationInternalsTest:testMantissa4ExponentMinus4BoundaryCoefficients() (gas: 2195) +LibDecimalFloatImplementationInternalsTest:testMantissa4ExponentMinus80IsScaleBranch() (gas: 1545) +LibDecimalFloatImplementationInternalsTest:testMantissa4ExponentMinus81IsBelowResolution() (gas: 1048) +LibDecimalFloatImplementationInternalsTest:testMantissa4FuzzExponentBelowMinus80(int256,int256) (runs: 5096, μ: 2116, ~: 2357) +LibDecimalFloatImplementationInternalsTest:testMantissa4FuzzExponentMinus3ToMinus1(int256,int256) (runs: 5096, μ: 4027, ~: 4021) +LibDecimalFloatImplementationInternalsTest:testMantissa4FuzzExponentMinus4(int256) (runs: 5096, μ: 605, ~: 605) +LibDecimalFloatImplementationInternalsTest:testMantissa4FuzzExponentMinus80ToMinus5(int256,int256) (runs: 5096, μ: 3186, ~: 3217) +LibDecimalFloatImplementationInternalsTest:testMantissa4FuzzExponentNonNegative(int256,int256) (runs: 5096, μ: 1807, ~: 1786) +LibDecimalFloatImplementationInternalsTest:testMantissa4Int256MinScaleBranch() (gas: 969) +LibDecimalFloatImplementationInternalsTest:testMantissa4InterpolateFalseImpliesExact(int256,int256) (runs: 5096, μ: 4131, ~: 4158) +LibDecimalFloatImplementationInternalsTest:testMantissa4NegativeTruncationMinus5() (gas: 1176) +LibDecimalFloatImplementationInternalsTest:testMantissa4NonNegativeBoundaries() (gas: 1980) +LibDecimalFloatImplementationInternalsTest:testMantissa4ScaleUpBranchExact() (gas: 1030) +LibDecimalFloatImplementationInternalsTest:testMantissa4TruncationFlagEdgeMinus5() (gas: 1154) +LibDecimalFloatImplementationInternalsTest:testMantissa4Zero() (gas: 656) +LibDecimalFloatImplementationInternalsTest:testMul512MaxValues() (gas: 550) +LibDecimalFloatImplementationInternalsTest:testMul512NoOverflow(uint128,uint128) (runs: 5096, μ: 828, ~: 828) +LibDecimalFloatImplementationInternalsTest:testMul512Zero() (gas: 493) +LibDecimalFloatImplementationInternalsTest:testMulDivLargeNumerator() (gas: 864) +LibDecimalFloatImplementationInternalsTest:testMulDivOverflowReverts() (gas: 4417) +LibDecimalFloatImplementationInternalsTest:testMulDivSimple() (gas: 526) +LibDecimalFloatImplementationInternalsTest:testUnitLinearInterpolationExact() (gas: 486) +LibDecimalFloatImplementationInternalsTest:testUnitLinearInterpolationMidpoint() (gas: 9798) LibDecimalFloatImplementationInvTest:testInv0() (gas: 4204) LibDecimalFloatImplementationInvTest:testInvGas0() (gas: 2215) -LibDecimalFloatImplementationInvTest:testInvReference(int256,int256) (runs: 5096, μ: 9613, ~: 9689) +LibDecimalFloatImplementationInvTest:testInvReference(int256,int256) (runs: 5096, μ: 9615, ~: 9689) LibDecimalFloatImplementationInvTest:testInvSlowGas0() (gas: 2527) -LibDecimalFloatImplementationLog10Test:testExactLogs() (gas: 1230159) -LibDecimalFloatImplementationLog10Test:testExactLookupsLog10() (gas: 1274148) -LibDecimalFloatImplementationLog10Test:testInterpolatedLookups() (gas: 1229411) -LibDecimalFloatImplementationLog10Test:testLog10One() (gas: 1403021) -LibDecimalFloatImplementationLog10Test:testSub1() (gas: 1230275) -LibDecimalFloatImplementationLookupLogTableValTest:testLookupLogTableVal() (gas: 1312590) -LibDecimalFloatImplementationMaximizeTest:testMaximizedEverything(int256,int256) (runs: 5096, μ: 2625, ~: 2672) -LibDecimalFloatImplementationMaximizeTest:testMaximizedExamples() (gas: 130254) -LibDecimalFloatImplementationMaximizeTest:testMaximizedIdempotent(int256,int256) (runs: 5096, μ: 2827, ~: 2865) -LibDecimalFloatImplementationMaximizeTest:testMaximizedReference(int256,int256) (runs: 5096, μ: 6034, ~: 6652) -LibDecimalFloatImplementationMinusTest:testMinusIsSubZero(int256,int256,int256) (runs: 5096, μ: 3597, ~: 3531) -LibDecimalFloatImplementationMulTest:testMul123456789987654321() (gas: 1718) -LibDecimalFloatImplementationMulTest:testMul123456789987654321WithExponents(int128,int128) (runs: 5096, μ: 4993, ~: 5201) -LibDecimalFloatImplementationMulTest:testMul1_3979_0_5() (gas: 2510) +LibDecimalFloatImplementationLog10Test:testExactLogs() (gas: 1946981) +LibDecimalFloatImplementationLog10Test:testExactLookupsLog10() (gas: 1992187) +LibDecimalFloatImplementationLog10Test:testInterpolatedLookups() (gas: 1944410) +LibDecimalFloatImplementationLog10Test:testLog10NegativeReverts(int256,int256) (runs: 5096, μ: 1933205, ~: 1933097) +LibDecimalFloatImplementationLog10Test:testLog10One() (gas: 2141219) +LibDecimalFloatImplementationLog10Test:testLog10ZeroReverts() (gas: 1929948) +LibDecimalFloatImplementationLog10Test:testSub1() (gas: 1945593) +LibDecimalFloatImplementationLookupLogTableValTest:testLookupLogTableVal() (gas: 2027251) +LibDecimalFloatImplementationMaximizeTest:testMaximizeFullRevertsIffPartial(uint8,uint8) (runs: 5096, μ: 5647, ~: 4776) +LibDecimalFloatImplementationMaximizeTest:testMaximizeOneMoreOomSignAsymmetry() (gas: 2528) +LibDecimalFloatImplementationMaximizeTest:testMaximizeOracleBoundaryCorners(uint8,uint8) (runs: 5096, μ: 4182, ~: 4282) +LibDecimalFloatImplementationMaximizeTest:testMaximizeOracleFullDomain(int256,int256) (runs: 5096, μ: 6296, ~: 6976) +LibDecimalFloatImplementationMaximizeTest:testMaximizePartialBoundary() (gas: 10179) +LibDecimalFloatImplementationMaximizeTest:testMaximizePartialBoundaryCoefficients(int256,uint256) (runs: 5096, μ: 7143, ~: 7150) +LibDecimalFloatImplementationMaximizeTest:testMaximizePartialExamples() (gas: 43908) +LibDecimalFloatImplementationMaximizeTest:testMaximizePartialFuzz(int256,uint256) (runs: 5096, μ: 8091, ~: 8214) +LibDecimalFloatImplementationMaximizeTest:testMaximizePartialIdempotent(int256,uint256) (runs: 5096, μ: 7278, ~: 7394) +LibDecimalFloatImplementationMaximizeTest:testMaximizeStaircaseBoundarySweep() (gas: 2297961) +LibDecimalFloatImplementationMaximizeTest:testMaximizeValuePreservedFullDomain(int256,int256) (runs: 5096, μ: 5331, ~: 5411) +LibDecimalFloatImplementationMaximizeTest:testMaximizeZeroCanonicalizes(int256) (runs: 5096, μ: 731, ~: 731) +LibDecimalFloatImplementationMaximizeTest:testMaximizedEverything(int256,int256) (runs: 5096, μ: 2657, ~: 2700) +LibDecimalFloatImplementationMaximizeTest:testMaximizedExamples() (gas: 129898) +LibDecimalFloatImplementationMaximizeTest:testMaximizedIdempotent(int256,int256) (runs: 5096, μ: 2790, ~: 2827) +LibDecimalFloatImplementationMaximizeTest:testMaximizedReference(int256,int256) (runs: 5096, μ: 5997, ~: 6562) +LibDecimalFloatImplementationMinusTest:testAdditiveInverse(int256,int256) (runs: 5096, μ: 6846, ~: 6951) +LibDecimalFloatImplementationMinusTest:testDoubleNegation(int256,int256) (runs: 5096, μ: 5057, ~: 5092) +LibDecimalFloatImplementationMinusTest:testMinusExponentOverflow() (gas: 4217) +LibDecimalFloatImplementationMinusTest:testMinusIsSubZero(int256,int256,int256) (runs: 5096, μ: 3622, ~: 3554) +LibDecimalFloatImplementationMulTest:testMul123456789987654321() (gas: 1785) +LibDecimalFloatImplementationMulTest:testMul123456789987654321WithExponents(int128,int128) (runs: 5096, μ: 4995, ~: 5201) +LibDecimalFloatImplementationMulTest:testMul1_3979_0_5() (gas: 2555) LibDecimalFloatImplementationMulTest:testMul1e181e19() (gas: 1765) -LibDecimalFloatImplementationMulTest:testMulGasOne() (gas: 1450) -LibDecimalFloatImplementationMulTest:testMulGasZero() (gas: 318) +LibDecimalFloatImplementationMulTest:testMulCommutative(int256,int256,int256,int256) (runs: 5096, μ: 6210, ~: 5780) +LibDecimalFloatImplementationMulTest:testMulGasOne() (gas: 1428) +LibDecimalFloatImplementationMulTest:testMulGasZero() (gas: 385) +LibDecimalFloatImplementationMulTest:testMulIdentity(int256,int256) (runs: 5096, μ: 3215, ~: 3231) LibDecimalFloatImplementationMulTest:testMulMaxSignedCoefficient() (gas: 2830) -LibDecimalFloatImplementationMulTest:testMulNegativeOne() (gas: 1817) +LibDecimalFloatImplementationMulTest:testMulNegativeOne() (gas: 1795) LibDecimalFloatImplementationMulTest:testMulNegativeOneOne() (gas: 1873) -LibDecimalFloatImplementationMulTest:testMulNotRevertAnyExpectation(int256,int256,int256,int256) (runs: 5096, μ: 6046, ~: 5223) -LibDecimalFloatImplementationMulTest:testMulOneNegativeOne() (gas: 1849) +LibDecimalFloatImplementationMulTest:testMulNotRevertAnyExpectation(int256,int256,int256,int256) (runs: 5096, μ: 6004, ~: 5201) +LibDecimalFloatImplementationMulTest:testMulOneNegativeOne() (gas: 1827) LibDecimalFloatImplementationMulTest:testMulOneOne() (gas: 1741) -LibDecimalFloatImplementationMulTest:testMulOneZero() (gas: 655) -LibDecimalFloatImplementationMulTest:testMulZero0Exponent() (gas: 677) +LibDecimalFloatImplementationMulTest:testMulOneZero() (gas: 633) +LibDecimalFloatImplementationMulTest:testMulZero0Exponent() (gas: 655) LibDecimalFloatImplementationMulTest:testMulZeroAnyExponent(int64,int64) (runs: 5096, μ: 877, ~: 877) LibDecimalFloatImplementationMulTest:testMulZeroOne() (gas: 612) -LibDecimalFloatImplementationPow10Test:testExactLookupsPow10() (gas: 1244107) -LibDecimalFloatImplementationPow10Test:testExactPows() (gas: 1224498) -LibDecimalFloatImplementationPow10Test:testInterpolatedLookupsPower() (gas: 1258533) -LibDecimalFloatImplementationPow10Test:testNoRevert(int224,int32) (runs: 5096, μ: 1223752, ~: 1222475) -LibDecimalFloatImplementationPow10Test:testPow10One() (gas: 1434249) -LibDecimalFloatImplementationSubTest:testSubIsAdd(int256,int256,int256,int256) (runs: 5096, μ: 10262, ~: 10418) -LibDecimalFloatImplementationSubTest:testSubMinSignedValue(int256,int256,int256) (runs: 5096, μ: 6571, ~: 6665) +LibDecimalFloatImplementationPow10Test:testExactLookupsPow10() (gas: 1960406) +LibDecimalFloatImplementationPow10Test:testExactPows() (gas: 1939839) +LibDecimalFloatImplementationPow10Test:testInterpolatedLookupsPower() (gas: 1973597) +LibDecimalFloatImplementationPow10Test:testNoRevert(int224,int32) (runs: 5096, μ: 1938249, ~: 1937139) +LibDecimalFloatImplementationPow10Test:testPow10One() (gas: 2159450) +LibDecimalFloatImplementationSubTest:testSubIsAdd(int256,int256,int256,int256) (runs: 5096, μ: 10255, ~: 10428) +LibDecimalFloatImplementationSubTest:testSubMinSignedValue(int256,int256,int256) (runs: 5096, μ: 6580, ~: 6681) LibDecimalFloatImplementationSubTest:testSubOneFromMax() (gas: 3331) -LibDecimalFloatImplementationSubTest:testSubSelf(int224,int32) (runs: 5096, μ: 2931, ~: 3037) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedAB(uint256,uint256,uint256,int256) (runs: 5096, μ: 1608, ~: 1545) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedABOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5581, ~: 5582) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedBA(uint256,uint256,uint256,int256) (runs: 5096, μ: 5580, ~: 5580) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedBAOverflow(uint256,uint256,int256) (runs: 5096, μ: 1449, ~: 1400) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyNegative(uint256,uint256,uint256,int256) (runs: 5096, μ: 1560, ~: 1494) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyNegativeOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5447, ~: 5445) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyPositive(uint256,uint256,uint256,int256) (runs: 5096, μ: 1303, ~: 1243) -LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyPositiveOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5339, ~: 5343) +LibDecimalFloatImplementationSubTest:testSubSelf(int224,int32) (runs: 5096, μ: 2927, ~: 3037) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsExponentOverflowMixedSign() (gas: 4604) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsExponentOverflowSameSign() (gas: 4441) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedAB(uint256,uint256,uint256,int256) (runs: 5096, μ: 1654, ~: 1590) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedABOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5587, ~: 5582) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedBA(uint256,uint256,uint256,int256) (runs: 5096, μ: 5585, ~: 5580) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyMixedBAOverflow(uint256,uint256,int256) (runs: 5096, μ: 1445, ~: 1400) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyNegative(uint256,uint256,uint256,int256) (runs: 5096, μ: 1573, ~: 1505) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyNegativeOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5453, ~: 5445) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyPositive(uint256,uint256,uint256,int256) (runs: 5096, μ: 1315, ~: 1254) +LibDecimalFloatImplementationUnabsUnsignedMulOrDivLossyTest:testUnabsUnsignedMulOrDivLossyPositiveOverflow(uint256,uint256,uint256,int256) (runs: 5096, μ: 5344, ~: 5343) LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentExamples() (gas: 4372) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerExponentOverflowRescaleRevert(int256,int256,int256) (runs: 5096, μ: 7936, ~: 7881) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerExponentVeryLargeDiffRevert(int256,int256,int256) (runs: 5096, μ: 6782, ~: 6965) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerTargetExponentNoRevert(int256,int256,int256) (runs: 5096, μ: 2943, ~: 2756) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerExponentOverflowRescaleRevert(int256,int256,int256) (runs: 5096, μ: 7939, ~: 7949) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerExponentVeryLargeDiffRevert(int256,int256,int256) (runs: 5096, μ: 6777, ~: 6909) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentLargerTargetExponentNoRevert(int256,int256,int256) (runs: 5096, μ: 2956, ~: 3077) LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentMaxOverflow(int256) (runs: 5096, μ: 594, ~: 594) LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentSameExponentNoop(int256,int256) (runs: 5096, μ: 549, ~: 549) LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleDown(int256,int256,int256) (runs: 5096, μ: 3723, ~: 3706) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleUpLargeDiffRevert(int256,int256,int256) (runs: 5096, μ: 6968, ~: 7158) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleUpLargeDiffRevert(int256,int256,int256) (runs: 5096, μ: 6961, ~: 7158) LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleUpNotOverflow(int256,int256,int256) (runs: 5096, μ: 6783, ~: 6779) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleUpOverflow(int256,int256,int256) (runs: 5096, μ: 7689, ~: 7663) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentSmallerExponentNoRevert(int256,int256,int256) (runs: 5096, μ: 7121, ~: 7015) -LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentTargetMoreThan76Larger(int256,int256,int256) (runs: 5096, μ: 3046, ~: 3067) -LibDecimalFloatIntegerTest:testIntegerExamples() (gas: 31205) -LibDecimalFloatIntegerTest:testIntegerInRange(int224,int256) (runs: 5096, μ: 3472, ~: 3538) -LibDecimalFloatIntegerTest:testIntegerLessThanMin(int224,int256) (runs: 5096, μ: 2817, ~: 2863) -LibDecimalFloatIntegerTest:testIntegerNonNegative(int224,int256) (runs: 5096, μ: 2484, ~: 2617) -LibDecimalFloatIntegerTest:testIntegerNotReverts(bytes32) (runs: 5096, μ: 601, ~: 603) -LibDecimalFloatInvTest:testInvMem(bytes32) (runs: 5096, μ: 7981, ~: 8094) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentScaleUpOverflow(int256,int256,int256) (runs: 5096, μ: 7685, ~: 7663) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentSmallerExponentNoRevert(int256,int256,int256) (runs: 5096, μ: 7128, ~: 7015) +LibDecimalFloatImplementationWithTargetExponentTest:testWithTargetExponentTargetMoreThan76Larger(int256,int256,int256) (runs: 5096, μ: 3059, ~: 3254) +LibDecimalFloatIntegerTest:testIntegerExamples() (gas: 34597) +LibDecimalFloatIntegerTest:testIntegerInRange(int224,int256) (runs: 5096, μ: 3574, ~: 3644) +LibDecimalFloatIntegerTest:testIntegerLessThanMin(int224,int256) (runs: 5096, μ: 2927, ~: 2969) +LibDecimalFloatIntegerTest:testIntegerNonNegative(int224,int256) (runs: 5096, μ: 2585, ~: 2723) +LibDecimalFloatIntegerTest:testIntegerNotReverts(bytes32) (runs: 5096, μ: 708, ~: 709) +LibDecimalFloatInvTest:testInvMem(bytes32) (runs: 5096, μ: 8155, ~: 8238) +LibDecimalFloatInvTest:testInvRevertsOnExponentUnderflow() (gas: 7103) LibDecimalFloatIsZeroTest:testIsZeroDeployed(bytes32) (runs: 5096, μ: 1063, ~: 1063) LibDecimalFloatIsZeroTest:testIsZeroEqZero(bytes32) (runs: 5096, μ: 684, ~: 684) LibDecimalFloatIsZeroTest:testIsZeroExamples(int32) (runs: 5096, μ: 977, ~: 977) LibDecimalFloatIsZeroTest:testNotIsZero(int224,int32) (runs: 5096, μ: 3592, ~: 3592) -LibDecimalFloatLog10Test:testLog10Packed(bytes32) (runs: 5096, μ: 1707320, ~: 1245624) +LibDecimalFloatLog10Test:testLog10Packed(bytes32) (runs: 5096, μ: 2669231, ~: 1960205) LibDecimalFloatLtTest:testLtExamples() (gas: 1161) LibDecimalFloatLtTest:testLtGasAZero() (gas: 953) LibDecimalFloatLtTest:testLtGasBZero() (gas: 1019) LibDecimalFloatLtTest:testLtGasBothZero() (gas: 944) LibDecimalFloatLtTest:testLtGasDifferentSigns() (gas: 1008) LibDecimalFloatLtTest:testLtGasExponentDiffOverflow() (gas: 1091) -LibDecimalFloatLtTest:testLtNegativeVsPositive(int256,int32,int256,int32) (runs: 5096, μ: 4286, ~: 4298) -LibDecimalFloatLtTest:testLtNegativeVsZero(int256,int32,int32) (runs: 5096, μ: 3023, ~: 3302) +LibDecimalFloatLtTest:testLtNegativeVsPositive(int256,int32,int256,int32) (runs: 5096, μ: 4295, ~: 4298) +LibDecimalFloatLtTest:testLtNegativeVsZero(int256,int32,int32) (runs: 5096, μ: 3026, ~: 3302) LibDecimalFloatLtTest:testLtOneEAny(int224,int32) (runs: 5096, μ: 1089, ~: 1090) -LibDecimalFloatLtTest:testLtReference(bytes32,bytes32) (runs: 5096, μ: 2460, ~: 2250) -LibDecimalFloatLtTest:testLtVsEqualVsGt(bytes32,bytes32) (runs: 5096, μ: 1511, ~: 1361) +LibDecimalFloatLtTest:testLtReference(bytes32,bytes32) (runs: 5096, μ: 2491, ~: 2250) +LibDecimalFloatLtTest:testLtVsEqualVsGt(bytes32,bytes32) (runs: 5096, μ: 1522, ~: 1361) LibDecimalFloatLtTest:testLtX(int224) (runs: 5096, μ: 981, ~: 982) -LibDecimalFloatLtTest:testLtXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3200, ~: 3442) -LibDecimalFloatLtTest:testLtXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3416, ~: 3671) +LibDecimalFloatLtTest:testLtXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3196, ~: 3442) +LibDecimalFloatLtTest:testLtXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3417, ~: 3671) LibDecimalFloatLtTest:testLtZero(int32,int32) (runs: 5096, μ: 1311, ~: 1311) LibDecimalFloatLteTest:testLteGasAZero() (gas: 1002) LibDecimalFloatLteTest:testLteGasBZero() (gas: 1004) @@ -277,81 +319,126 @@ LibDecimalFloatLteTest:testLteGasBothZero() (gas: 738) LibDecimalFloatLteTest:testLteGasDifferentSigns() (gas: 1013) LibDecimalFloatLteTest:testLteGasExponentDiffOverflow() (gas: 1118) LibDecimalFloatLteTest:testLteOneEAny(bytes32) (runs: 5096, μ: 657, ~: 657) -LibDecimalFloatLteTest:testLteReference(int224,int32,int224,int32) (runs: 5096, μ: 8096, ~: 9187) +LibDecimalFloatLteTest:testLteReference(int224,int32,int224,int32) (runs: 5096, μ: 8020, ~: 8987) LibDecimalFloatLteTest:testLteX(int224,int32) (runs: 5096, μ: 1088, ~: 1089) -LibDecimalFloatLteTest:testLteXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3211, ~: 3454) -LibDecimalFloatLteTest:testLteXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3428, ~: 3683) -LibDecimalFloatLteTest:testLteXNotLtY(bytes32,bytes32) (runs: 5096, μ: 1063, ~: 962) -LibDecimalFloatLteTest:testLteXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 3935, ~: 3936) -LibDecimalFloatLteTest:testLteXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2503, ~: 2776) +LibDecimalFloatLteTest:testLteXEAnyVsXEAny(int256,int32,int32) (runs: 5096, μ: 3208, ~: 3454) +LibDecimalFloatLteTest:testLteXEAnyVsXEAnyNegative(int256,int32,int32) (runs: 5096, μ: 3430, ~: 3683) +LibDecimalFloatLteTest:testLteXNotLtY(bytes32,bytes32) (runs: 5096, μ: 1069, ~: 962) +LibDecimalFloatLteTest:testLteXPositiveYNegative(int256,int32,int256,int32) (runs: 5096, μ: 3926, ~: 3936) +LibDecimalFloatLteTest:testLteXPositiveYZero(int256,int32,int32) (runs: 5096, μ: 2500, ~: 2776) LibDecimalFloatLteTest:testLteZero(int32,int32) (runs: 5096, μ: 1632, ~: 1632) LibDecimalFloatMaxTest:testMaxX(bytes32) (runs: 5096, μ: 1105, ~: 1105) -LibDecimalFloatMaxTest:testMaxXY(bytes32,bytes32) (runs: 5096, μ: 1569, ~: 1468) +LibDecimalFloatMaxTest:testMaxXY(bytes32,bytes32) (runs: 5096, μ: 1575, ~: 1468) LibDecimalFloatMaxTest:testMaxXYEqual(bytes32) (runs: 5096, μ: 1511, ~: 1511) -LibDecimalFloatMaxTest:testMaxXYGreater(bytes32,bytes32) (runs: 5096, μ: 4897, ~: 4752) -LibDecimalFloatMaxTest:testMaxXYLess(bytes32,bytes32) (runs: 5096, μ: 4920, ~: 4763) +LibDecimalFloatMaxTest:testMaxXYGreater(bytes32,bytes32) (runs: 5096, μ: 4909, ~: 4752) +LibDecimalFloatMaxTest:testMaxXYLess(bytes32,bytes32) (runs: 5096, μ: 4923, ~: 4763) LibDecimalFloatMinTest:testMinX(bytes32) (runs: 5096, μ: 1127, ~: 1127) -LibDecimalFloatMinTest:testMinXY(bytes32,bytes32) (runs: 5096, μ: 1569, ~: 1468) +LibDecimalFloatMinTest:testMinXY(bytes32,bytes32) (runs: 5096, μ: 1575, ~: 1468) LibDecimalFloatMinTest:testMinXYEqual(bytes32) (runs: 5096, μ: 1531, ~: 1531) -LibDecimalFloatMinTest:testMinXYGreater(bytes32,bytes32) (runs: 5096, μ: 4845, ~: 4697) -LibDecimalFloatMinTest:testMinXYLess(bytes32,bytes32) (runs: 5096, μ: 4869, ~: 4708) -LibDecimalFloatMinusTest:testMinusPacked(bytes32) (runs: 5096, μ: 2412, ~: 2414) -LibDecimalFloatMixedTest:testDiv1Over3Mixed() (gas: 7248) -LibDecimalFloatMulTest:testMulPacked(bytes32,bytes32) (runs: 5096, μ: 6961, ~: 7446) -LibDecimalFloatPackTest:testPackExponentOverflow(int256,int256) (runs: 5096, μ: 6348, ~: 6519) -LibDecimalFloatPackTest:testPackNegativeExponentLossyZero(int256,int256) (runs: 5096, μ: 6089, ~: 6225) -LibDecimalFloatPackTest:testPackZero(int256) (runs: 5096, μ: 654, ~: 654) -LibDecimalFloatPackTest:testPartsRoundTrip(int224,int32) (runs: 5096, μ: 1021, ~: 1022) -LibDecimalFloatPow10Test:testPow10Packed(bytes32) (runs: 5096, μ: 1782449, ~: 1232413) -LibDecimalFloatPowTest:testNegativePowError(bytes32,bytes32) (runs: 5096, μ: 1216587, ~: 1216716) -LibDecimalFloatPowTest:testPowAZero(int32,bytes32) (runs: 5096, μ: 1215330, ~: 1215330) -LibDecimalFloatPowTest:testPowAZeroNegative(bytes32) (runs: 5096, μ: 1216203, ~: 1216203) -LibDecimalFloatPowTest:testPowBOne(bytes32) (runs: 5096, μ: 1423290, ~: 1423256) -LibDecimalFloatPowTest:testPowBZero(bytes32,int32) (runs: 5096, μ: 1212400, ~: 1212400) -LibDecimalFloatPowTest:testPows() (gas: 1650149) -LibDecimalFloatPowTest:testRoundTripFuzzPow(bytes32,bytes32) (runs: 5096, μ: 1239620, ~: 1213191) -LibDecimalFloatPowTest:testRoundTripSimple() (gas: 1840912) -LibDecimalFloatSqrtTest:testRoundTripFuzzSqrt(int224,int32) (runs: 5096, μ: 1272704, ~: 1278751) -LibDecimalFloatSqrtTest:testSqrt() (gas: 1270606) -LibDecimalFloatSqrtTest:testSqrtNegative(bytes32) (runs: 5096, μ: 1216295, ~: 1216428) -LibDecimalFloatSqrtTest:testSqrtRoundTrip() (gas: 1487129) -LibDecimalFloatSubTest:testSubPacked(bytes32,bytes32) (runs: 5096, μ: 8954, ~: 9343) -LibFormatDecimalFloatCountSigFigs:testCountSigFigsExamples() (gas: 47425) -LibFormatDecimalFloatCountSigFigs:testCountSigFigsOne(int256) (runs: 5096, μ: 22660, ~: 22580) -LibFormatDecimalFloatCountSigFigs:testCountSigFigsZero(int256) (runs: 5096, μ: 520, ~: 520) -LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalExamples() (gas: 709867) -LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripExamples() (gas: 675881) -LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripNegative(int256,bool) (runs: 5096, μ: 55629, ~: 52164) -LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripNonNegative(uint256,bool) (runs: 5096, μ: 41911, ~: 44041) -LibLogTableBytesTest:testToBytesAntiLogTableDec() (gas: 153244) -LibLogTableBytesTest:testToBytesAntiLogTableDecSmall() (gas: 158078) -LibLogTableBytesTest:testToBytesLogTableDec() (gas: 137440) -LibLogTableBytesTest:testToBytesLogTableDecSmall() (gas: 141832) -LibLogTableBytesTest:testToBytesLogTableDecSmallAlt() (gas: 18046) -LibParseDecimalFloatTest:testParseDecimalFloatEmpty() (gas: 979) +LibDecimalFloatMinTest:testMinXYGreater(bytes32,bytes32) (runs: 5096, μ: 4858, ~: 4697) +LibDecimalFloatMinTest:testMinXYLess(bytes32,bytes32) (runs: 5096, μ: 4871, ~: 4708) +LibDecimalFloatMinusTest:testMinusPacked(bytes32) (runs: 5096, μ: 2559, ~: 2561) +LibDecimalFloatMinusTest:testNegationReversesOrder(bytes32,bytes32) (runs: 5096, μ: 5240, ~: 5081) +LibDecimalFloatMixedTest:testDiv1Over3Mixed() (gas: 7476) +LibDecimalFloatMulTest:testMulPacked(bytes32,bytes32) (runs: 5096, μ: 7450, ~: 7661) +LibDecimalFloatMulTest:testMulRevertsOnExponentUnderflow() (gas: 5941) +LibDecimalFloatPackArithmeticResultTest:testPackArithmeticResultExponentOverflowReverts() (gas: 4452) +LibDecimalFloatPackArithmeticResultTest:testPackArithmeticResultExponentUnderflowReverts() (gas: 4586) +LibDecimalFloatPackArithmeticResultTest:testPackArithmeticResultLossless(int224,int32) (runs: 5096, μ: 3687, ~: 3687) +LibDecimalFloatPackArithmeticResultTest:testPackArithmeticResultToleratesCoefficientTruncation() (gas: 1096) +LibDecimalFloatPackArithmeticResultTest:testPackArithmeticResultZeroCoefficient(int256) (runs: 5096, μ: 600, ~: 600) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyInt224MaxAtFloor() (gas: 818) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyInt224MaxExactUnderflow() (gas: 790) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyInt224MinAtFloor() (gas: 774) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyInt224MinUnderflow() (gas: 788) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyInt256MaxExponentWrapIsUnderflowSentinel() (gas: 1770) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyLargeCoefficientShortcut() (gas: 14995) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyNoCollisionAtBoundaries(int224,int32,int224,int32) (runs: 5096, μ: 4970, ~: 4970) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyOracleFullCoefficient(int256,int256) (runs: 5096, μ: 3277, ~: 3149) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyOracleNearInt224Boundary(int256,int256) (runs: 5096, μ: 6672, ~: 6865) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyUnitCoefficientCeilBoundary() (gas: 5167) +LibDecimalFloatPackLossyUnderflowTest:testPackLossyUnitCoefficientFloorBoundary() (gas: 1372) +LibDecimalFloatPackTest:testPackExponentOverflow(int256,int256) (runs: 5096, μ: 6352, ~: 6522) +LibDecimalFloatPackTest:testPackLosslessCoefficientOverflow() (gas: 4614) +LibDecimalFloatPackTest:testPackLosslessZeroExponentIdentity(uint256) (runs: 5096, μ: 964, ~: 887) +LibDecimalFloatPackTest:testPackLossyButPackable() (gas: 2106) +LibDecimalFloatPackTest:testPackNegativeExponentLossyNonZeroWindow() (gas: 1367) +LibDecimalFloatPackTest:testPackNegativeExponentLossyZero(int256,int256) (runs: 5096, μ: 3909, ~: 4432) +LibDecimalFloatPackTest:testPackNegativeExponentLossyZeroWindow() (gas: 999) +LibDecimalFloatPackTest:testPackZero(int256) (runs: 5096, μ: 698, ~: 698) +LibDecimalFloatPackTest:testPartsRoundTrip(int224,int32) (runs: 5096, μ: 1066, ~: 1067) +LibDecimalFloatPow10Test:testPow10Packed(bytes32) (runs: 5096, μ: 2793249, ~: 1947311) +LibDecimalFloatPow10Test:testPow10RevertsOnExponentUnderflow() (gas: 1934960) +LibDecimalFloatPowTest:testNegativePowError(bytes32,bytes32) (runs: 5096, μ: 1931426, ~: 1931595) +LibDecimalFloatPowTest:testPowAZero(int32,bytes32) (runs: 5096, μ: 1930052, ~: 1930052) +LibDecimalFloatPowTest:testPowAZeroNegative(bytes32) (runs: 5096, μ: 1930903, ~: 1930903) +LibDecimalFloatPowTest:testPowBOne(bytes32) (runs: 5096, μ: 2163363, ~: 2163331) +LibDecimalFloatPowTest:testPowBZero(bytes32,int32) (runs: 5096, μ: 1927167, ~: 1927167) +LibDecimalFloatPowTest:testPowIntegerExponentSquaringOverflow() (gas: 2138703) +LibDecimalFloatPowTest:testPows() (gas: 2370202) +LibDecimalFloatPowTest:testRoundTripFuzzPow(bytes32,bytes32) (runs: 5096, μ: 1947384, ~: 1928300) +LibDecimalFloatPowTest:testRoundTripSecondLegRevert() (gas: 1950279) +LibDecimalFloatPowTest:testRoundTripSimple() (gas: 2562846) +LibDecimalFloatSqrtTest:testRoundTripFuzzSqrt(int224,int32) (runs: 5096, μ: 1986793, ~: 1993693) +LibDecimalFloatSqrtTest:testSqrt() (gas: 1987627) +LibDecimalFloatSqrtTest:testSqrtNegative(bytes32) (runs: 5096, μ: 1931288, ~: 1931454) +LibDecimalFloatSqrtTest:testSqrtRoundTrip() (gas: 2206569) +LibDecimalFloatSubTest:testSubPacked(bytes32,bytes32) (runs: 5096, μ: 9128, ~: 9453) +LibFormatDecimalFloatToDecimalStringTest:testFormatCanonicalAcrossRepresentations(int128,uint8,bool) (runs: 5096, μ: 61866, ~: 61883) +LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalExamples() (gas: 685716) +LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalFloatConstants() (gas: 20667) +LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripExamples() (gas: 685890) +LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripNegative(int256,bool) (runs: 5096, μ: 63749, ~: 67546) +LibFormatDecimalFloatToDecimalStringTest:testFormatDecimalRoundTripNonNegative(uint256,bool) (runs: 5096, μ: 45017, ~: 50378) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificAtIntDigitBoundary() (gas: 44263) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificDecimalAtStart() (gas: 12452) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificDecimalInside() (gas: 13076) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificEffExpZero() (gas: 12949) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificExponentAboveCapReverts() (gas: 6794) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificExponentAtNegativeCap() (gas: 194192) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificExponentAtPositiveCapReverts() (gas: 6835) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificExponentBelowCapReverts() (gas: 6924) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificInt224MaxCoefficient() (gas: 26327) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificInt224MinCoefficient() (gas: 26686) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificIssue182Reproduction() (gas: 37764) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificLargeCoefficientLargeExponent() (gas: 7950) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificLargePositiveExponent() (gas: 6783) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificLeadingZeros() (gas: 12440) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificOutputShape(int224,int32) (runs: 5096, μ: 120329, ~: 94647) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificRevertsOnLongPositiveExp() (gas: 6817) +LibFormatDecimalFloatToDecimalStringTest:testFormatNonScientificSucceedsForNonPositiveExponents(int224,int32) (runs: 5096, μ: 85668, ~: 72110) +LibFormatDecimalFloatToDecimalStringTest:testFormatParseRoundTripNonScientificNegExpFullDomain(int224,int32) (runs: 5096, μ: 251081, ~: 212761) +LibFormatDecimalFloatToDecimalStringTest:testFormatParseRoundTripNonScientificSafePosExp(int224,int32) (runs: 100, μ: 28046, ~: 27804) +LibFormatDecimalFloatToDecimalStringTest:testFormatParseRoundTripScientificFullDomain(int224,int32) (runs: 5096, μ: 50336, ~: 52639) +LibFormatDecimalFloatToDecimalStringTest:testFormatScientificNegativeBoundaryDoesNotRevert() (gas: 13107) +LibFormatDecimalFloatToDecimalStringTest:testFormatScientificRevertsNearPositiveInt32Limit() (gas: 16666) +LibParseDecimalFloatTest:testParseDecimalFloatEmpty() (gas: 957) +LibParseDecimalFloatTest:testParseDecimalFloatExcessCharacters() (gas: 10876) +LibParseDecimalFloatTest:testParseDecimalFloatExponentOverflowFromPackLossy() (gas: 17348) LibParseDecimalFloatTest:testParseDecimalFloatExponentRevert() (gas: 973) LibParseDecimalFloatTest:testParseDecimalFloatExponentRevert2() (gas: 2148) LibParseDecimalFloatTest:testParseDecimalFloatExponentRevert3() (gas: 2254) LibParseDecimalFloatTest:testParseDecimalFloatExponentRevert4() (gas: 951) LibParseDecimalFloatTest:testParseDecimalFloatNonDecimal() (gas: 949) -LibParseDecimalFloatTest:testParseFormatterRoundTripBug0() (gas: 23152) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatDecimals() (gas: 326489) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotE() (gas: 970) +LibParseDecimalFloatTest:testParseDecimalFloatPrecisionLossFromPackLossy() (gas: 22108) +LibParseDecimalFloatTest:testParseExponentOverflowFracPlusEValue() (gas: 50877) +LibParseDecimalFloatTest:testParseFormatterRoundTripBug0() (gas: 23213) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatDecimals() (gas: 326526) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotE() (gas: 992) LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotE0() (gas: 971) LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert() (gas: 949) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert2() (gas: 971) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert2() (gas: 948) LibParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert3() (gas: 1955) LibParseDecimalFloatTest:testParseLiteralDecimalFloatEDot() (gas: 972) LibParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert5() (gas: 980) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert6() (gas: 970) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatExponents() (gas: 321070) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatFuzz(uint256,uint8,bool) (runs: 5096, μ: 33866, ~: 27228) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatLeadingZeros() (gas: 47427) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert6() (gas: 948) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatExponents() (gas: 326979) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatFuzz(uint256,uint8,bool) (runs: 5096, μ: 34644, ~: 27831) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatLeadingZeros() (gas: 47479) LibParseDecimalFloatTest:testParseLiteralDecimalFloatNegativeE() (gas: 2799) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatNegativeFrac() (gas: 1930) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatNegativeFrac() (gas: 1975) LibParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert0() (gas: 24401) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert1() (gas: 21607) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatSpecific() (gas: 12389) -LibParseDecimalFloatTest:testParseLiteralDecimalFloatUnrelated() (gas: 35350) -LibParseDecimalFloatTest:testParsePacked(string) (runs: 5096, μ: 6170, ~: 5242) -TestDecimalFloatUnpackTest:testUnpackDeployed(bytes32) (runs: 5096, μ: 163108, ~: 163108) \ No newline at end of file +LibParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert1() (gas: 21650) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatSpecific() (gas: 12417) +LibParseDecimalFloatTest:testParseLiteralDecimalFloatUnrelated() (gas: 35973) +LibParseDecimalFloatTest:testParsePacked(string) (runs: 5096, μ: 6127, ~: 5265) \ No newline at end of file diff --git a/.github/workflows/copy-artifacts.yaml b/.github/workflows/copy-artifacts.yaml deleted file mode 100644 index 7d0431f5..00000000 --- a/.github/workflows/copy-artifacts.yaml +++ /dev/null @@ -1,9 +0,0 @@ -name: copy-artifacts -on: [push] -jobs: - copy-artifacts: - # Shared reusable (rainix#201): build from committed sources and assert the - # committed abi artifacts are still current. Includes Cachix substitution + - # 8G GC cap. secrets: inherit carries CACHIX_AUTH_TOKEN. - uses: rainlanguage/rainix/.github/workflows/rainix-copy-artifacts.yaml@main - secrets: inherit diff --git a/.github/workflows/manual-sol-artifacts.yaml b/.github/workflows/manual-sol-artifacts.yaml deleted file mode 100644 index 1a049d9c..00000000 --- a/.github/workflows/manual-sol-artifacts.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Manual sol artifacts -on: - workflow_dispatch: - inputs: - suite: - description: "The suite to deploy" - required: true - type: choice - options: - - log-tables - - decimal-float -jobs: - deploy: - uses: rainlanguage/rainix/.github/workflows/rainix-manual-sol-artifacts.yaml@main - with: - suite: ${{ inputs.suite }} - secrets: inherit diff --git a/.github/workflows/package-release.yaml b/.github/workflows/package-release.yaml index d09df3f8..0b3d3278 100644 --- a/.github/workflows/package-release.yaml +++ b/.github/workflows/package-release.yaml @@ -7,7 +7,5 @@ jobs: release: uses: rainlanguage/rainix/.github/workflows/rainix-autopublish.yaml@main with: - crate: rain-math-float - npm-package: "@rainlanguage/float" soldeer-package: rain-math-float secrets: inherit diff --git a/.github/workflows/rainix-rs-static.yaml b/.github/workflows/rainix-rs-static.yaml deleted file mode 100644 index 4ad44f55..00000000 --- a/.github/workflows/rainix-rs-static.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: rainix-rs-static -on: [push] -jobs: - rs-static: - uses: rainlanguage/rainix/.github/workflows/rainix-rs-static.yaml@main diff --git a/.github/workflows/rainix-rs-test.yaml b/.github/workflows/rainix-rs-test.yaml deleted file mode 100644 index ce9b0417..00000000 --- a/.github/workflows/rainix-rs-test.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: rainix-rs-test -on: [push] -jobs: - rs-test: - uses: rainlanguage/rainix/.github/workflows/rainix-rs-test.yaml@main diff --git a/.github/workflows/rainix-rs-wasm.yaml b/.github/workflows/rainix-rs-wasm.yaml deleted file mode 100644 index 587b08d3..00000000 --- a/.github/workflows/rainix-rs-wasm.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: rainix-rs-wasm -on: [push] -jobs: - rs-wasm: - uses: rainlanguage/rainix/.github/workflows/rainix-rs-wasm.yaml@main diff --git a/.gitignore b/.gitignore index c010ae91..5b81aff1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,7 @@ out cache dependencies .direnv -target temp -dist -node_modules .env .fixes .pre-commit-config.yaml diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 84db7450..00000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -crates/float/abi/ diff --git a/.soldeerignore b/.soldeerignore index a52b4914..fc92760c 100644 --- a/.soldeerignore +++ b/.soldeerignore @@ -7,31 +7,21 @@ .gitignore .gitmodules .pre-commit-config.yaml -.prettierignore .soldeerignore .vscode CLAUDE.md /audit /cache -/crates /dependencies -/dist -/docs /flake.lock /flake.nix /foundry.lock /foundry.toml /lib -/node_modules /out -/package.json -/package-lock.json /remappings.txt -/scripts /slither.config.json /soldeer.lock /target /test -/test_js -/tsconfig.json /REUSE.toml diff --git a/CLAUDE.md b/CLAUDE.md index 45eb5ba9..d4ef26b6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,88 +5,30 @@ code in this repository. ## Project Overview -Decimal floating-point math library for Rainlang/DeFi. The `Float` type packs a -224-bit signed coefficient and 32-bit signed exponent into a single `bytes32`. -Decimal (not binary) representation ensures exact decimal values (e.g., `0.1`). -No NaN, Infinity, or negative zero — operations error on nonsense rather than -producing special values. +Pure Solidity decimal floating-point math library for Rainlang/DeFi. The `Float` +type packs a 224-bit signed coefficient and 32-bit signed exponent into a single +`bytes32`. Decimal (not binary) representation ensures exact decimal values +(e.g., `0.1`). No NaN, Infinity, or negative zero — operations error on nonsense +rather than producing special values. -Dual implementation: Solidity for on-chain, Rust/WASM for off-chain JS/TS -consumption. The Rust crate uses revm to execute Solidity via an in-memory EVM, -ensuring identical behavior. +This repository is the library half of the rain.math.float split. It publishes +only the `rain-math-float` Soldeer package. The deployed concrete contract, the +on-chain deploy pins/snapshot, the deploy scripts/tests, and the Rust/WASM/npm +bindings live in `rain.math.float.deploy` and publish from there. ## Build Commands -### Solidity (Foundry) - ```bash forge build # Compile contracts forge test # Run all Solidity tests (5096 fuzz runs) forge test --mt testFunctionName # Run specific test by name forge test -vvvv # Verbose trace output for debugging +nix develop # Enter dev shell with all tooling ``` -### Rust - -```bash -cargo build # Build native -cargo build --target wasm32-unknown-unknown --lib -r # Build WASM -cargo test # Run Rust tests -cargo test test_name # Run specific test -``` - -Rust tests depend on Foundry build artifacts (`out/`). Run `forge build` before -`cargo test` if artifacts are missing. - -### JavaScript/WASM - -```bash -npm install -npm run build # Full pipeline: Rust WASM → wasm-bindgen → base64 embed → CJS/ESM dist -npm test # TypeScript type check + vitest (tests in test_js/) -``` - -### Nix - -```bash -nix develop # Enter dev shell with all tooling -``` - -### Deployment - -Contracts are deployed deterministically via the Zoltu proxy to the same address -on all supported networks (Arbitrum, Base, Base Sepolia, Flare, Polygon). The -deterministic address is a function of bytecode + salt only — not the branch or -deployer — so a successful deploy from any branch lands at the same address a -main-branch deploy would. - -**Typical flow for a source-changing PR**: trigger the `Manual sol artifacts` -GitHub workflow on the PR's branch before merge. -`gh workflow run manual-sol-artifacts.yaml --ref -f suite=decimal-float` -(use `log-tables` only when table bytecode changes, which is rare). The workflow -runs `script/Deploy.sol` with `--broadcast --verify` across all networks, using -`PRIVATE_KEY` regardless of ref. Do NOT wait for merge before deploying — there -is nothing to gain from waiting, and the CI deploy-constant tests need updating -anyway based on the deployed address. - -**Two deployment suites** (log-tables must be deployed first if redeploying -tables): - -```bash -DEPLOYMENT_KEY= DEPLOYMENT_SUITE=log-tables forge script script/Deploy.sol:Deploy --broadcast --verify -DEPLOYMENT_KEY= DEPLOYMENT_SUITE=decimal-float forge script script/Deploy.sol:Deploy --broadcast --verify -``` - -Expected addresses and code hashes are in -`src/lib/deploy/LibDecimalFloatDeploy.sol`. Any source change to -`LibDecimalFloat` or `LibFormatDecimalFloat` invalidates these constants; CI's -`testDeployAddress` and `testExpectedCodeHashDecimalFloat` will fail until -they're regenerated and committed. Network RPC URLs are configured in -`foundry.toml` via `CI_DEPLOY_*_RPC_URL` env vars. - ## Architecture -### Solidity Layer (`src/`) +### Source (`src/`) - **`lib/LibDecimalFloat.sol`** — Public API: arithmetic, comparison, conversion, formatting, parsing. User-defined type `Float` wrapping `bytes32`. @@ -94,44 +36,26 @@ they're regenerated and committed. Network RPC URLs are configured in mul/div), normalization, packing. - **`lib/parse/`** — String-to-Float parsing. - **`lib/format/`** — Float-to-string formatting. -- **`lib/table/`** — Log lookup tables (deployed as a data contract at a - deterministic address). -- **`concrete/DecimalFloat.sol`** — Exposes library functions as contract - methods (required for Rust/revm interop via ABI). +- **`lib/table/`** — Log lookup table source (`LibLogTable`); the transcendental + functions take the deployed tables-contract address as a parameter. - **`error/`** — Custom error definitions (CoefficientOverflow, ExponentOverflow, DivisionByZero, etc.). -### Scripts (`script/`) - -- **`Deploy.sol`** — Production deployment script using Zoltu deterministic - proxy. Deploys log tables and DecimalFloat contract to all supported networks. -- **`BuildPointers.sol`** — Generates `src/generated/LogTables.pointers.sol` - (committed to repo; must be regenerated if log table data changes). - -### Rust Layer (`crates/float/`) - -- **`lib.rs`** — `Float` struct wrapping `B256`, implements - `Add`/`Sub`/`Mul`/`Div`/`Neg`. Uses `alloy::sol!` macro to generate bindings - from Foundry JSON artifacts in `out/`. -- **`js_api.rs`** — `#[wasm_bindgen]` exports for JS consumption (parse, format, - arithmetic, conversions). -- **`evm.rs`** — In-memory EVM setup via revm. All Rust float operations - delegate to Solidity through this. -- **`error.rs`** — Maps Solidity error selectors to Rust error types. - -### JavaScript Layer +### Tests (`test/`) -- **`scripts/build.js`** — Build pipeline: compiles WASM, runs wasm-bindgen, - base64-encodes WASM into JS modules for both CJS and ESM. -- **`test_js/`** — Vitest tests for the WASM bindings. -- **`dist/`** — Generated output (CJS + ESM with embedded WASM). +- **`src/lib/`** — The pure-math suite mirroring `src/lib/`. +- **`abstract/LogTest.sol`** — Test helper that rebuilds the combined log tables + from `LibLogTable` source and deploys them as a data contract at a `create` + address, so the transcendental tests (`log10`/`pow`/`pow10`/`sqrt`) run + without any on-chain deploy pin. +- **`lib/`** — Reference (slow) implementations used to cross-check the library. ### Dependencies (`dependencies/`) Managed by [Soldeer](https://soldeer.xyz) (`[dependencies]` in `foundry.toml`, `libs = ['dependencies']`), not git submodules: forge-std, -`@openzeppelin-contracts`, rain-solmem, rain-string, rain-datacontract, -rain-deploy, rain-sol-codegen. Run `forge soldeer install` to fetch them. +`@openzeppelin-contracts`, rain-solmem, rain-string, rain-datacontract. Run +`forge soldeer install` to fetch them. ## Key Design Details @@ -140,8 +64,7 @@ rain-deploy, rain-sol-codegen. Run `forge soldeer install` to fetch them. (`ExponentOverflow` / `ExponentUnderflow`). Coefficient truncation on values too large for int224 is silently tolerated because it preserves the order of magnitude. -- Log/power use lookup table approximations with linear interpolation (table - deployed as a data contract). +- Log/power use lookup table approximations with linear interpolation. - Three packing modes: - `packLossless`: reverts on any precision loss. - `packLossy`: surfaces the `lossless` flag, returns `FLOAT_ZERO` on exponent diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 5d6132e5..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,3525 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "alloy" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50ab0cd8afe573d1f7dc2353698a51b1f93aec362c8211e28cfd3948c6adba39" -dependencies = [ - "alloy-consensus", - "alloy-core", - "alloy-eips", - "alloy-rpc-types", - "alloy-serde", - "alloy-trie", -] - -[[package]] -name = "alloy-consensus" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f16daaf7e1f95f62c6c3bf8a3fc3d78b08ae9777810c0bb5e94966c7cd57ef0" -dependencies = [ - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "alloy-trie", - "alloy-tx-macros", - "arbitrary", - "auto_impl", - "borsh", - "c-kzg", - "derive_more", - "either", - "k256", - "once_cell", - "rand 0.8.5", - "secp256k1 0.30.0", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "alloy-consensus-any" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "118998d9015332ab1b4720ae1f1e3009491966a0349938a1f43ff45a8a4c6299" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "arbitrary", - "serde", -] - -[[package]] -name = "alloy-core" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ddde5968de6044d67af107ad835bc0069a7ca245870b94c5958a7d8712b184" -dependencies = [ - "alloy-dyn-abi", - "alloy-json-abi", - "alloy-primitives", - "alloy-rlp", - "alloy-sol-types", -] - -[[package]] -name = "alloy-dyn-abi" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a475bb02d9cef2dbb99065c1664ab3fe1f9352e21d6d5ed3f02cdbfc06ed1abc" -dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-type-parser", - "alloy-sol-types", - "arbitrary", - "itoa", - "proptest", - "serde", - "serde_json", - "winnow 1.0.3", -] - -[[package]] -name = "alloy-eip2124" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "741bdd7499908b3aa0b159bba11e71c8cddd009a2c2eb7a06e825f1ec87900a5" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "arbitrary", - "crc", - "rand 0.8.5", - "serde", - "thiserror", -] - -[[package]] -name = "alloy-eip2930" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9441120fa82df73e8959ae0e4ab8ade03de2aaae61be313fbf5746277847ce25" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "arbitrary", - "borsh", - "rand 0.8.5", - "serde", -] - -[[package]] -name = "alloy-eip7702" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2919c5a56a1007492da313e7a3b6d45ef5edc5d33416fdec63c0d7a2702a0d20" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "arbitrary", - "borsh", - "k256", - "rand 0.8.5", - "serde", - "thiserror", -] - -[[package]] -name = "alloy-eip7928" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b827a6d7784fe3eb3489d40699407a4cdcce74271421a01bdffe60cf573bb16" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "arbitrary", - "borsh", - "once_cell", - "serde", - "thiserror", -] - -[[package]] -name = "alloy-eips" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ef28c9fdad22d4eec52d894f5f2673a0895f1e5ef196734568e68c0f6caca8" -dependencies = [ - "alloy-eip2124", - "alloy-eip2930", - "alloy-eip7702", - "alloy-eip7928", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "arbitrary", - "auto_impl", - "borsh", - "c-kzg", - "derive_more", - "either", - "serde", - "serde_with", - "sha2", -] - -[[package]] -name = "alloy-json-abi" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c36c9d7f9021601b04bfef14a4b64849f6d73116a4e91e071d7fbfe10247901" -dependencies = [ - "alloy-primitives", - "alloy-sol-type-parser", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-network-primitives" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb82711d59a43fdfd79727c99f270b974c784ec4eb5728a0d0d22f26716c87ef" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-serde", - "serde", -] - -[[package]] -name = "alloy-primitives" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4885c1409b6936c4898e646ef58baf6ec54edaf6d8179f79df805a7b85b7cf3e" -dependencies = [ - "alloy-rlp", - "arbitrary", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "foldhash", - "hashbrown 0.17.1", - "indexmap 2.9.0", - "itoa", - "k256", - "keccak-asm", - "paste", - "proptest", - "proptest-derive 0.8.0", - "rand 0.9.1", - "rapidhash", - "ruint", - "rustc-hash", - "secp256k1 0.31.1", - "serde", - "sha3", -] - -[[package]] -name = "alloy-rlp" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" -dependencies = [ - "alloy-rlp-derive", - "arrayvec", - "bytes", -] - -[[package]] -name = "alloy-rlp-derive" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "alloy-rpc-types" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faad925d3a669ffc15f43b3deec7fbdf2adeb28a4d6f9cf4bc661698c0f8f4b" -dependencies = [ - "alloy-primitives", - "alloy-rpc-types-engine", - "alloy-rpc-types-eth", - "alloy-serde", - "serde", -] - -[[package]] -name = "alloy-rpc-types-engine" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9b97b6e7965679ad22df297dda809b11cebc13405c1b537e5cffecc95834fa" -dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "arbitrary", - "derive_more", - "rand 0.8.5", - "serde", - "strum", -] - -[[package]] -name = "alloy-rpc-types-eth" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c095f92c4e1ff4981d89e9aa02d5f98c762a1980ab66bec49c44be11349da2" -dependencies = [ - "alloy-consensus", - "alloy-consensus-any", - "alloy-eips", - "alloy-network-primitives", - "alloy-primitives", - "alloy-rlp", - "alloy-serde", - "alloy-sol-types", - "arbitrary", - "itertools 0.14.0", - "serde", - "serde_json", - "serde_with", - "thiserror", -] - -[[package]] -name = "alloy-serde" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ece63b89294b8614ab3f483560c08d016930f842bf36da56bf0b764a15c11e" -dependencies = [ - "alloy-primitives", - "arbitrary", - "serde", - "serde_json", -] - -[[package]] -name = "alloy-sol-macro" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "840128ed2b2971d6d4668a553fe403a82683d3acc646c73e75887e7157408033" -dependencies = [ - "alloy-sol-macro-expander", - "alloy-sol-macro-input", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "alloy-sol-macro-expander" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ec265e5d65d725175f6ca7711c970824c90ef9c0d1f1973711d4150ee612dd" -dependencies = [ - "alloy-json-abi", - "alloy-sol-macro-input", - "const-hex", - "heck", - "indexmap 2.9.0", - "proc-macro-error2", - "proc-macro2", - "quote", - "sha3", - "syn 2.0.117", - "syn-solidity", -] - -[[package]] -name = "alloy-sol-macro-input" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89bf01077f18650876cfa682eb1f949967b5cde03f1a51c955c469d2c9b4aa67" -dependencies = [ - "alloy-json-abi", - "const-hex", - "dunce", - "heck", - "macro-string", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.117", - "syn-solidity", -] - -[[package]] -name = "alloy-sol-type-parser" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "857b470ecdd2ed38beaf82ad1a38c516a8ff75266750f38b9eeed001d575241b" -dependencies = [ - "serde", - "winnow 1.0.3", -] - -[[package]] -name = "alloy-sol-types" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384cf252de0db2dec52821eac037a7f57e2aa33fe5b900ce6fe39973402341f1" -dependencies = [ - "alloy-json-abi", - "alloy-primitives", - "alloy-sol-macro", - "serde", -] - -[[package]] -name = "alloy-trie" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f14b5d9b2c2173980202c6ff470d96e7c5e202c65a9f67884ad565226df7fbb" -dependencies = [ - "alloy-primitives", - "alloy-rlp", - "arbitrary", - "derive_arbitrary", - "derive_more", - "nybbles", - "proptest", - "proptest-derive 0.7.0", - "serde", - "smallvec", - "thiserror", - "tracing", -] - -[[package]] -name = "alloy-tx-macros" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69722eddcdf1ce096c3ab66cf8116999363f734eb36fe94a148f4f71c85da84" -dependencies = [ - "darling 0.23.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" - -[[package]] -name = "arbitrary" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" -dependencies = [ - "derive_arbitrary", -] - -[[package]] -name = "ark-bls12-381" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" -dependencies = [ - "ark-ec", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", -] - -[[package]] -name = "ark-bn254" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" -dependencies = [ - "ark-ec", - "ark-ff 0.5.0", - "ark-r1cs-std", - "ark-std 0.5.0", -] - -[[package]] -name = "ark-ec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-poly", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.4", - "itertools 0.13.0", - "num-bigint", - "num-integer", - "num-traits", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm 0.3.0", - "ark-ff-macros 0.3.0", - "ark-serialize 0.3.0", - "ark-std 0.3.0", - "derivative", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.3.3", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm 0.4.2", - "ark-ff-macros 0.4.2", - "ark-serialize 0.4.2", - "ark-std 0.4.0", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rustc_version 0.4.1", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" -dependencies = [ - "ark-ff-asm 0.5.0", - "ark-ff-macros 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "educe", - "itertools 0.13.0", - "num-bigint", - "num-traits", - "paste", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-asm" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "ark-ff-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" -dependencies = [ - "num-bigint", - "num-traits", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "ark-poly" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" -dependencies = [ - "ahash", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-std 0.5.0", - "educe", - "fnv", - "hashbrown 0.15.4", -] - -[[package]] -name = "ark-r1cs-std" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" -dependencies = [ - "ark-ec", - "ark-ff 0.5.0", - "ark-relations", - "ark-std 0.5.0", - "educe", - "num-bigint", - "num-integer", - "num-traits", - "tracing", -] - -[[package]] -name = "ark-relations" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" -dependencies = [ - "ark-ff 0.5.0", - "ark-std 0.5.0", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "ark-serialize" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" -dependencies = [ - "ark-std 0.3.0", - "digest 0.9.0", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-std 0.4.0", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-serialize" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" -dependencies = [ - "ark-serialize-derive", - "ark-std 0.5.0", - "arrayvec", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "ark-std" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "arrayref" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "aurora-engine-modexp" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9" -dependencies = [ - "hex", - "num", -] - -[[package]] -name = "auto_impl" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" - -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - -[[package]] -name = "bitcoin-io" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" - -[[package]] -name = "bitcoin_hashes" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" -dependencies = [ - "bitcoin-io", - "hex-conservative", -] - -[[package]] -name = "bitflags" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" -dependencies = [ - "serde_core", -] - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "serde", - "tap", - "wyz", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdd35008169921d80bc60d3d0ab416eecb028c4cd653352907921d95084790be" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "blst" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcdb4c7013139a150f9fc55d123186dbfaba0d912817466282c73ac49e71fb45" -dependencies = [ - "cc", - "glob", - "threadpool", - "zeroize", -] - -[[package]] -name = "borsh" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" -dependencies = [ - "borsh-derive", - "bytes", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "bumpalo" -version = "3.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" - -[[package]] -name = "byte-slice-cast" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" -dependencies = [ - "serde", -] - -[[package]] -name = "c-kzg" -version = "2.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6648ed1e4ea8e8a1a4a2c78e1cda29a3fd500bc622899c340d8525ea9a76b24a" -dependencies = [ - "arbitrary", - "blst", - "cc", - "glob", - "hex", - "libc", - "once_cell", - "serde", -] - -[[package]] -name = "cc" -version = "1.2.62" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chrono" -version = "0.4.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-link", -] - -[[package]] -name = "const-hex" -version = "1.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "hex", - "proptest", - "serde", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - -[[package]] -name = "crunchy" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-common" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core 0.23.0", - "darling_macro 0.23.0", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "serde", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core 0.23.0", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive-where" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08b3a0bcc0d079199cd476b2cae8435016ec11d1c0986c6901c5ac223041534" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "derive_arbitrary" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "derive_more" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "unicode-xid", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common 0.1.6", - "subtle", -] - -[[package]] -name = "digest" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" -dependencies = [ - "block-buffer 0.12.0", - "crypto-common 0.2.2", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "serdect", - "signature", - "spki", -] - -[[package]] -name = "educe" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -dependencies = [ - "serde", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "enum-ordinalize" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" -dependencies = [ - "enum-ordinalize-derive", -] - -[[package]] -name = "enum-ordinalize-derive" -version = "4.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "fastrlp" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "fastrlp" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", -] - -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" -dependencies = [ - "allocator-api2", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -dependencies = [ - "foldhash", - "serde", - "serde_core", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hex-conservative" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" -dependencies = [ - "arrayvec", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "hybrid-array" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9155a582abd142abc056962c29e3ce5ff2ad5469f4246b537ed42c5deba857da" -dependencies = [ - "typenum", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" -dependencies = [ - "arbitrary", - "equivalent", - "hashbrown 0.15.4", - "serde", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "js-sys" -version = "0.3.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" -dependencies = [ - "cfg-if", - "futures-util", - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "serdect", - "sha2", -] - -[[package]] -name = "keccak" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e24a010dd405bd7ed803e5253182815b41bf2e6a80cc3bfc066658e03a198aa" -dependencies = [ - "cfg-if", - "cpufeatures 0.3.0", -] - -[[package]] -name = "keccak-asm" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1766b89733097006f3a1388a02849865d6bc98c89273cb622e29fdd209922183" -dependencies = [ - "digest 0.10.7", - "sha3-asm", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.172" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" - -[[package]] -name = "libm" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "macro-string" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a9dbbfc75d2688ed057456ce8a3ee3f48d12eec09229f560f3643b9f275653" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "memchr" -version = "2.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "nybbles" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d49ff0c0d00d4a502b39df9af3a525e1efeb14b9dabb5bb83335284c1309210" -dependencies = [ - "alloy-rlp", - "arbitrary", - "cfg-if", - "proptest", - "ruint", - "serde", - "smallvec", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - -[[package]] -name = "parity-scale-codec" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "const_format", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pest" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared", - "serde", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro2" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" -dependencies = [ - "bit-set", - "bit-vec", - "bitflags", - "lazy_static", - "num-traits", - "rand 0.9.1", - "rand_chacha 0.9.0", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", - "unarray", -] - -[[package]] -name = "proptest-derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6dc647500e84a25a85b100e76c85b8ace114c209432dc174f20aac11d4ed6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "proptest-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57924a81864dddafba92e1bf92f9bf82f97096c44489548a60e888e1547549b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rain-math-float" -version = "0.1.10" -dependencies = [ - "alloy", - "anyhow", - "getrandom 0.2.16", - "proptest", - "revm", - "serde", - "serde_json", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-utils", -] - -[[package]] -name = "rain-math-float-wasm" -version = "0.1.0" -dependencies = [ - "rain-math-float", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", - "serde", -] - -[[package]] -name = "rand" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", - "serde", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.16", -] - -[[package]] -name = "rand_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" -dependencies = [ - "getrandom 0.3.3", - "serde", -] - -[[package]] -name = "rand_xorshift" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" -dependencies = [ - "rand_core 0.9.3", -] - -[[package]] -name = "rapidhash" -version = "4.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" -dependencies = [ - "rustversion", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "revm" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0abc15d09cd211e9e73410ada10134069c794d4bcdb787dfc16a1bf0939849c" -dependencies = [ - "revm-bytecode", - "revm-context", - "revm-context-interface", - "revm-database", - "revm-database-interface", - "revm-handler", - "revm-inspector", - "revm-interpreter", - "revm-precompile", - "revm-primitives", - "revm-state", -] - -[[package]] -name = "revm-bytecode" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86e468df3cf5cf59fa7ef71a3e9ccabb76bb336401ea2c0674f563104cf3c5e" -dependencies = [ - "bitvec", - "phf", - "revm-primitives", - "serde", -] - -[[package]] -name = "revm-context" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eb1f0a76b14d684a444fc52f7bf6b7564bf882599d91ee62e76d602e7a187c7" -dependencies = [ - "bitvec", - "cfg-if", - "derive-where", - "revm-bytecode", - "revm-context-interface", - "revm-database-interface", - "revm-primitives", - "revm-state", - "serde", -] - -[[package]] -name = "revm-context-interface" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc256b27743e2912ca16899568e6652a372eb5d1d573e6edb16c7836b16cf487" -dependencies = [ - "alloy-eip2930", - "alloy-eip7702", - "auto_impl", - "either", - "revm-database-interface", - "revm-primitives", - "revm-state", - "serde", -] - -[[package]] -name = "revm-database" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0a7d6da41061f2c50f99a2632571026b23684b5449ff319914151f4449b6c8" -dependencies = [ - "alloy-eips", - "revm-bytecode", - "revm-database-interface", - "revm-primitives", - "revm-state", - "serde", -] - -[[package]] -name = "revm-database-interface" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd497a38a79057b94a049552cb1f925ad15078bc1a479c132aeeebd1d2ccc768" -dependencies = [ - "auto_impl", - "either", - "revm-primitives", - "revm-state", - "serde", - "thiserror", -] - -[[package]] -name = "revm-handler" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1eed729ca9b228ae98688f352235871e9b8be3d568d488e4070f64c56e9d3d" -dependencies = [ - "auto_impl", - "derive-where", - "revm-bytecode", - "revm-context", - "revm-context-interface", - "revm-database-interface", - "revm-interpreter", - "revm-precompile", - "revm-primitives", - "revm-state", - "serde", -] - -[[package]] -name = "revm-inspector" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf5102391706513689f91cb3cb3d97b5f13a02e8647e6e9cb7620877ef84847" -dependencies = [ - "auto_impl", - "either", - "revm-context", - "revm-database-interface", - "revm-handler", - "revm-interpreter", - "revm-primitives", - "revm-state", - "serde", - "serde_json", -] - -[[package]] -name = "revm-interpreter" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf22f80612bb8f58fd1f578750281f2afadb6c93835b14ae6a4d6b75ca26f445" -dependencies = [ - "revm-bytecode", - "revm-context-interface", - "revm-primitives", - "revm-state", - "serde", -] - -[[package]] -name = "revm-precompile" -version = "32.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ec11f45deec71e4945e1809736bb20d454285f9167ab53c5159dae1deb603f" -dependencies = [ - "ark-bls12-381", - "ark-bn254", - "ark-ec", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "arrayref", - "aurora-engine-modexp", - "blst", - "c-kzg", - "cfg-if", - "k256", - "p256", - "revm-primitives", - "ripemd", - "secp256k1 0.31.1", - "sha2", -] - -[[package]] -name = "revm-primitives" -version = "22.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfb5ce6cf18b118932bcdb7da05cd9c250f2cb9f64131396b55f3fe3537c35" -dependencies = [ - "alloy-primitives", - "num_enum", - "once_cell", - "serde", -] - -[[package]] -name = "revm-state" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29404707763da607e5d6e4771cb203998c28159279c2f64cc32de08d2814651" -dependencies = [ - "alloy-eip7928", - "bitflags", - "revm-bytecode", - "revm-primitives", - "serde", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "ruint" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0298da754d1395046b0afdc2f20ee76d29a8ae310cd30ffa84ed42acba9cb12a" -dependencies = [ - "alloy-rlp", - "arbitrary", - "ark-ff 0.3.0", - "ark-ff 0.4.2", - "ark-ff 0.5.0", - "bytes", - "fastrlp 0.3.1", - "fastrlp 0.4.0", - "num-bigint", - "num-integer", - "num-traits", - "parity-scale-codec", - "primitive-types", - "proptest", - "rand 0.8.5", - "rand 0.9.1", - "rlp", - "ruint-macro", - "serde_core", - "valuable", - "zeroize", -] - -[[package]] -name = "ruint-macro" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" - -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver 1.0.26", -] - -[[package]] -name = "rustix" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustversion" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" - -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "serdect", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" -dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", - "secp256k1-sys 0.10.1", - "serde", -] - -[[package]] -name = "secp256k1" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3c81b43dc2d8877c216a3fccf76677ee1ebccd429566d3e67447290d0c42b2" -dependencies = [ - "bitcoin_hashes", - "rand 0.9.1", - "secp256k1-sys 0.11.0", -] - -[[package]] -name = "secp256k1-sys" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" -dependencies = [ - "cc", -] - -[[package]] -name = "secp256k1-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb913707158fadaf0d8702c2db0e857de66eb003ccfdda5924b5f5ac98efb38" -dependencies = [ - "cc", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" - -[[package]] -name = "semver-parser" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" -dependencies = [ - "pest", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde-wasm-bindgen" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - -[[package]] -name = "serde-wasm-bindgen" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_derive_internals" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_json" -version = "1.0.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "indexmap 2.9.0", - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.9.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be176f1a57ce4e3d31c1a166222d9768de5954f811601fb7ca06fc8203905ce1" -dependencies = [ - "digest 0.11.3", - "keccak", -] - -[[package]] -name = "sha3-asm" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3f15d4e239ebe08413eed880e0f9b5af4b40ee0472543320efa91d488e96a7" -dependencies = [ - "cc", - "cfg-if", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -dependencies = [ - "arbitrary", - "serde", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.117", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn-solidity" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec005042c7d952febc1a3ef5b0f6674e9054aa836877a31c90b20e25b3d31744" -dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" -dependencies = [ - "fastrand", - "getrandom 0.3.3", - "once_cell", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - -[[package]] -name = "time" -version = "0.3.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" - -[[package]] -name = "time-macros" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap 2.9.0", - "toml_datetime", - "winnow 0.7.11", -] - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tracing-core" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "tracing-core", -] - -[[package]] -name = "tsify" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b26cf145f2f3b9ff84e182c448eaf05468e247f148cf3d2a7d67d78ff023a0" -dependencies = [ - "serde", - "serde-wasm-bindgen 0.5.0", - "tsify-macros", - "wasm-bindgen", -] - -[[package]] -name = "tsify-macros" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a94b0f0954b3e59bfc2c246b4c8574390d94a4ad4ad246aaf2fb07d7dfd3b47" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.117", -] - -[[package]] -name = "typenum" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" - -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "wait-timeout" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" -dependencies = [ - "libc", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9473dbd2991ae90b6291c3c32c30c6187ac49aa32f9905d1cce280ec1e110b0f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.117", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-bindgen-utils" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ec45201ec48a021de21357beca43a1c93669e68eeae5deca5e3ba6b4b4fd4d6" -dependencies = [ - "js-sys", - "paste", - "serde", - "serde-wasm-bindgen 0.6.5", - "tsify", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-utils-macros", -] - -[[package]] -name = "wasm-bindgen-utils-macros" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bf3e098464ba4e518a659f81794d58c043b8d144f8c29c11fbb488d75264f4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-implement" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-interface" -version = "0.59.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 8c079fca..00000000 --- a/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[workspace] -members = ["crates/*"] -resolver = "2" - -[workspace.package] -edition = "2024" -version = "0.1.0" -license = "LicenseRef-DCL-1.0" -homepage = "https://github.com/rainlanguage/rain.math.float" -repository = "https://github.com/rainlanguage/rain.math.float" - -[workspace.dependencies] -alloy = { version = "1.0.9", default-features = false, features = [ - "sol-types", - "json", - "json-abi", -] } -revm = { version = "36", default-features = false, features = [ - "portable", - "std", - "tracer", -] } -thiserror = "2.0.12" -proptest = "1.7.0" -serde = "1.0.219" diff --git a/REUSE.toml b/REUSE.toml index aaf481c9..eeae38fb 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -5,22 +5,13 @@ path = [ ".envrc", ".gas-snapshot", ".github/workflows/**/", - ".prettierignore", ".vscode/**/", ".soldeerignore", "audit/**/", - "Cargo.lock", - "Cargo.toml", ".gitignore", ".gitmodules", - "package-lock.json", - "package.json", - "scripts/**/", - "test_js/**/", - "tsconfig.json", "CLAUDE.md", "README.md", - "crates/**/", "flake.lock", "flake.nix", "foundry.toml", diff --git a/crates/float-wasm/Cargo.toml b/crates/float-wasm/Cargo.toml deleted file mode 100644 index 0cd5decc..00000000 --- a/crates/float-wasm/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "rain-math-float-wasm" -version = "0.1.0" -edition = "2021" -license = "LicenseRef-DCL-1.0" -homepage = "https://github.com/rainlanguage/rain.math.float" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -rain-math-float = { path = "../float" } diff --git a/crates/float-wasm/src/lib.rs b/crates/float-wasm/src/lib.rs deleted file mode 100644 index 0b627002..00000000 --- a/crates/float-wasm/src/lib.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! WASM cdylib wrapper for `rain-math-float`. -//! -//! This crate exists solely to produce the cdylib artifact for WASM targets. -//! The core library (`rain-math-float`) is rlib-only to avoid output filename -//! collisions that cause duplicate dependency compilation in downstream -//! consumers. - -pub use rain_math_float::*; diff --git a/crates/float/Cargo.toml b/crates/float/Cargo.toml deleted file mode 100644 index fa60b4a7..00000000 --- a/crates/float/Cargo.toml +++ /dev/null @@ -1,55 +0,0 @@ -[package] -name = "rain-math-float" -version = "0.1.10" -edition = "2021" -license = "LicenseRef-DCL-1.0" -description = "Decimal floating-point arithmetic for Rainlang / DeFi smart contracts. Packs a 224-bit signed coefficient and 32-bit signed exponent into a single bytes32, with exact decimal semantics (no NaN, Infinity, or negative zero — operations error on nonsense). Rust bindings delegate to the Solidity reference via an in-memory EVM so on-chain and off-chain results match exactly." -homepage = "https://github.com/rainlanguage/rain.math.float" -repository = "https://github.com/rainlanguage/rain.math.float" - -[lib] -crate-type = ["rlib"] - -[dependencies] -alloy = { version = "1.0.9", default-features = false, features = [ - "sol-types", - "json", - "json-abi", -] } -thiserror = "2.0.12" -serde = "1.0.219" -# wasm-bindgen must be a direct dependency: the #[wasm_bindgen] macro emits -# `::wasm_bindgen` paths, and without a direct dep on the crate they fail to -# resolve and the macro recurses without bound on opaque-class structs (Float). -wasm-bindgen = "0.2.122" -wasm-bindgen-utils = "0.1.2" - -[target.'cfg(not(target_family = "wasm"))'.dependencies] -revm = { version = "36", default-features = false, features = [ - "c-kzg", - "portable", - "std", - "tracer", -] } - -[target.'cfg(target_family = "wasm")'.dependencies] -# revm 36 dropped the pure-Rust kzg-rs backend; the C-based c-kzg can't target -# wasm. DecimalFloat doesn't use the KZG point-evaluation precompile, so no KZG -# backend is enabled for wasm. -revm = { version = "36", default-features = false, features = [ - "portable", - "std", - "tracer", -] } -getrandom = { version = "0.2.11", features = ["js", "js-sys"] } - -[dev-dependencies] -alloy = { version = "1.0.9", default-features = false, features = [ - "sol-types", - "json", - "json-abi", - "arbitrary", -] } -anyhow = "1.0.98" -proptest = "1.7.0" -serde_json = "1.0.140" diff --git a/crates/float/abi/DecimalFloat.json b/crates/float/abi/DecimalFloat.json deleted file mode 100644 index 80b90a5b..00000000 --- a/crates/float/abi/DecimalFloat.json +++ /dev/null @@ -1,1110 +0,0 @@ -{ - "abi": [ - { - "type": "constructor", - "inputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "FORMAT_DEFAULT_SCIENTIFIC_MAX", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "FORMAT_DEFAULT_SCIENTIFIC_MIN", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "abs", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "add", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "ceil", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "div", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "e", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "eq", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "floor", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "format", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "scientific", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "format", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "format", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "scientificMin", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "scientificMax", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "frac", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "fromFixedDecimalLossless", - "inputs": [ - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "decimals", - "type": "uint8", - "internalType": "uint8" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "fromFixedDecimalLossy", - "inputs": [ - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "decimals", - "type": "uint8", - "internalType": "uint8" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "gt", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "gte", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "integer", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "inv", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "isZero", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "log10", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "lt", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "lte", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "max", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "maxNegativeValue", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "maxPositiveValue", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "min", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "minNegativeValue", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "minPositiveValue", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "minus", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "mul", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "parse", - "inputs": [ - { - "name": "str", - "type": "string", - "internalType": "string" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - }, - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "pow", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "pow10", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "sqrt", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "sub", - "inputs": [ - { - "name": "a", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "toFixedDecimalLossless", - "inputs": [ - { - "name": "float", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "decimals", - "type": "uint8", - "internalType": "uint8" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "toFixedDecimalLossy", - "inputs": [ - { - "name": "float", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "decimals", - "type": "uint8", - "internalType": "uint8" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "zero", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "error", - "name": "CoefficientOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "DivisionByZero", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "ExponentOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "ExponentUnderflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "FixedDecimalOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - }, - { - "name": "decimals", - "type": "uint8", - "internalType": "uint8" - } - ] - }, - { - "type": "error", - "name": "Log10Negative", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "Log10Zero", - "inputs": [] - }, - { - "type": "error", - "name": "LogTablesNotDeployed", - "inputs": [ - { - "name": "tablesAddress", - "type": "address", - "internalType": "address" - }, - { - "name": "expectedCodehash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "actualCodehash", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "LossyConversionFromFloat", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "LossyConversionToFloat", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "MaximizeOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "MulDivOverflow", - "inputs": [ - { - "name": "x", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "y", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "denominator", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "NegativeFixedDecimalConversion", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "PowNegativeBase", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "ScientificMinNotLessThanMax", - "inputs": [ - { - "name": "scientificMin", - "type": "bytes32", - "internalType": "Float" - }, - { - "name": "scientificMax", - "type": "bytes32", - "internalType": "Float" - } - ] - }, - { - "type": "error", - "name": "UnformatableExponent", - "inputs": [ - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "WithTargetExponentOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - }, - { - "name": "targetExponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "ZeroNegativePower", - "inputs": [ - { - "name": "b", - "type": "bytes32", - "internalType": "Float" - } - ] - }, - { - "type": "error", - "name": "ZeroStringStartPointer", - "inputs": [] - } - ], - "bytecode": { - "object": "0x6080604052348015600e575f80fd5b5060156019565b60b8565b73c51a14251b0dcf0ae24a96b7153991378938f5f53f7f2573004ac3a9ee7fc8d73654d76386f1b6b99e34cdf86a689c4691e47143420f811460b557604051630912d0ff60e31b815273c51a14251b0dcf0ae24a96b7153991378938f5f560048201527f2573004ac3a9ee7fc8d73654d76386f1b6b99e34cdf86a689c4691e47143420f60248201526044810182905260640160405180910390fd5b50565b614ddd806100c55f395ff3fe608060405234801561000f575f80fd5b506004361061029d575f3560e01c806381f7e2f511610171578063cde72ef3116100d2578063dd64691711610088578063e5526ecd1161006e578063e5526ecd1461062e578063e75f991f14610641578063ffae15ba14610654575f80fd5b8063dd64691714610608578063e0db58881461061b575f80fd5b8063d1de592a116100b8578063d1de592a146105bb578063d35273a7146105ce578063d3d6ffa8146105f5575f80fd5b8063cde72ef314610582578063d102b4d3146105a8575f80fd5b8063a19684b711610127578063bc1b392d1161010d578063bc1b392d1461050b578063bc62d8d814610511578063cb09682b1461055c575f80fd5b8063a19684b7146104d2578063a90d041a146104f8575f80fd5b806396ce1ec71161015757806396ce1ec7146104885780639b4afd991461049b578063a100a3d9146104bf575f80fd5b806381f7e2f5146104625780638dc2980714610475575f80fd5b80633447c0301161021b5780635ca0e7a4116101d1578063719cd99d116101b7578063719cd99d1461042957806373bfb2831461043c57806381a822721461044f575f80fd5b80635ca0e7a4146103f0578063602c35fc14610403575f80fd5b80633b3bd868116102015780633b3bd868146103b757806341aa0080146103ca5780635b23771d146103dd575f80fd5b80633447c03014610374578063371493ce14610397575f80fd5b80631ee62f111161027057806328fa1f011161025657806328fa1f011461033b5780633004fa411461034e5780633029740014610361575f80fd5b80631ee62f11146103155780632538835014610328575f80fd5b806304327dc5146102a1578063078b665b146102c75780630b6429bc146102da578063146e82ad14610302575b5f80fd5b6102b46102af36600461475f565b61067a565b6040519081526020015b60405180910390f35b6102b46102d5366004614776565b61068a565b6102ed6102e83660046147a6565b61069c565b604080519283529015156020830152016102be565b6102b461031036600461475f565b6106b4565b6102b461032336600461475f565b6106d3565b6102b461033636600461475f565b6106f2565b6102b461034936600461475f565b610711565b6102b461035c366004614776565b61071b565b6102b461036f366004614776565b61073b565b610387610382366004614776565b610746565b60405190151581526020016102be565b6103aa6103a53660046147d0565b610751565b6040516102be9190614802565b6102b46103c53660046147a6565b61075d565b6102b46103d8366004614776565b610768565b6102b46103eb3660046147a6565b610773565b6102b46103fe36600461475f565b61077e565b7f80000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff6102b4565b6102b461043736600461475f565b610788565b61038761044a366004614776565b610792565b6102b461045d36600461475f565b61079d565b610387610470366004614776565b6107a7565b610387610483366004614776565b6107b2565b6102b4610496366004614776565b6107bd565b6102b47c090000000000000000000000000000000000000000000000000000000181565b6103aa6104cd36600461475f565b6107c8565b7f80000000000000000000000000000000000000000000000000000000000000016102b4565b6102b4610506366004614776565b610812565b5f6102b4565b61052461051f366004614882565b61081d565b604080517fffffffff0000000000000000000000000000000000000000000000000000000090931683526020830191909152016102be565b7f7fffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffff6102b4565b7f7fffffff800000000000000000000000000000000000000000000000000000006102b4565b6103876105b6366004614776565b610836565b6102b46105c9366004614776565b610841565b6102b47ffffffffc0000000000000000000000000000000000000000000000000000000181565b6102b461060336600461475f565b61084c565b61038761061636600461475f565b610856565b6102b461062936600461475f565b61087c565b6103aa61063c36600461494b565b610886565b6102ed61064f3660046147a6565b61090f565b7fffffffbe19cfc6ef4f44cf88f14500d013df534fcaad48fca1d5ca47bea26fcc6102b4565b5f6106848261091b565b92915050565b5f610695838361095d565b9392505050565b5f806106a88484610979565b915091505b9250929050565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f56109ba565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f56109e6565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f5610a33565b5f61068482610a66565b5f610695838373c51a14251b0dcf0ae24a96b7153991378938f5f5610aa7565b5f6106958383610d01565b5f6106958383610d63565b60606106958383610db1565b5f6106958383610e44565b5f6106958383610e5f565b5f6106958383610ea4565b5f61068482610ed7565b5f61068482610f8d565b5f6106958383611039565b5f61068482611089565b5f61069583836110ce565b5f610695838361111e565b5f610695838361116d565b6060610684827ffffffffc000000000000000000000000000000000000000000000000000000017c0900000000000000000000000000000000000000000000000000000001610886565b5f61069583836111b2565b5f805f8061082a856111bd565b90969095509350505050565b5f61069583836112ab565b5f61069583836112fa565b5f6106848261133f565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff821615610684565b5f61068482611371565b606061089283836112ab565b6108d7576040517f3be5bf9400000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044015b60405180910390fd5b5f6108e185611089565b9050610906856108f183876112ab565b806109015750610901838661111e565b610db1565b95945050505050565b5f806106a884846113b2565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d61094d82826113f2565b90925090505f6109068383611440565b5f610968838361111e565b6109725781610695565b5090919050565b5f807bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8416601b0b60e085901d6109ad8282876114a6565b9350935050509250929050565b5f610695837fffffffff0000000000000000000000000000000000000000000000000000000584610aa7565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610a198483836116b0565b90925090505f610a298383611440565b9695505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610a19848383611821565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d82610a998383611b56565b9150505f610a298284611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff848116601b0b9060e086901d908516610ae45750600191506106959050565b5f8213610b7d57815f03610b4157610afc855f6112ab565b15610b36576040517f8be82972000000000000000000000000000000000000000000000000000000008152600481018690526024016108ce565b505f91506106959050565b6040517fcceba0f100000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b610b88856001610d63565b8015610b995750610b99865f61111e565b15610ba8578592505050610695565b610bb2855f6112ab565b15610bdb57610bd2610bc38761091b565b610bcc8761133f565b86610aa7565b92505050610695565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8516601b0b60e086901d5f80610c0e8484611b56565b915091505f610c1e83855f611bbe565b905060015f8080610c558f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116601b0b9160e09190911d90565b915091505b60018510610c9c5784600116600103610c7f57610c7984848484611cd5565b90945092505b600185901c9450610c9282828484611cd5565b9092509050610c5a565b5f80610ca98f8e8e611821565b91509150610cb982828a8d611cd5565b9092509050610cc98f83836116b0565b9092509050610cda82828888611cd5565b90925090505f610cea8383611440565b9e5050505050505050505050505050509392505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d4686868686611df4565b915091505f610d558383611440565b9a9950505050505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d610da684848484612418565b979650505050505050565b60607bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d5f829003610e21576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525092505050610684565b8315610e3a57610e31828261242f565b92505050610684565b610906828261276c565b5f805f610e518585612f96565b915091506109068282612ff8565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d468686868661304a565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610906828286613074565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828112610f0e57509192915050565b5f80610f1a8484611b56565b915091505f84128015610f2c57508015155b15610f8257610f7d82847f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb461304a565b935091505b5f610da68385611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828112610fc457509192915050565b5f80610fd08484611b56565b91509150805f03610fe5575093949350505050565b5f811315610f8257610f7d82847f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb46130d0565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61107c84848484613200565b1315979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828212156110c35761094d82826132d4565b5f6109068383611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61111184848484613200565b1215979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61116184848484613200565b12979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d4686868686611cd5565b5f61096883836112ab565b80515f908190602084810191850101828080806111da8686613377565b929650909450925090507fffffffff0000000000000000000000000000000000000000000000000000000084165f0361129c5784830361126c575f806112208484613816565b915091508061125b57507f32b8b8be000000000000000000000000000000000000000000000000000000009a5f9a5098505050505050505050565b505f9a909950975050505050505050565b507fad384e8700000000000000000000000000000000000000000000000000000000985f98509650505050505050565b5091975f975095505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d6112ee84848484613200565b13979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d46868686866130d0565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d61094d82826132d4565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d826113a48383611b56565b5090505f610a298284611440565b5f805f805f6113c1878761391c565b9250925092505f806113d38585613816565b91509150818380156113e25750815b9650965050505050509250929050565b5f806106a87f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb48686611df4565b5f805f61144d8585613816565b915091508015801561145d575081155b1561149e576040517f8eba4d0700000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b509392505050565b5f805f8512156114ec576040517f4a7d166b00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b845f036114fe57505f905060016116a8565b8460ff8416850185811215611549576040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101889052602481018790526044016108ce565b5f805f8312156115b3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb383121561158a575f8095509550505050506116a8565b825f03600a0a91508184816115a1576115a1614974565b04955050840290911491506116a89050565b5f83131561169d57604d831315611609576040517fc849483b000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905260ff881660448201526064016108ce565b82600a0a9150817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8161163e5761163e614974565b0484111561168b576040517fc849483b000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905260ff881660448201526064016108ce565b50919091029250600191506116a89050565b509193506001925050505b935093915050565b5f805f8412156116ec576116c484846132d4565b90945092506116d48585856116b0565b90945092506116e384846113f2565b915091506116a8565b5f806116f88686611b56565b9092509050845f808061170b8585613978565b9194509250905061270d6127106117236001826149ce565b851461173a576117348d8686613a67565b90925090505b83156117c5575f61174c8660016149f4565b90505b80848583028161176157611761614974565b051461177857600a84059350600a8805975061174f565b6117b96117858588614a1b565b896117908785614a1b565b8f87877ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc613b20565b909d509b506117ec9050565b819b507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9a505b5050505050866117fd84835f611bbe565b6118088860016149f4565b61181291906149f4565b94509450505050935093915050565b5f80838361182f8282613bbd565b90965094505f86136118b057855f03611874576040517f561fc7b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f5d3fd4db00000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b5050837f161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000036118ee576118e483604c6149f4565b5f915091506116a8565b7f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000008412158061193d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb561195f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb45b5f0b8412611b1a575f805f805f8561197857604b61197b565b604c5b611985908a6149f4565b90505f80876119b2577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e10000000000000000006119d3565b7e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca0000000000000000005b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff169050808c81611a0557611a05614974565b05818102955090850193507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18019050611a3e8c82613c13565b7d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e10000000000000000000295508594508a8414611aca576123278114611aa557611a808c82600101613c13565b7d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000002611ac7565b7f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000005b94505b50611afa838b848c89897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb4613b20565b909a509850611b0b8a8a835f6130d0565b975097505050505050506116a8565b611b2485856113f2565b9095509350611b34868686611821565b9095509350611b4385856132d4565b92509250506116a8565b50935093915050565b5f805f8312611b6957508290505f6106ad565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb4831215611b9b57505f9050826106ad565b5f839003600a0a808581611bb157611bb1614974565b0794859003959350505050565b5f818303611bcd575082610695565b82821315611c1057828203604c811380611be757505f8113155b15611bf5575f915050610695565b80600a0a8581611c0757611c07614974565b05915050610695565b818303604c811380611c2257505f8113155b15611c6a576040517f1d5d6d100000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604481018490526064016108ce565b600a81900a85810286828281611c8257611c82614974565b0514611ccb576040517f1d5d6d100000000000000000000000000000000000000000000000000000000081526004810188905260248101879052604481018690526064016108ce565b9250610695915050565b5f8085158415178015611ced575f92505f9150611dea565b611cf784876149f4565b91505f611d0388613c9a565b90505f611d0f87613c9a565b90505f611d1c8383613d00565b5090505f6f0785ee10d5da46d900f436a000000000821115611d51576f0785ee10d5da46d900f436a000000000820491506025015b670de0b6b3a7640000821115611d7257670de0b6b3a7640000820491506012015b633b9aca00821115611d8b57633b9aca00820491506009015b612710821115611da057612710820491506004015b8115611db457600a82049150600101611da0565b611dbe81876149f4565b9550611de08b8a611dda8787611dd587600a614b84565b613d3b565b89613e20565b9097509550505050505b5094509492505050565b5f80835f03611e39576040517f7a97930f00000000000000000000000000000000000000000000000000000000815260048101879052602481018690526044016108ce565b855f03611e4a57505f90508061240f565b5f805f80611e588a8a613f27565b919b5099509150611e698888613f27565b919950975090505f611e7a8b613c9a565b90505f611e868a613c9a565b90507f161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000604c818310156122a3578415611ee457507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000009050604b612262565b6f4b3b4ca85a86c47a098a22400000000083101561201057678ac7230489e80000831015611f74576402540be400831015611f4257620186a0831015611f325750620186a0905060056121eb565b506402540be4009050600a6121eb565b655af3107a4000831015611f615750655af3107a40009050600e6121eb565b50678ac7230489e80000905060136121eb565b6b204fce5e3e25026110000000831015611fc65769152d02c7e14af6800000831015611faf575069152d02c7e14af6800000905060176121eb565b506b204fce5e3e250261100000009050601c6121eb565b6d314dc6448d9338c15b0a00000000831015611ff557506d314dc6448d9338c15b0a00000000905060216121eb565b506f4b3b4ca85a86c47a098a224000000000905060266121eb565b780197d4df19d605767337e9f14d3eec8920e4000000000000008310156121085773af298d050e4395d69670b12b7f410000000000008310156120a3577172cb5bd86321e38cb6ce6682e8000000000083101561208457507172cb5bd86321e38cb6ce6682e800000000009050602b6121eb565b5073af298d050e4395d69670b12b7f41000000000000905060306121eb565b76010b46c6cdd6e3e0828f4db456ff0c8ea00000000000008310156120e4575076010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000905060356121eb565b50780197d4df19d605767337e9f14d3eec8920e4000000000000009050603a6121eb565b7c03b58e88c75313ec9d329eaaa18fb92f75215b1710000000000000000083101561219e577a026e4d30eccc3215dd8f3157d27e23acbdcfe6800000000000000083101561217657507a026e4d30eccc3215dd8f3157d27e23acbdcfe680000000000000009050603f6121eb565b507c03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000905060446121eb565b7e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca0000000000000000008310156121eb57507e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000905060495b81831161221f57600a820491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016121eb565b815f03612262576040517f05e51ecb000000000000000000000000000000000000000000000000000000008152600481018d9052602481018c90526044016108ce565b856122a3576040517f05e51ecb000000000000000000000000000000000000000000000000000000008152600481018f9052602481018e90526044016108ce565b807f8000000000000000000000000000000000000000000000000000000000000000018d126122d657808d039c50612349565b7f80000000000000000000000000000000000000000000000000000000000000009c90038c015f81131561234957807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038b1361233657998a0199612349565b5f8099509950505050505050505061240f565b5f808e12801561235857505f8c135b15612395577f80000000000000000000000000000000000000000000000000000000000000008e01808d1361238d575f612391565b808d035b9150505b8b818f010397506123b28f8e6123ac888789613d3b565b8b613e20565b90995097505f8113156123fc57604c8113156123dc575f809a509a5050505050505050505061240f565b80600a0a89816123ee576123ee614974565b059850885f036123fc575f97505b5096985094965061240f95505050505050565b94509492505050565b5f61242585858585613200565b1495945050505050565b60608161243c8482613bbd565b90945092505f8061246d7f161bcca7119915b50764b4abe86529797775a5f171951000000000000000000087614b8f565b1561249d57507f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000009050604c6124c4565b507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000009050604b5b5f6124cf8388614b8f565b90505f6124dc8489614bf6565b90505f808312156124f6575060016124f383614c09565b92505b5f82121561250d5750600161250a82614c09565b91505b60408051602081019091525f81528215612616575f8061252e600a89614c39565b90505b61253b8186614b8f565b5f036125605761254c600a82614c39565b90508161255881614c4c565b925050612531565b60408051602081019091525f8082525b838110156125c157816040516020016125899190614c9a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529150600101612570565b505b6125ce600a87614bf6565b5f036125e6576125df600a87614b8f565b95506125c3565b806125f0876141c8565b604051602001612601929190614cd2565b60405160208183030381529060405293505050505b5f612620856141c8565b90505f61262d878c6149f4565b9050637fffffff81138061266057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000000081125b1561269a576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018a90526024016108ce565b5f81156126ce576126aa826141c8565b6040516020016126ba9190614d14565b6040516020818303038152906040526126de565b60405180602001604052805f8152505b90505f856126fa5760405180602001604052805f815250612731565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b90508084868460405160200161274a9493929190614d45565b6040516020818303038152906040529b50505050505050505050505092915050565b60606103e882138061278757506127846103e8614c09565b82125b156127c1576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018390526024016108ce565b5f8084129081156127dc576127d585614c09565b90506127df565b50835b5f8413156128a2578360448110612825576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018690526024016108ce565b7b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff5f5b8281101561286157612857600a83614c39565b9150600101612844565b508083111561289f576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018790526024016108ce565b50505b5f6128ac82614254565b80519091505f5b818110801561292f575082816128ca600185614d65565b6128d49190614d65565b815181106128e4576128e4614d78565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f3000000000000000000000000000000000000000000000000000000000000000145b15612946578061293e81614c4c565b9150506128b3565b5f6129518284614d65565b90505f61295e838a6149f4565b90505f8761297a5760405180602001604052805f8152506129b1565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b90505f8212612b2b57815f6129c68286614da5565b67ffffffffffffffff8111156129de576129de614855565b6040519080825280601f01601f191660200182016040528015612a08576020820181803683370190505b5090505f5b85811015612a7a57888181518110612a2757612a27614d78565b602001015160f81c60f81b828281518110612a4457612a44614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612a0d565b505f5b82811015612af7577f300000000000000000000000000000000000000000000000000000000000000082612ab18389614da5565b81518110612ac157612ac1614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612a7d565b508281604051602001612b0b929190614db8565b6040516020818303038152906040529a5050505050505050505050610684565b5f612b3583614c09565b905080841115612d4c575f612b4a8286614d65565b90505f612b58866001614da5565b67ffffffffffffffff811115612b7057612b70614855565b6040519080825280601f01601f191660200182016040528015612b9a576020820181803683370190505b5090505f5b82811015612c0c57898181518110612bb957612bb9614d78565b602001015160f81c60f81b828281518110612bd657612bd6614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612b9f565b507f2e00000000000000000000000000000000000000000000000000000000000000818381518110612c4057612c40614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b83811015612d175789612c838285614da5565b81518110612c9357612c93614d78565b01602001517fff00000000000000000000000000000000000000000000000000000000000000168282612cc7866001614da5565b612cd19190614da5565b81518110612ce157612ce1614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612c70565b508381604051602001612d2b929190614db8565b6040516020818303038152906040529b505050505050505050505050610684565b5f612d578583614d65565b90505f85612d66836002614da5565b612d709190614da5565b67ffffffffffffffff811115612d8857612d88614855565b6040519080825280601f01601f191660200182016040528015612db2576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f81518110612de857612de8614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f2e0000000000000000000000000000000000000000000000000000000000000081600181518110612e4a57612e4a614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b82811015612ef5577f300000000000000000000000000000000000000000000000000000000000000082612eaf836002614da5565b81518110612ebf57612ebf614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612e7a565b505f5b86811015612d1757898181518110612f1257612f12614d78565b01602001517fff00000000000000000000000000000000000000000000000000000000000000168282612f46866002614da5565b612f509190614da5565b81518110612f6057612f60614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612ef8565b5f805f805f612fa5878761391c565b92509250925080612fec576040517fc471796600000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044016108ce565b50909590945092505050565b5f805f6130058585613816565b915091508061149e576040517f22c9f7bb00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b5f8061305684846132d4565b9094509250613067868686866130d0565b9150915094509492505050565b5f805f6130828686866114a6565b91509150806130c7576040517f05e4767800000000000000000000000000000000000000000000000000000000815260048101879052602481018690526044016108ce565b50949350505050565b5f80851584151780156130fc57865f036130f0578484925092505061240f565b8686925092505061240f565b6131068787613bbd565b90975095506131158585613bbd565b909550935085841315613129579395929492935b838603604c81111561314257878793509350505061240f565b80600a0a868161315457613154614974565b0595505086850180881860ff90811c151589881890911c151680156131ef57877f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff036131d6576040517fd556b111000000000000000000000000000000000000000000000000000000008152600481018a9052602481018990526044016108ce565b600a9687900596909805860197600197909701966131f3565b8198505b5096979596505050505050565b5f8085158415178187128286121817858414178015613225578685925092505061240f565b505f85841315613239575092949193919260015b8386035f8112604c821317801561326c57821561325e575f899450945050505061240f565b885f9450945050505061240f565b600a82900a8981028a82828161328457613284614974565b05146132b05784156132a0575f8b96509650505050505061240f565b8a5f96509650505050505061240f565b84156132c557889650945061240f9350505050565b955087945061240f9350505050565b5f807f8000000000000000000000000000000000000000000000000000000000000000840361336d577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8303613360576040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044016108ce565b600a840593508260010192505b50505f9190910391565b5f82818061338c838665200000000000614310565b925085831415836133a681886703ff000000000000614310565b94508085036133e057507f34bd20690000000000000000000000000000000000000000000000000000000094505f925082915061380d9050565b5f806133ec8a88614339565b90925090507fffffffff0000000000000000000000000000000000000000000000000000000082161561342a575095505f935083925061380d915050565b86519095506540000000000060015f9290921a9190911b1615158887101691505080156136b957506001909301925f8461346d81896703ff000000000000614310565b95508086036134a857507f7bfa48af0000000000000000000000000000000000000000000000000000000095505f935083925061380d915050565b855b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018051908a1160015f9290921a9190911b660100000000000016151516600103613517577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016134aa565b81811461356e575f8061352a8484614339565b90925090507fffffffff0000000000000000000000000000000000000000000000000000000082161561356a575097505f955085945061380d9350505050565b9350505b5f8312156135a957507f7bfa48af0000000000000000000000000000000000000000000000000000000096505f945084935061380d92505050565b83156135b557825f0392505b80820394505f8513156135f557507f013b2aaa0000000000000000000000000000000000000000000000000000000096505f945084935061380d92505050565b855f03613604578295506136b6565b5f859003604381111561364557507f32b8b8be0000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b600a0a8681025f8883838161365c5761365c614974565b0514159050601b82900b82141581806136725750805b156136ae57507f32b8b8be000000000000000000000000000000000000000000000000000000009a505f985088975061380d9650505050505050565b505084019650505b50505b84516c2000000020000000000000000060015f9290921a9190911b1615158786101680156137fe57600190950194856136f9818a65200000000000614310565b96508661370f818b6703ff000000000000614310565b975080880361374c57507f013b2aaa0000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b505f80613759838a614339565b90925090507fffffffff00000000000000000000000000000000000000000000000000000000821615613799575097505f955085945061380d9350505050565b9250508482015f831380156137ad57508581125b806137c157505f831280156137c157508581135b156137fa57507fd556b1110000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b9450505b845f03613809575f93505b5050505b92959194509250565b5f601b83900b831483838261387a577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000086051561385a57620186a0860595506005850194505b8586601b0b1461387557600a8605955084600101945061385a565b613890565b855f0361389057505f9250600191506106ad9050565b848560030b146138ec575f8512156138b057505f92508291506106ad9050565b6040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b50507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841660e084901b1791509250929050565b5f808060ff841681037f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86111561396757600a860460018201600a88065f1493509350935050613971565b8593509150600190505b9250925092565b5f805f837ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc036139b057508391505f90506001613971565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc841215613a3e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb0841215613a0f57505f9150508215156001613971565b5f846004015f03600a0a90505f818781613a2b57613a2b614974565b0594505080840286141592509050613971565b5f8412613a5357505f91508190506001613971565b50505060048101600a0a82025f6001613971565b5f80806064613a79600a612328614c39565b613a86600a612328614c39565b613a91906002614dc6565b613a9c906001614da5565b613aa69190614da5565b613ab09190614da5565b9050613af4565b5f8052600280600a8504028301601e833c5f80516107d0840193505f80526001600a8606600a6064880402018501601f853c5f5101949350505050565b613aff858288613ab7565b92508315611b4d57613b15600186018288613ab7565b915050935093915050565b5f80888803613b33575083905081613bb1565b5f805f80613b438c8b8f8d61304a565b915091505f80613b558a8a8d8c61304a565b91509150613b6584848484611cd5565b8096508197505050505050505f80613b7f8b8b8f8d61304a565b915091505f80613b9186868686611df4565b915091505f80613ba384848f8e6130d0565b909a50985050505050505050505b97509795505050505050565b5f805f805f613bcc8787613f27565b92509250925080612fec576040517f05e51ecb00000000000000000000000000000000000000000000000000000000815260048101889052602481018790526044016108ce565b5f80613c22600a612328614c39565b613c2d906002614dc6565b613c38906001614da5565b90505f613c48600a612328614c39565b90506002600a8504026001015f8052600281601e883c505f51617fff81169350618000811615613c7757918101915b505f80526001600a8506600a6064870402018301601f873c50505f510192915050565b5f80821215613cf7577f80000000000000000000000000000000000000000000000000000000000000008203613cf157507f8000000000000000000000000000000000000000000000000000000000000000919050565b505f0390565b5090565b919050565b5f807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83850993909202808410938190039390930393915050565b5f805f613d488686613d00565b91509150815f03613d6c57838181613d6257613d62614974565b0492505050610695565b838210613db6576040517f6c59da120000000000000000000000000000000000000000000000000000000081526004810187905260248101869052604481018590526064016108ce565b5f84868809600186198101871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103025f82900382900490920185841190960395909502919093039390930492909217029150509392505050565b5f805f8587181215613eea577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613ed757613e7f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001614da5565b8403613eaf57507f800000000000000000000000000000000000000000000000000000000000000090508161240f565b613eba600a85614c39565b613ec390614c09565b613ece8460016149f4565b9150915061240f565b613ee084614c09565b839150915061240f565b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613f1d57613ec3600a85614c39565b508290508161240f565b5f805f845f03613f3f57505f91508190506001613971565b7f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee800000000000000000085055f03614153576f4b3b4ca85a86c47a098a2240000000008505158015613fa857507f80000000000000000000000000000000000000000000000000000000000000268412155b15613fc9576f4b3b4ca85a86c47a098a224000000000850294506026840393505b7728c87cb5c89a2571ebfdcb54864ada834a00000000000000850515801561401157507f80000000000000000000000000000000000000000000000000000000000000138412155b1561402a57678ac7230489e80000850294506013840393505b7b097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000850515801561407657507f800000000000000000000000000000000000000000000000000000000000000a8412155b1561408c576402540be40085029450600a840393505b7e3899162693736ac531a5a58f1fbb4b746504382ca7e400000000000000000085051580156140db57507f80000000000000000000000000000000000000000000000000000000000000028412155b156140f15760648502945060028403935061408c565b7f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000850515801561414157507f80000000000000000000000000000000000000000000000000000000000000018412155b1561415357600a850294506001840393505b600a8086029081058614801561418957507f80000000000000000000000000000000000000000000000000000000000000018512155b15614198578095506001850394505b50939492935050507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000008305151590565b60605f82126141e55760405180602001604052805f81525061421c565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b61422d60ff84901d80850118614254565b60405160200161423e929190614db8565b6040516020818303038152906040529050919050565b60605f61426083614463565b60010190505f8167ffffffffffffffff81111561427f5761427f614855565b6040519080825280601f01601f1916602001820160405280156142a9576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846142b357509392505050565b5f5b5f82600186515f1a1b1611838510161561433157600184019350614312565b509192915050565b81515f90819065200000000000600191831a9190911b161515838510168085019082806143668488614544565b90925090507fffffffff000000000000000000000000000000000000000000000000000000008216156143a1575093505f92506106ad915050565b825f03614404577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116143d5575f6143f7565b7f0fdc2635000000000000000000000000000000000000000000000000000000005b955093506106ad92505050565b7f80000000000000000000000000000000000000000000000000000000000000008111614431575f614453565b7f0fdc2635000000000000000000000000000000000000000000000000000000005b95505f0393505050509250929050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106144ab577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106144d7576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106144f557662386f26fc10000830492506010015b6305f5e100831061450d576305f5e100830492506008015b612710831061452157612710830492506004015b60648310614533576064830492506002015b600a83106106845760010192915050565b5f8082841061457757507f34bd20690000000000000000000000000000000000000000000000000000000090505f6106ad565b835f036145b0576040517fda6966d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60305f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501815b8782101580156145e85750604d83105b1561462b57815160018401937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90930192600a0a5f9190911a85900302016145d8565b8782106147515781515f1a849003600181111561467357507f0fdc26350000000000000000000000000000000000000000000000000000000095505f94506106ad9350505050565b600a84900a81028281018311156146b657507f0fdc26350000000000000000000000000000000000000000000000000000000096505f95506106ad945050505050565b9190910190507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101905b8782106147515781515f1a6030811461472657507f0fdc26350000000000000000000000000000000000000000000000000000000095505f94506106ad9350505050565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101906146e2565b5f9890975095505050505050565b5f6020828403121561476f575f80fd5b5035919050565b5f8060408385031215614787575f80fd5b50508035926020909101359150565b803560ff81168114613cfb575f80fd5b5f80604083850312156147b7575f80fd5b823591506147c760208401614796565b90509250929050565b5f80604083850312156147e1575f80fd5b82359150602083013580151581146147f7575f80fd5b809150509250929050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215614892575f80fd5b813567ffffffffffffffff808211156148a9575f80fd5b818401915084601f8301126148bc575f80fd5b8135818111156148ce576148ce614855565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561491457614914614855565b8160405282815287602084870101111561492c575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f805f6060848603121561495d575f80fd5b505081359360208301359350604090920135919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181035f8312801583831316838312821617156149ed576149ed6149a1565b5092915050565b8082018281125f831280158216821582161715614a1357614a136149a1565b505092915050565b8082025f82127f800000000000000000000000000000000000000000000000000000000000000084141615614a5257614a526149a1565b8181058314821517610684576106846149a1565b600181815b80851115614abf57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115614aa557614aa56149a1565b80851615614ab257918102915b93841c9390800290614a6b565b509250929050565b5f82614ad557506001610684565b81614ae157505f610684565b8160018114614af75760028114614b0157614b1d565b6001915050610684565b60ff841115614b1257614b126149a1565b50506001821b610684565b5060208310610133831016604e8410600b8410161715614b40575081810a610684565b614b4a8383614a66565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115614b7c57614b7c6149a1565b029392505050565b5f6106958383614ac7565b5f82614b9d57614b9d614974565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615614bf157614bf16149a1565b500590565b5f82614c0457614c04614974565b500790565b5f7f80000000000000000000000000000000000000000000000000000000000000008203613cf157613cf16149a1565b5f82614c4757614c47614974565b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614c7c57614c7c6149a1565b5060010190565b5f81518060208401855e5f93019283525090919050565b5f614ca58284614c83565b7f300000000000000000000000000000000000000000000000000000000000000081526001019392505050565b7f2e0000000000000000000000000000000000000000000000000000000000000081525f614d0c614d066001840186614c83565b84614c83565b949350505050565b7f650000000000000000000000000000000000000000000000000000000000000081525f6106956001830184614c83565b5f610a29614d06614d5f614d59858a614c83565b88614c83565b86614c83565b81810381811115610684576106846149a1565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820180821115610684576106846149a1565b5f614d0c614d068386614c83565b8082028115828204841417610684576106846149a156" - }, - "deployedBytecode": { - "object": "0x608060405234801561000f575f80fd5b506004361061029d575f3560e01c806381f7e2f511610171578063cde72ef3116100d2578063dd64691711610088578063e5526ecd1161006e578063e5526ecd1461062e578063e75f991f14610641578063ffae15ba14610654575f80fd5b8063dd64691714610608578063e0db58881461061b575f80fd5b8063d1de592a116100b8578063d1de592a146105bb578063d35273a7146105ce578063d3d6ffa8146105f5575f80fd5b8063cde72ef314610582578063d102b4d3146105a8575f80fd5b8063a19684b711610127578063bc1b392d1161010d578063bc1b392d1461050b578063bc62d8d814610511578063cb09682b1461055c575f80fd5b8063a19684b7146104d2578063a90d041a146104f8575f80fd5b806396ce1ec71161015757806396ce1ec7146104885780639b4afd991461049b578063a100a3d9146104bf575f80fd5b806381f7e2f5146104625780638dc2980714610475575f80fd5b80633447c0301161021b5780635ca0e7a4116101d1578063719cd99d116101b7578063719cd99d1461042957806373bfb2831461043c57806381a822721461044f575f80fd5b80635ca0e7a4146103f0578063602c35fc14610403575f80fd5b80633b3bd868116102015780633b3bd868146103b757806341aa0080146103ca5780635b23771d146103dd575f80fd5b80633447c03014610374578063371493ce14610397575f80fd5b80631ee62f111161027057806328fa1f011161025657806328fa1f011461033b5780633004fa411461034e5780633029740014610361575f80fd5b80631ee62f11146103155780632538835014610328575f80fd5b806304327dc5146102a1578063078b665b146102c75780630b6429bc146102da578063146e82ad14610302575b5f80fd5b6102b46102af36600461475f565b61067a565b6040519081526020015b60405180910390f35b6102b46102d5366004614776565b61068a565b6102ed6102e83660046147a6565b61069c565b604080519283529015156020830152016102be565b6102b461031036600461475f565b6106b4565b6102b461032336600461475f565b6106d3565b6102b461033636600461475f565b6106f2565b6102b461034936600461475f565b610711565b6102b461035c366004614776565b61071b565b6102b461036f366004614776565b61073b565b610387610382366004614776565b610746565b60405190151581526020016102be565b6103aa6103a53660046147d0565b610751565b6040516102be9190614802565b6102b46103c53660046147a6565b61075d565b6102b46103d8366004614776565b610768565b6102b46103eb3660046147a6565b610773565b6102b46103fe36600461475f565b61077e565b7f80000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff6102b4565b6102b461043736600461475f565b610788565b61038761044a366004614776565b610792565b6102b461045d36600461475f565b61079d565b610387610470366004614776565b6107a7565b610387610483366004614776565b6107b2565b6102b4610496366004614776565b6107bd565b6102b47c090000000000000000000000000000000000000000000000000000000181565b6103aa6104cd36600461475f565b6107c8565b7f80000000000000000000000000000000000000000000000000000000000000016102b4565b6102b4610506366004614776565b610812565b5f6102b4565b61052461051f366004614882565b61081d565b604080517fffffffff0000000000000000000000000000000000000000000000000000000090931683526020830191909152016102be565b7f7fffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffff6102b4565b7f7fffffff800000000000000000000000000000000000000000000000000000006102b4565b6103876105b6366004614776565b610836565b6102b46105c9366004614776565b610841565b6102b47ffffffffc0000000000000000000000000000000000000000000000000000000181565b6102b461060336600461475f565b61084c565b61038761061636600461475f565b610856565b6102b461062936600461475f565b61087c565b6103aa61063c36600461494b565b610886565b6102ed61064f3660046147a6565b61090f565b7fffffffbe19cfc6ef4f44cf88f14500d013df534fcaad48fca1d5ca47bea26fcc6102b4565b5f6106848261091b565b92915050565b5f610695838361095d565b9392505050565b5f806106a88484610979565b915091505b9250929050565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f56109ba565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f56109e6565b5f6106848273c51a14251b0dcf0ae24a96b7153991378938f5f5610a33565b5f61068482610a66565b5f610695838373c51a14251b0dcf0ae24a96b7153991378938f5f5610aa7565b5f6106958383610d01565b5f6106958383610d63565b60606106958383610db1565b5f6106958383610e44565b5f6106958383610e5f565b5f6106958383610ea4565b5f61068482610ed7565b5f61068482610f8d565b5f6106958383611039565b5f61068482611089565b5f61069583836110ce565b5f610695838361111e565b5f610695838361116d565b6060610684827ffffffffc000000000000000000000000000000000000000000000000000000017c0900000000000000000000000000000000000000000000000000000001610886565b5f61069583836111b2565b5f805f8061082a856111bd565b90969095509350505050565b5f61069583836112ab565b5f61069583836112fa565b5f6106848261133f565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff821615610684565b5f61068482611371565b606061089283836112ab565b6108d7576040517f3be5bf9400000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044015b60405180910390fd5b5f6108e185611089565b9050610906856108f183876112ab565b806109015750610901838661111e565b610db1565b95945050505050565b5f806106a884846113b2565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d61094d82826113f2565b90925090505f6109068383611440565b5f610968838361111e565b6109725781610695565b5090919050565b5f807bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8416601b0b60e085901d6109ad8282876114a6565b9350935050509250929050565b5f610695837fffffffff0000000000000000000000000000000000000000000000000000000584610aa7565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610a198483836116b0565b90925090505f610a298383611440565b9695505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610a19848383611821565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d82610a998383611b56565b9150505f610a298284611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff848116601b0b9060e086901d908516610ae45750600191506106959050565b5f8213610b7d57815f03610b4157610afc855f6112ab565b15610b36576040517f8be82972000000000000000000000000000000000000000000000000000000008152600481018690526024016108ce565b505f91506106959050565b6040517fcceba0f100000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b610b88856001610d63565b8015610b995750610b99865f61111e565b15610ba8578592505050610695565b610bb2855f6112ab565b15610bdb57610bd2610bc38761091b565b610bcc8761133f565b86610aa7565b92505050610695565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8516601b0b60e086901d5f80610c0e8484611b56565b915091505f610c1e83855f611bbe565b905060015f8080610c558f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116601b0b9160e09190911d90565b915091505b60018510610c9c5784600116600103610c7f57610c7984848484611cd5565b90945092505b600185901c9450610c9282828484611cd5565b9092509050610c5a565b5f80610ca98f8e8e611821565b91509150610cb982828a8d611cd5565b9092509050610cc98f83836116b0565b9092509050610cda82828888611cd5565b90925090505f610cea8383611440565b9e5050505050505050505050505050509392505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d4686868686611df4565b915091505f610d558383611440565b9a9950505050505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d610da684848484612418565b979650505050505050565b60607bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d5f829003610e21576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525092505050610684565b8315610e3a57610e31828261242f565b92505050610684565b610906828261276c565b5f805f610e518585612f96565b915091506109068282612ff8565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d468686868661304a565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316601b0b60e084901d610906828286613074565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828112610f0e57509192915050565b5f80610f1a8484611b56565b915091505f84128015610f2c57508015155b15610f8257610f7d82847f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb461304a565b935091505b5f610da68385611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828112610fc457509192915050565b5f80610fd08484611b56565b91509150805f03610fe5575093949350505050565b5f811315610f8257610f7d82847f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb46130d0565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61107c84848484613200565b1315979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d828212156110c35761094d82826132d4565b5f6109068383611440565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61111184848484613200565b1215979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d61116184848484613200565b12979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d4686868686611cd5565b5f61096883836112ab565b80515f908190602084810191850101828080806111da8686613377565b929650909450925090507fffffffff0000000000000000000000000000000000000000000000000000000084165f0361129c5784830361126c575f806112208484613816565b915091508061125b57507f32b8b8be000000000000000000000000000000000000000000000000000000009a5f9a5098505050505050505050565b505f9a909950975050505050505050565b507fad384e8700000000000000000000000000000000000000000000000000000000985f98509650505050505050565b5091975f975095505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d6112ee84848484613200565b13979650505050505050565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838116601b90810b9160e086811d9291861690910b9085901d8480610d46868686866130d0565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d61094d82826132d4565b5f7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8216601b0b60e083901d826113a48383611b56565b5090505f610a298284611440565b5f805f805f6113c1878761391c565b9250925092505f806113d38585613816565b91509150818380156113e25750815b9650965050505050509250929050565b5f806106a87f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb48686611df4565b5f805f61144d8585613816565b915091508015801561145d575081155b1561149e576040517f8eba4d0700000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b509392505050565b5f805f8512156114ec576040517f4a7d166b00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b845f036114fe57505f905060016116a8565b8460ff8416850185811215611549576040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101889052602481018790526044016108ce565b5f805f8312156115b3577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb383121561158a575f8095509550505050506116a8565b825f03600a0a91508184816115a1576115a1614974565b04955050840290911491506116a89050565b5f83131561169d57604d831315611609576040517fc849483b000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905260ff881660448201526064016108ce565b82600a0a9150817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8161163e5761163e614974565b0484111561168b576040517fc849483b000000000000000000000000000000000000000000000000000000008152600481018a90526024810189905260ff881660448201526064016108ce565b50919091029250600191506116a89050565b509193506001925050505b935093915050565b5f805f8412156116ec576116c484846132d4565b90945092506116d48585856116b0565b90945092506116e384846113f2565b915091506116a8565b5f806116f88686611b56565b9092509050845f808061170b8585613978565b9194509250905061270d6127106117236001826149ce565b851461173a576117348d8686613a67565b90925090505b83156117c5575f61174c8660016149f4565b90505b80848583028161176157611761614974565b051461177857600a84059350600a8805975061174f565b6117b96117858588614a1b565b896117908785614a1b565b8f87877ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc613b20565b909d509b506117ec9050565b819b507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc9a505b5050505050866117fd84835f611bbe565b6118088860016149f4565b61181291906149f4565b94509450505050935093915050565b5f80838361182f8282613bbd565b90965094505f86136118b057855f03611874576040517f561fc7b500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f5d3fd4db00000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b5050837f161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000036118ee576118e483604c6149f4565b5f915091506116a8565b7f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000008412158061193d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb561195f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb45b5f0b8412611b1a575f805f805f8561197857604b61197b565b604c5b611985908a6149f4565b90505f80876119b2577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e10000000000000000006119d3565b7e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca0000000000000000005b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff169050808c81611a0557611a05614974565b05818102955090850193507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18019050611a3e8c82613c13565b7d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e10000000000000000000295508594508a8414611aca576123278114611aa557611a808c82600101613c13565b7d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000002611ac7565b7f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000005b94505b50611afa838b848c89897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb4613b20565b909a509850611b0b8a8a835f6130d0565b975097505050505050506116a8565b611b2485856113f2565b9095509350611b34868686611821565b9095509350611b4385856132d4565b92509250506116a8565b50935093915050565b5f805f8312611b6957508290505f6106ad565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb4831215611b9b57505f9050826106ad565b5f839003600a0a808581611bb157611bb1614974565b0794859003959350505050565b5f818303611bcd575082610695565b82821315611c1057828203604c811380611be757505f8113155b15611bf5575f915050610695565b80600a0a8581611c0757611c07614974565b05915050610695565b818303604c811380611c2257505f8113155b15611c6a576040517f1d5d6d100000000000000000000000000000000000000000000000000000000081526004810186905260248101859052604481018490526064016108ce565b600a81900a85810286828281611c8257611c82614974565b0514611ccb576040517f1d5d6d100000000000000000000000000000000000000000000000000000000081526004810188905260248101879052604481018690526064016108ce565b9250610695915050565b5f8085158415178015611ced575f92505f9150611dea565b611cf784876149f4565b91505f611d0388613c9a565b90505f611d0f87613c9a565b90505f611d1c8383613d00565b5090505f6f0785ee10d5da46d900f436a000000000821115611d51576f0785ee10d5da46d900f436a000000000820491506025015b670de0b6b3a7640000821115611d7257670de0b6b3a7640000820491506012015b633b9aca00821115611d8b57633b9aca00820491506009015b612710821115611da057612710820491506004015b8115611db457600a82049150600101611da0565b611dbe81876149f4565b9550611de08b8a611dda8787611dd587600a614b84565b613d3b565b89613e20565b9097509550505050505b5094509492505050565b5f80835f03611e39576040517f7a97930f00000000000000000000000000000000000000000000000000000000815260048101879052602481018690526044016108ce565b855f03611e4a57505f90508061240f565b5f805f80611e588a8a613f27565b919b5099509150611e698888613f27565b919950975090505f611e7a8b613c9a565b90505f611e868a613c9a565b90507f161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000604c818310156122a3578415611ee457507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000009050604b612262565b6f4b3b4ca85a86c47a098a22400000000083101561201057678ac7230489e80000831015611f74576402540be400831015611f4257620186a0831015611f325750620186a0905060056121eb565b506402540be4009050600a6121eb565b655af3107a4000831015611f615750655af3107a40009050600e6121eb565b50678ac7230489e80000905060136121eb565b6b204fce5e3e25026110000000831015611fc65769152d02c7e14af6800000831015611faf575069152d02c7e14af6800000905060176121eb565b506b204fce5e3e250261100000009050601c6121eb565b6d314dc6448d9338c15b0a00000000831015611ff557506d314dc6448d9338c15b0a00000000905060216121eb565b506f4b3b4ca85a86c47a098a224000000000905060266121eb565b780197d4df19d605767337e9f14d3eec8920e4000000000000008310156121085773af298d050e4395d69670b12b7f410000000000008310156120a3577172cb5bd86321e38cb6ce6682e8000000000083101561208457507172cb5bd86321e38cb6ce6682e800000000009050602b6121eb565b5073af298d050e4395d69670b12b7f41000000000000905060306121eb565b76010b46c6cdd6e3e0828f4db456ff0c8ea00000000000008310156120e4575076010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000905060356121eb565b50780197d4df19d605767337e9f14d3eec8920e4000000000000009050603a6121eb565b7c03b58e88c75313ec9d329eaaa18fb92f75215b1710000000000000000083101561219e577a026e4d30eccc3215dd8f3157d27e23acbdcfe6800000000000000083101561217657507a026e4d30eccc3215dd8f3157d27e23acbdcfe680000000000000009050603f6121eb565b507c03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000905060446121eb565b7e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca0000000000000000008310156121eb57507e05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000905060495b81831161221f57600a820491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016121eb565b815f03612262576040517f05e51ecb000000000000000000000000000000000000000000000000000000008152600481018d9052602481018c90526044016108ce565b856122a3576040517f05e51ecb000000000000000000000000000000000000000000000000000000008152600481018f9052602481018e90526044016108ce565b807f8000000000000000000000000000000000000000000000000000000000000000018d126122d657808d039c50612349565b7f80000000000000000000000000000000000000000000000000000000000000009c90038c015f81131561234957807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038b1361233657998a0199612349565b5f8099509950505050505050505061240f565b5f808e12801561235857505f8c135b15612395577f80000000000000000000000000000000000000000000000000000000000000008e01808d1361238d575f612391565b808d035b9150505b8b818f010397506123b28f8e6123ac888789613d3b565b8b613e20565b90995097505f8113156123fc57604c8113156123dc575f809a509a5050505050505050505061240f565b80600a0a89816123ee576123ee614974565b059850885f036123fc575f97505b5096985094965061240f95505050505050565b94509492505050565b5f61242585858585613200565b1495945050505050565b60608161243c8482613bbd565b90945092505f8061246d7f161bcca7119915b50764b4abe86529797775a5f171951000000000000000000087614b8f565b1561249d57507f161bcca7119915b50764b4abe86529797775a5f17195100000000000000000009050604c6124c4565b507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000009050604b5b5f6124cf8388614b8f565b90505f6124dc8489614bf6565b90505f808312156124f6575060016124f383614c09565b92505b5f82121561250d5750600161250a82614c09565b91505b60408051602081019091525f81528215612616575f8061252e600a89614c39565b90505b61253b8186614b8f565b5f036125605761254c600a82614c39565b90508161255881614c4c565b925050612531565b60408051602081019091525f8082525b838110156125c157816040516020016125899190614c9a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190529150600101612570565b505b6125ce600a87614bf6565b5f036125e6576125df600a87614b8f565b95506125c3565b806125f0876141c8565b604051602001612601929190614cd2565b60405160208183030381529060405293505050505b5f612620856141c8565b90505f61262d878c6149f4565b9050637fffffff81138061266057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000000081125b1561269a576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018a90526024016108ce565b5f81156126ce576126aa826141c8565b6040516020016126ba9190614d14565b6040516020818303038152906040526126de565b60405180602001604052805f8152505b90505f856126fa5760405180602001604052805f815250612731565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b90508084868460405160200161274a9493929190614d45565b6040516020818303038152906040529b50505050505050505050505092915050565b60606103e882138061278757506127846103e8614c09565b82125b156127c1576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018390526024016108ce565b5f8084129081156127dc576127d585614c09565b90506127df565b50835b5f8413156128a2578360448110612825576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018690526024016108ce565b7b7fffffffffffffffffffffffffffffffffffffffffffffffffffffff5f5b8281101561286157612857600a83614c39565b9150600101612844565b508083111561289f576040517fe44c72b0000000000000000000000000000000000000000000000000000000008152600481018790526024016108ce565b50505b5f6128ac82614254565b80519091505f5b818110801561292f575082816128ca600185614d65565b6128d49190614d65565b815181106128e4576128e4614d78565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f3000000000000000000000000000000000000000000000000000000000000000145b15612946578061293e81614c4c565b9150506128b3565b5f6129518284614d65565b90505f61295e838a6149f4565b90505f8761297a5760405180602001604052805f8152506129b1565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b90505f8212612b2b57815f6129c68286614da5565b67ffffffffffffffff8111156129de576129de614855565b6040519080825280601f01601f191660200182016040528015612a08576020820181803683370190505b5090505f5b85811015612a7a57888181518110612a2757612a27614d78565b602001015160f81c60f81b828281518110612a4457612a44614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612a0d565b505f5b82811015612af7577f300000000000000000000000000000000000000000000000000000000000000082612ab18389614da5565b81518110612ac157612ac1614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612a7d565b508281604051602001612b0b929190614db8565b6040516020818303038152906040529a5050505050505050505050610684565b5f612b3583614c09565b905080841115612d4c575f612b4a8286614d65565b90505f612b58866001614da5565b67ffffffffffffffff811115612b7057612b70614855565b6040519080825280601f01601f191660200182016040528015612b9a576020820181803683370190505b5090505f5b82811015612c0c57898181518110612bb957612bb9614d78565b602001015160f81c60f81b828281518110612bd657612bd6614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612b9f565b507f2e00000000000000000000000000000000000000000000000000000000000000818381518110612c4057612c40614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b83811015612d175789612c838285614da5565b81518110612c9357612c93614d78565b01602001517fff00000000000000000000000000000000000000000000000000000000000000168282612cc7866001614da5565b612cd19190614da5565b81518110612ce157612ce1614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612c70565b508381604051602001612d2b929190614db8565b6040516020818303038152906040529b505050505050505050505050610684565b5f612d578583614d65565b90505f85612d66836002614da5565b612d709190614da5565b67ffffffffffffffff811115612d8857612d88614855565b6040519080825280601f01601f191660200182016040528015612db2576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f81518110612de857612de8614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f2e0000000000000000000000000000000000000000000000000000000000000081600181518110612e4a57612e4a614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b82811015612ef5577f300000000000000000000000000000000000000000000000000000000000000082612eaf836002614da5565b81518110612ebf57612ebf614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612e7a565b505f5b86811015612d1757898181518110612f1257612f12614d78565b01602001517fff00000000000000000000000000000000000000000000000000000000000000168282612f46866002614da5565b612f509190614da5565b81518110612f6057612f60614d78565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600101612ef8565b5f805f805f612fa5878761391c565b92509250925080612fec576040517fc471796600000000000000000000000000000000000000000000000000000000815260048101849052602481018390526044016108ce565b50909590945092505050565b5f805f6130058585613816565b915091508061149e576040517f22c9f7bb00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044016108ce565b5f8061305684846132d4565b9094509250613067868686866130d0565b9150915094509492505050565b5f805f6130828686866114a6565b91509150806130c7576040517f05e4767800000000000000000000000000000000000000000000000000000000815260048101879052602481018690526044016108ce565b50949350505050565b5f80851584151780156130fc57865f036130f0578484925092505061240f565b8686925092505061240f565b6131068787613bbd565b90975095506131158585613bbd565b909550935085841315613129579395929492935b838603604c81111561314257878793509350505061240f565b80600a0a868161315457613154614974565b0595505086850180881860ff90811c151589881890911c151680156131ef57877f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff036131d6576040517fd556b111000000000000000000000000000000000000000000000000000000008152600481018a9052602481018990526044016108ce565b600a9687900596909805860197600197909701966131f3565b8198505b5096979596505050505050565b5f8085158415178187128286121817858414178015613225578685925092505061240f565b505f85841315613239575092949193919260015b8386035f8112604c821317801561326c57821561325e575f899450945050505061240f565b885f9450945050505061240f565b600a82900a8981028a82828161328457613284614974565b05146132b05784156132a0575f8b96509650505050505061240f565b8a5f96509650505050505061240f565b84156132c557889650945061240f9350505050565b955087945061240f9350505050565b5f807f8000000000000000000000000000000000000000000000000000000000000000840361336d577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8303613360576040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101859052602481018490526044016108ce565b600a840593508260010192505b50505f9190910391565b5f82818061338c838665200000000000614310565b925085831415836133a681886703ff000000000000614310565b94508085036133e057507f34bd20690000000000000000000000000000000000000000000000000000000094505f925082915061380d9050565b5f806133ec8a88614339565b90925090507fffffffff0000000000000000000000000000000000000000000000000000000082161561342a575095505f935083925061380d915050565b86519095506540000000000060015f9290921a9190911b1615158887101691505080156136b957506001909301925f8461346d81896703ff000000000000614310565b95508086036134a857507f7bfa48af0000000000000000000000000000000000000000000000000000000095505f935083925061380d915050565b855b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018051908a1160015f9290921a9190911b660100000000000016151516600103613517577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016134aa565b81811461356e575f8061352a8484614339565b90925090507fffffffff0000000000000000000000000000000000000000000000000000000082161561356a575097505f955085945061380d9350505050565b9350505b5f8312156135a957507f7bfa48af0000000000000000000000000000000000000000000000000000000096505f945084935061380d92505050565b83156135b557825f0392505b80820394505f8513156135f557507f013b2aaa0000000000000000000000000000000000000000000000000000000096505f945084935061380d92505050565b855f03613604578295506136b6565b5f859003604381111561364557507f32b8b8be0000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b600a0a8681025f8883838161365c5761365c614974565b0514159050601b82900b82141581806136725750805b156136ae57507f32b8b8be000000000000000000000000000000000000000000000000000000009a505f985088975061380d9650505050505050565b505084019650505b50505b84516c2000000020000000000000000060015f9290921a9190911b1615158786101680156137fe57600190950194856136f9818a65200000000000614310565b96508661370f818b6703ff000000000000614310565b975080880361374c57507f013b2aaa0000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b505f80613759838a614339565b90925090507fffffffff00000000000000000000000000000000000000000000000000000000821615613799575097505f955085945061380d9350505050565b9250508482015f831380156137ad57508581125b806137c157505f831280156137c157508581135b156137fa57507fd556b1110000000000000000000000000000000000000000000000000000000097505f955085945061380d9350505050565b9450505b845f03613809575f93505b5050505b92959194509250565b5f601b83900b831483838261387a577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000086051561385a57620186a0860595506005850194505b8586601b0b1461387557600a8605955084600101945061385a565b613890565b855f0361389057505f9250600191506106ad9050565b848560030b146138ec575f8512156138b057505f92508291506106ad9050565b6040517fd556b11100000000000000000000000000000000000000000000000000000000815260048101839052602481018290526044016108ce565b50507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841660e084901b1791509250929050565b5f808060ff841681037f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86111561396757600a860460018201600a88065f1493509350935050613971565b8593509150600190505b9250925092565b5f805f837ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc036139b057508391505f90506001613971565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc841215613a3e577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffb0841215613a0f57505f9150508215156001613971565b5f846004015f03600a0a90505f818781613a2b57613a2b614974565b0594505080840286141592509050613971565b5f8412613a5357505f91508190506001613971565b50505060048101600a0a82025f6001613971565b5f80806064613a79600a612328614c39565b613a86600a612328614c39565b613a91906002614dc6565b613a9c906001614da5565b613aa69190614da5565b613ab09190614da5565b9050613af4565b5f8052600280600a8504028301601e833c5f80516107d0840193505f80526001600a8606600a6064880402018501601f853c5f5101949350505050565b613aff858288613ab7565b92508315611b4d57613b15600186018288613ab7565b915050935093915050565b5f80888803613b33575083905081613bb1565b5f805f80613b438c8b8f8d61304a565b915091505f80613b558a8a8d8c61304a565b91509150613b6584848484611cd5565b8096508197505050505050505f80613b7f8b8b8f8d61304a565b915091505f80613b9186868686611df4565b915091505f80613ba384848f8e6130d0565b909a50985050505050505050505b97509795505050505050565b5f805f805f613bcc8787613f27565b92509250925080612fec576040517f05e51ecb00000000000000000000000000000000000000000000000000000000815260048101889052602481018790526044016108ce565b5f80613c22600a612328614c39565b613c2d906002614dc6565b613c38906001614da5565b90505f613c48600a612328614c39565b90506002600a8504026001015f8052600281601e883c505f51617fff81169350618000811615613c7757918101915b505f80526001600a8506600a6064870402018301601f873c50505f510192915050565b5f80821215613cf7577f80000000000000000000000000000000000000000000000000000000000000008203613cf157507f8000000000000000000000000000000000000000000000000000000000000000919050565b505f0390565b5090565b919050565b5f807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83850993909202808410938190039390930393915050565b5f805f613d488686613d00565b91509150815f03613d6c57838181613d6257613d62614974565b0492505050610695565b838210613db6576040517f6c59da120000000000000000000000000000000000000000000000000000000081526004810187905260248101869052604481018590526064016108ce565b5f84868809600186198101871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103025f82900382900490920185841190960395909502919093039390930492909217029150509392505050565b5f805f8587181215613eea577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613ed757613e7f7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001614da5565b8403613eaf57507f800000000000000000000000000000000000000000000000000000000000000090508161240f565b613eba600a85614c39565b613ec390614c09565b613ece8460016149f4565b9150915061240f565b613ee084614c09565b839150915061240f565b7f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613f1d57613ec3600a85614c39565b508290508161240f565b5f805f845f03613f3f57505f91508190506001613971565b7f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee800000000000000000085055f03614153576f4b3b4ca85a86c47a098a2240000000008505158015613fa857507f80000000000000000000000000000000000000000000000000000000000000268412155b15613fc9576f4b3b4ca85a86c47a098a224000000000850294506026840393505b7728c87cb5c89a2571ebfdcb54864ada834a00000000000000850515801561401157507f80000000000000000000000000000000000000000000000000000000000000138412155b1561402a57678ac7230489e80000850294506013840393505b7b097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000850515801561407657507f800000000000000000000000000000000000000000000000000000000000000a8412155b1561408c576402540be40085029450600a840393505b7e3899162693736ac531a5a58f1fbb4b746504382ca7e400000000000000000085051580156140db57507f80000000000000000000000000000000000000000000000000000000000000028412155b156140f15760648502945060028403935061408c565b7f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000850515801561414157507f80000000000000000000000000000000000000000000000000000000000000018412155b1561415357600a850294506001840393505b600a8086029081058614801561418957507f80000000000000000000000000000000000000000000000000000000000000018512155b15614198578095506001850394505b50939492935050507f0235fadd81c2822bb3f07877973d50f28bf22a31be8ee80000000000000000008305151590565b60605f82126141e55760405180602001604052805f81525061421c565b6040518060400160405280600181526020017f2d000000000000000000000000000000000000000000000000000000000000008152505b61422d60ff84901d80850118614254565b60405160200161423e929190614db8565b6040516020818303038152906040529050919050565b60605f61426083614463565b60010190505f8167ffffffffffffffff81111561427f5761427f614855565b6040519080825280601f01601f1916602001820160405280156142a9576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846142b357509392505050565b5f5b5f82600186515f1a1b1611838510161561433157600184019350614312565b509192915050565b81515f90819065200000000000600191831a9190911b161515838510168085019082806143668488614544565b90925090507fffffffff000000000000000000000000000000000000000000000000000000008216156143a1575093505f92506106ad915050565b825f03614404577f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116143d5575f6143f7565b7f0fdc2635000000000000000000000000000000000000000000000000000000005b955093506106ad92505050565b7f80000000000000000000000000000000000000000000000000000000000000008111614431575f614453565b7f0fdc2635000000000000000000000000000000000000000000000000000000005b95505f0393505050509250929050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106144ab577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106144d7576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106144f557662386f26fc10000830492506010015b6305f5e100831061450d576305f5e100830492506008015b612710831061452157612710830492506004015b60648310614533576064830492506002015b600a83106106845760010192915050565b5f8082841061457757507f34bd20690000000000000000000000000000000000000000000000000000000090505f6106ad565b835f036145b0576040517fda6966d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60305f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8501815b8782101580156145e85750604d83105b1561462b57815160018401937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90930192600a0a5f9190911a85900302016145d8565b8782106147515781515f1a849003600181111561467357507f0fdc26350000000000000000000000000000000000000000000000000000000095505f94506106ad9350505050565b600a84900a81028281018311156146b657507f0fdc26350000000000000000000000000000000000000000000000000000000096505f95506106ad945050505050565b9190910190507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101905b8782106147515781515f1a6030811461472657507f0fdc26350000000000000000000000000000000000000000000000000000000095505f94506106ad9350505050565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909101906146e2565b5f9890975095505050505050565b5f6020828403121561476f575f80fd5b5035919050565b5f8060408385031215614787575f80fd5b50508035926020909101359150565b803560ff81168114613cfb575f80fd5b5f80604083850312156147b7575f80fd5b823591506147c760208401614796565b90509250929050565b5f80604083850312156147e1575f80fd5b82359150602083013580151581146147f7575f80fd5b809150509250929050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f60208284031215614892575f80fd5b813567ffffffffffffffff808211156148a9575f80fd5b818401915084601f8301126148bc575f80fd5b8135818111156148ce576148ce614855565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561491457614914614855565b8160405282815287602084870101111561492c575f80fd5b826020860160208301375f928101602001929092525095945050505050565b5f805f6060848603121561495d575f80fd5b505081359360208301359350604090920135919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b8181035f8312801583831316838312821617156149ed576149ed6149a1565b5092915050565b8082018281125f831280158216821582161715614a1357614a136149a1565b505092915050565b8082025f82127f800000000000000000000000000000000000000000000000000000000000000084141615614a5257614a526149a1565b8181058314821517610684576106846149a1565b600181815b80851115614abf57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115614aa557614aa56149a1565b80851615614ab257918102915b93841c9390800290614a6b565b509250929050565b5f82614ad557506001610684565b81614ae157505f610684565b8160018114614af75760028114614b0157614b1d565b6001915050610684565b60ff841115614b1257614b126149a1565b50506001821b610684565b5060208310610133831016604e8410600b8410161715614b40575081810a610684565b614b4a8383614a66565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115614b7c57614b7c6149a1565b029392505050565b5f6106958383614ac7565b5f82614b9d57614b9d614974565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615614bf157614bf16149a1565b500590565b5f82614c0457614c04614974565b500790565b5f7f80000000000000000000000000000000000000000000000000000000000000008203613cf157613cf16149a1565b5f82614c4757614c47614974565b500490565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614c7c57614c7c6149a1565b5060010190565b5f81518060208401855e5f93019283525090919050565b5f614ca58284614c83565b7f300000000000000000000000000000000000000000000000000000000000000081526001019392505050565b7f2e0000000000000000000000000000000000000000000000000000000000000081525f614d0c614d066001840186614c83565b84614c83565b949350505050565b7f650000000000000000000000000000000000000000000000000000000000000081525f6106956001830184614c83565b5f610a29614d06614d5f614d59858a614c83565b88614c83565b86614c83565b81810381811115610684576106846149a1565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80820180821115610684576106846149a1565b5f614d0c614d068386614c83565b8082028115828204841417610684576106846149a156" - } -} \ No newline at end of file diff --git a/crates/float/abi/TestDecimalFloat.json b/crates/float/abi/TestDecimalFloat.json deleted file mode 100644 index 115936d3..00000000 --- a/crates/float/abi/TestDecimalFloat.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "abi": [ - { - "type": "function", - "name": "packLossless", - "inputs": [ - { - "name": "coefficient", - "type": "int224", - "internalType": "int224" - }, - { - "name": "exponent", - "type": "int32", - "internalType": "int32" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "Float" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "unpack", - "inputs": [ - { - "name": "float", - "type": "bytes32", - "internalType": "Float" - } - ], - "outputs": [ - { - "name": "", - "type": "int256", - "internalType": "int256" - }, - { - "name": "", - "type": "int256", - "internalType": "int256" - } - ], - "stateMutability": "pure" - }, - { - "type": "error", - "name": "CoefficientOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - }, - { - "type": "error", - "name": "ExponentOverflow", - "inputs": [ - { - "name": "signedCoefficient", - "type": "int256", - "internalType": "int256" - }, - { - "name": "exponent", - "type": "int256", - "internalType": "int256" - } - ] - } - ], - "bytecode": { - "object": "0x6080604052348015600e575f80fd5b506102848061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c806371516dd914610038578063b702fecd1461008c575b5f80fd5b61007261004636600461022b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116601b0b9160e09190911d90565b604080519283526020830191909152015b60405180910390f35b61009f61009a366004610242565b6100ad565b604051908152602001610083565b5f6100be83601b0b8360030b6100c5565b9392505050565b5f805f6100d28585610124565b915091508061011c576040517f22c9f7bb00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044015b60405180910390fd5b509392505050565b5f601b83900b8314838382610188577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000086051561016857620186a0860595506005850194505b8586601b0b1461018357600a86059550846001019450610168565b61019e565b855f0361019e57505f9250600191506102249050565b848560030b146101fa575f8512156101be57505f92508291506102249050565b6040517fd556b1110000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610113565b50507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841660e084901b1791505b9250929050565b5f6020828403121561023b575f80fd5b5035919050565b5f8060408385031215610253575f80fd5b823580601b0b8114610263575f80fd5b91506020830135600381900b8114610279575f80fd5b80915050925092905056" - }, - "deployedBytecode": { - "object": "0x608060405234801561000f575f80fd5b5060043610610034575f3560e01c806371516dd914610038578063b702fecd1461008c575b5f80fd5b61007261004636600461022b565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8116601b0b9160e09190911d90565b604080519283526020830191909152015b60405180910390f35b61009f61009a366004610242565b6100ad565b604051908152602001610083565b5f6100be83601b0b8360030b6100c5565b9392505050565b5f805f6100d28585610124565b915091508061011c576040517f22c9f7bb00000000000000000000000000000000000000000000000000000000815260048101869052602481018590526044015b60405180910390fd5b509392505050565b5f601b83900b8314838382610188577d90e40fbeea1d3a4abc8955e946fe31cdcf66f634e100000000000000000086051561016857620186a0860595506005850194505b8586601b0b1461018357600a86059550846001019450610168565b61019e565b855f0361019e57505f9250600191506102249050565b848560030b146101fa575f8512156101be57505f92508291506102249050565b6040517fd556b1110000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610113565b50507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff841660e084901b1791505b9250929050565b5f6020828403121561023b575f80fd5b5035919050565b5f8060408385031215610253575f80fd5b823580601b0b8114610263575f80fd5b91506020830135600381900b8114610279575f80fd5b80915050925092905056" - } -} \ No newline at end of file diff --git a/crates/float/proptest-regressions/fuzz_ops.txt b/crates/float/proptest-regressions/fuzz_ops.txt deleted file mode 100644 index 6ecefabe..00000000 --- a/crates/float/proptest-regressions/fuzz_ops.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Seeds for failure cases proptest has generated in the past. It is -# automatically read and these particular cases re-run before any -# novel cases are generated. -# -# It is recommended to check this file in to source control so that -# everyone who runs the test benefits from these saved cases. -cc 285e4d87fcb0e9c1757a0ddf5aa8199fbd17d38208bd0b5ef2288d059eb3934e # shrinks to a = Float(0xffffffff000000000000000000000000000000000000000000009a9939ef8c94) -cc cb8c50af037a017c4a91ac6dede4b4fc2e1372a1de1290ac8fafc546772613d0 # shrinks to a = Float(0xfffffffeffffffffffffffffffffffffffffffffffffffffffffba63064a71d9) diff --git a/crates/float/proptest-regressions/lib.txt b/crates/float/proptest-regressions/lib.txt deleted file mode 100644 index 7070cb90..00000000 --- a/crates/float/proptest-regressions/lib.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Seeds for failure cases proptest has generated in the past. It is -# automatically read and these particular cases re-run before any -# novel cases are generated. -# -# It is recommended to check this file in to source control so that -# everyone who runs the test benefits from these saved cases. -cc 664cbb4a3416dcc12fe1196bdf33bdf3f9e1403c6446f0516dc704da23be5723 # shrinks to a = Float(0x0000000000000000000000000000000000000000000000000000000000000000), b = Float(0xffffffff00000000000000000000000000000000000000000000000000000001) -cc 3fd2457aad2f1f4960353eb70458c7806f645c48898d3d336369b396c6cd13e1 # shrinks to a = Float(0x000000000000000000000000000000000000000000000000534a0c3580000000), b = Float(0x00000000000000000000000000000000000000000000000008e5c21900000000) diff --git a/crates/float/src/error.rs b/crates/float/src/error.rs deleted file mode 100644 index 9e86ee24..00000000 --- a/crates/float/src/error.rs +++ /dev/null @@ -1,284 +0,0 @@ -use crate::DecimalFloat; -use alloy::hex::FromHexError; -use alloy::primitives::{Bytes, FixedBytes}; -use alloy::sol_types::SolError; -use revm::context::result::{EVMError, HaltReason, Output, SuccessReason}; -use std::thread::AccessError; -use thiserror::Error; -use wasm_bindgen_utils::prelude::js_sys::{Error as JsError, RangeError}; -use wasm_bindgen_utils::result::WasmEncodedError; - -#[derive(Debug, Error)] -pub enum FloatError { - #[error("EVM error: {0}")] - Evm(#[from] EVMError), - #[error("Float execution reverted with output: {0}")] - Revert(Bytes), - #[error("Float execution halted with reason: {0:?}")] - Halt(HaltReason), - #[error("Execution ended for non-return reason. Reason: {0:?}. Output: {1:?}")] - UnexpectedSuccess(SuccessReason, Output), - #[error(transparent)] - AlloySolTypes(#[from] alloy::sol_types::Error), - #[error("Decimal Float error: {0:?}")] - DecimalFloat(Box), - #[error("Decimal Float error selector: {0:?}")] - DecimalFloatSelector(Result>), - #[error(transparent)] - Access(#[from] AccessError), - #[error("Invalid hex string: {0}")] - InvalidHex(String), - #[error(transparent)] - AlloyFromHexError(#[from] FromHexError), - #[error(transparent)] - AlloyParseError(#[from] alloy::primitives::ruint::ParseError), - #[error(transparent)] - AlloyParseSignedError(#[from] alloy::primitives::ParseSignedError), - #[error("Wasm bindgen js_sys threw error: {0}")] - JsSysError(String), -} - -#[derive(Debug)] -pub enum DecimalFloatErrorSelector { - CoefficientOverflow, - ExponentOverflow, - ExponentUnderflow, - FixedDecimalOverflow, - Log10Negative, - Log10Zero, - LossyConversionFromFloat, - NegativeFixedDecimalConversion, - WithTargetExponentOverflow, -} - -impl DecimalFloatErrorSelector { - /// A detailed, human-readable description of the underlying Solidity - /// `DecimalFloat` error that produced this selector. - pub fn to_readable_msg(&self) -> &'static str { - match self { - Self::CoefficientOverflow => { - "The number's coefficient is too large to fit in a Float (the signed coefficient exceeds the 224-bit range)." - } - Self::ExponentOverflow => { - "The number is too large to represent as a Float (its exponent exceeds the maximum supported magnitude)." - } - Self::ExponentUnderflow => { - "The number is too small to represent as a Float (its exponent is below the minimum supported magnitude, so it cannot be distinguished from zero)." - } - Self::FixedDecimalOverflow => { - "The number is too large to convert to a fixed-decimal value at the requested number of decimals (the scaled value exceeds the unsigned 256-bit range)." - } - Self::Log10Negative => { - "Cannot take the base-10 logarithm of a negative number." - } - Self::Log10Zero => "Cannot take the base-10 logarithm of zero.", - Self::LossyConversionFromFloat => { - "Converting this Float to the requested type would lose precision, and a lossless conversion was required." - } - Self::NegativeFixedDecimalConversion => { - "Cannot convert a negative number to an unsigned fixed-decimal value." - } - Self::WithTargetExponentOverflow => { - "The number cannot be rescaled to the requested target exponent without overflowing the Float coefficient." - } - } - } -} - -impl TryFrom> for DecimalFloatErrorSelector { - type Error = FixedBytes<4>; - - fn try_from(error_selector: FixedBytes<4>) -> Result { - let FixedBytes(bytes) = error_selector; - match bytes { - ::SELECTOR => { - Ok(Self::CoefficientOverflow) - } - ::SELECTOR => Ok(Self::ExponentOverflow), - ::SELECTOR => Ok(Self::ExponentUnderflow), - ::SELECTOR => { - Ok(Self::FixedDecimalOverflow) - } - ::SELECTOR => Ok(Self::Log10Negative), - ::SELECTOR => Ok(Self::Log10Zero), - ::SELECTOR => { - Ok(Self::LossyConversionFromFloat) - } - ::SELECTOR => { - Ok(Self::NegativeFixedDecimalConversion) - } - ::SELECTOR => { - Ok(Self::WithTargetExponentOverflow) - } - _ => Err(error_selector), - } - } -} - -impl FloatError { - /// A detailed, human-readable description of the error, suitable for - /// surfacing to end users (e.g. via [WasmEncodedError::readable_msg]). - pub fn to_readable_msg(&self) -> String { - match self { - Self::Evm(e) => { - format!("An error occurred while executing the Float operation in the EVM: {e}") - } - Self::Revert(bytes) => { - format!("The Float operation reverted with output: {bytes}") - } - Self::Halt(reason) => { - format!("The Float operation halted unexpectedly with reason: {reason:?}") - } - Self::UnexpectedSuccess(reason, output) => { - format!( - "The Float operation ended for an unexpected non-return reason: {reason:?}. Output: {output:?}" - ) - } - Self::AlloySolTypes(e) => { - format!("Failed to encode or decode the Float operation's ABI data: {e}") - } - Self::DecimalFloat(e) => { - format!("The Float operation failed with a decimal float error: {e:?}") - } - Self::DecimalFloatSelector(selector) => match selector { - Ok(selector) => selector.to_readable_msg().to_string(), - Err(unknown) => format!( - "The Float operation reverted with an unrecognised error selector: {unknown}" - ), - }, - Self::Access(e) => { - format!("Failed to access the thread-local EVM used to run Float operations: {e}") - } - Self::InvalidHex(s) => { - format!("The provided value is not a valid hex string: {s}") - } - Self::AlloyFromHexError(e) => { - format!("Failed to decode the provided hex string: {e}") - } - Self::AlloyParseError(e) => { - format!("Failed to parse the provided number: {e}") - } - Self::AlloyParseSignedError(e) => { - format!("Failed to parse the provided signed number: {e}") - } - Self::JsSysError(s) => { - format!("A JavaScript error occurred while running the Float operation: {s}") - } - } - } -} - -impl From for WasmEncodedError { - fn from(value: FloatError) -> Self { - WasmEncodedError { - msg: value.to_string(), - readable_msg: value.to_readable_msg(), - } - } -} - -impl From for FloatError { - fn from(value: JsError) -> Self { - FloatError::JsSysError(value.to_string().into()) - } -} - -impl From for FloatError { - fn from(value: RangeError) -> Self { - FloatError::JsSysError(value.to_string().into()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_decimal_float_error_selector_readable_msgs() { - assert_eq!( - DecimalFloatErrorSelector::CoefficientOverflow.to_readable_msg(), - "The number's coefficient is too large to fit in a Float (the signed coefficient exceeds the 224-bit range)." - ); - assert_eq!( - DecimalFloatErrorSelector::ExponentOverflow.to_readable_msg(), - "The number is too large to represent as a Float (its exponent exceeds the maximum supported magnitude)." - ); - assert_eq!( - DecimalFloatErrorSelector::ExponentUnderflow.to_readable_msg(), - "The number is too small to represent as a Float (its exponent is below the minimum supported magnitude, so it cannot be distinguished from zero)." - ); - assert_eq!( - DecimalFloatErrorSelector::FixedDecimalOverflow.to_readable_msg(), - "The number is too large to convert to a fixed-decimal value at the requested number of decimals (the scaled value exceeds the unsigned 256-bit range)." - ); - assert_eq!( - DecimalFloatErrorSelector::Log10Negative.to_readable_msg(), - "Cannot take the base-10 logarithm of a negative number." - ); - assert_eq!( - DecimalFloatErrorSelector::Log10Zero.to_readable_msg(), - "Cannot take the base-10 logarithm of zero." - ); - assert_eq!( - DecimalFloatErrorSelector::LossyConversionFromFloat.to_readable_msg(), - "Converting this Float to the requested type would lose precision, and a lossless conversion was required." - ); - assert_eq!( - DecimalFloatErrorSelector::NegativeFixedDecimalConversion.to_readable_msg(), - "Cannot convert a negative number to an unsigned fixed-decimal value." - ); - assert_eq!( - DecimalFloatErrorSelector::WithTargetExponentOverflow.to_readable_msg(), - "The number cannot be rescaled to the requested target exponent without overflowing the Float coefficient." - ); - } - - #[test] - fn test_float_error_readable_msg_invalid_hex() { - let err = FloatError::InvalidHex("zz".to_string()); - assert_eq!( - err.to_readable_msg(), - "The provided value is not a valid hex string: zz" - ); - } - - #[test] - fn test_float_error_readable_msg_js_sys() { - let err = FloatError::JsSysError("boom".to_string()); - assert_eq!( - err.to_readable_msg(), - "A JavaScript error occurred while running the Float operation: boom" - ); - } - - #[test] - fn test_float_error_readable_msg_decimal_float_selector_known() { - let err = FloatError::DecimalFloatSelector(Ok(DecimalFloatErrorSelector::Log10Zero)); - assert_eq!( - err.to_readable_msg(), - "Cannot take the base-10 logarithm of zero." - ); - } - - #[test] - fn test_float_error_readable_msg_decimal_float_selector_unknown() { - let unknown = FixedBytes::<4>::from([0xde, 0xad, 0xbe, 0xef]); - let err = FloatError::DecimalFloatSelector(Err(unknown)); - assert_eq!( - err.to_readable_msg(), - "The Float operation reverted with an unrecognised error selector: 0xdeadbeef" - ); - } - - #[test] - fn test_wasm_encoded_error_uses_readable_msg() { - let err = FloatError::InvalidHex("zz".to_string()); - let short = err.to_string(); - let readable = err.to_readable_msg(); - let encoded: WasmEncodedError = err.into(); - assert_eq!(encoded.msg, short); - assert_eq!(encoded.readable_msg, readable); - // The detailed readable message is distinct from the short message. - assert_ne!(encoded.msg, encoded.readable_msg); - } -} diff --git a/crates/float/src/evm.rs b/crates/float/src/evm.rs deleted file mode 100644 index 6c7179f4..00000000 --- a/crates/float/src/evm.rs +++ /dev/null @@ -1,96 +0,0 @@ -use alloy::primitives::{Address, Bytes}; -use alloy::sol_types::SolInterface; -use revm::context::result::{ExecutionResult, Output, SuccessReason}; -use revm::context::{BlockEnv, CfgEnv, TxEnv}; -use revm::database::InMemoryDB; -use revm::primitives::address; -use revm::{Context, MainBuilder, MainContext, MainnetEvm, SystemCallEvm}; -use std::cell::RefCell; - -use crate::{DecimalFloat, FloatError}; - -#[cfg(test)] -use crate::TestDecimalFloat; - -/// Fixed address where the DecimalFloat contract is deployed in the in-memory EVM. -/// This arbitrary address is used consistently across all Calculator instances. -pub(crate) const FLOAT_ADDRESS: Address = address!("00000000000000000000000000000000000f10a2"); - -#[cfg(test)] -/// Fixed address where the TestDecimalFloat contract is deployed in the in-memory EVM. -pub(crate) const TEST_FLOAT_ADDRESS: Address = address!("00000000000000000000000000000000000f10a3"); - -type EvmContext = Context; -type LocalEvm = MainnetEvm; - -thread_local! { - pub(crate) static LOCAL_EVM: RefCell = { - let mut db = InMemoryDB::default(); - - // Deploy DecimalFloat contract - let bytecode = revm::state::Bytecode::new_legacy(DecimalFloat::DEPLOYED_BYTECODE.clone()); - let account_info = revm::state::AccountInfo::default().with_code(bytecode); - db.insert_account_info(FLOAT_ADDRESS, account_info); - - #[cfg(test)] - { - // Deploy TestDecimalFloat contract for testing - let test_bytecode = revm::state::Bytecode::new_legacy(TestDecimalFloat::DEPLOYED_BYTECODE.clone()); - let test_account_info = revm::state::AccountInfo::default().with_code(test_bytecode); - db.insert_account_info(TEST_FLOAT_ADDRESS, test_account_info); - } - - let evm = Context::mainnet().with_db(db).build_mainnet(); - RefCell::new(evm) - }; -} - -pub(crate) fn execute_call(calldata: Bytes, process_output: F) -> Result -where - F: FnOnce(Bytes) -> Result, -{ - execute_call_at_address(FLOAT_ADDRESS, calldata, process_output) -} - -#[cfg(test)] -pub(crate) fn execute_test_call(calldata: Bytes, process_output: F) -> Result -where - F: FnOnce(Bytes) -> Result, -{ - execute_call_at_address(TEST_FLOAT_ADDRESS, calldata, process_output) -} - -fn execute_call_at_address( - address: Address, - calldata: Bytes, - process_output: F, -) -> Result -where - F: FnOnce(Bytes) -> Result, -{ - let result = LOCAL_EVM.try_with(|evm| { - let evm = &mut *evm.borrow_mut(); - let result_and_state = evm.system_call(address, calldata)?; - - Ok::<_, FloatError>(result_and_state.result) - })??; - - match result { - ExecutionResult::Success { - reason: SuccessReason::Return, - output: Output::Call(output), - .. - } => process_output(output), - ExecutionResult::Success { reason, output, .. } => { - Err(FloatError::UnexpectedSuccess(reason, output)) - } - ExecutionResult::Revert { output, .. } => { - if let Ok(error) = DecimalFloat::DecimalFloatErrors::abi_decode(output.as_ref()) { - return Err(FloatError::DecimalFloat(Box::new(error))); - } - - Err(FloatError::Revert(output)) - } - ExecutionResult::Halt { reason, .. } => Err(FloatError::Halt(reason)), - } -} diff --git a/crates/float/src/fuzz_ops.rs b/crates/float/src/fuzz_ops.rs deleted file mode 100644 index 4c28f784..00000000 --- a/crates/float/src/fuzz_ops.rs +++ /dev/null @@ -1,306 +0,0 @@ -#[cfg(test)] -mod tests { - use crate::Float; - use alloy::primitives::{aliases::I224, I256}; - use proptest::prelude::*; - - /// Convert a Solidity Float to f64 via unpack. - fn sol_to_f64(f: Float) -> Option { - let (coeff, exp) = f.unpack().ok()?; - let c: f64 = i256_to_f64(coeff); - let e: i32 = exp.as_i32(); - Some(c * 10.0_f64.powi(e)) - } - - fn i256_to_f64(v: I256) -> f64 { - if v.is_negative() { - let abs = (!v).wrapping_add(I256::ONE); - -(u256_to_f64(abs.into_raw())) - } else { - u256_to_f64(v.into_raw()) - } - } - - fn u256_to_f64(v: alloy::primitives::U256) -> f64 { - // Convert U256 to f64 via string parsing for accuracy. - v.to_string().parse::().unwrap_or(f64::INFINITY) - } - - // Generate floats in a range where f64 can represent them without - // overflow/underflow. Coefficients up to ~1e15 and exponents -15..15 - // keep values in f64's comfortable range. - prop_compose! { - fn f64_compatible_float()( - coefficient in -10i64.pow(15)..10i64.pow(15), - exponent in -15i32..15i32, - ) -> Float { - Float::pack_lossless( - I224::try_from(coefficient).unwrap(), - exponent, - ).unwrap() - } - } - - /// Check that two f64 values are approximately equal, allowing for - /// f64 rounding errors. Returns true if they're within a relative - /// tolerance of 1e-10 or both are effectively zero. - fn approx_eq(a: f64, b: f64) -> bool { - if a == b { - return true; - } - if a.is_nan() || b.is_nan() { - return false; - } - let max_abs = a.abs().max(b.abs()); - if max_abs < 1e-30 { - return true; - } - ((a - b).abs() / max_abs) < 1e-10 - } - - proptest! { - #[test] - fn fuzz_add( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let sol_result = (a + b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - let expected = a_f64 + b_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "add: {a_f64} + {b_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_sub( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let sol_result = (a - b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - let expected = a_f64 - b_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "sub: {a_f64} - {b_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_mul( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let sol_result = (a * b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - let expected = a_f64 * b_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "mul: {a_f64} * {b_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_div( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let b_f64 = sol_to_f64(b).unwrap(); - // Skip division by zero. - prop_assume!(b_f64.abs() > 1e-30); - - let sol_result = (a / b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let expected = a_f64 / b_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "div: {a_f64} / {b_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_neg(a in f64_compatible_float()) { - let sol_result = (-a).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let expected = -a_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "neg: -{a_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_abs(a in f64_compatible_float()) { - let sol_result = a.abs().unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let expected = a_f64.abs(); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "abs: |{a_f64}| = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_inv(a in f64_compatible_float()) { - let a_f64 = sol_to_f64(a).unwrap(); - // Skip values too close to zero. - prop_assume!(a_f64.abs() > 1e-10); - - let sol_result = a.inv().unwrap(); - let expected = 1.0 / a_f64; - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "inv: 1/{a_f64} = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_floor(a in f64_compatible_float()) { - let a_f64 = sol_to_f64(a).unwrap(); - let sol_result = a.floor().unwrap(); - let expected = a_f64.floor(); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "floor: floor({a_f64}) = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_integer(a in f64_compatible_float()) { - let a_f64 = sol_to_f64(a).unwrap(); - let sol_result = a.integer().unwrap(); - let expected = a_f64.trunc(); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "integer: trunc({a_f64}) = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_frac( - coefficient in -10i64.pow(10)..10i64.pow(10), - exponent in -5i32..0i32, - ) { - let a = Float::pack_lossless( - I224::try_from(coefficient).unwrap(), - exponent, - ).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let sol_result = a.frac().unwrap(); - let expected = a_f64.fract(); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - (expected - actual).abs() < 1e-6, - "frac: fract({a_f64}) = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_min( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let sol_result = a.min(b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - let expected = a_f64.min(b_f64); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "min: min({a_f64}, {b_f64}) = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_max( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let sol_result = a.max(b).unwrap(); - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - let expected = a_f64.max(b_f64); - let actual = sol_to_f64(sol_result).unwrap(); - prop_assert!( - approx_eq(expected, actual), - "max: max({a_f64}, {b_f64}) = {expected}, sol = {actual}", - ); - } - - #[test] - fn fuzz_is_zero(a in f64_compatible_float()) { - let a_f64 = sol_to_f64(a).unwrap(); - let sol_result = a.is_zero().unwrap(); - let expected = a_f64 == 0.0; - prop_assert!( - sol_result == expected, - "is_zero: is_zero({}) = {}, sol = {}", - a_f64, expected, sol_result - ); - } - - #[test] - fn fuzz_fixed_decimal_round_trip( - coefficient in 0i64..10i64.pow(15), - decimals in 0u8..18u8, - ) { - use alloy::primitives::U256; - let value = U256::from(coefficient as u64); - // Convert to float and back. - let float = Float::from_fixed_decimal(value, decimals); - prop_assume!(float.is_ok()); - let float = float.unwrap(); - let (back, lossless) = float.to_fixed_decimal_lossy(decimals).unwrap(); - if lossless { - prop_assert!( - back == value, - "round-trip failed: {} with {} decimals, got {}", - coefficient, decimals, back - ); - } - } - - #[test] - fn fuzz_comparisons( - a in f64_compatible_float(), - b in f64_compatible_float(), - ) { - let a_f64 = sol_to_f64(a).unwrap(); - let b_f64 = sol_to_f64(b).unwrap(); - - // Only test comparisons when values are far enough apart - // that f64 precision issues don't cause false failures. - let diff = (a_f64 - b_f64).abs(); - let max_abs = a_f64.abs().max(b_f64.abs()); - prop_assume!(diff > max_abs * 1e-10 || diff < 1e-30); - - let sol_lt = a.lt(b).unwrap(); - let sol_gt = a.gt(b).unwrap(); - let sol_eq = a.eq(b).unwrap(); - - if diff < 1e-30 { - // Both effectively zero. - prop_assert!(sol_eq, "eq: {a_f64} == {b_f64} should be true"); - } else if a_f64 < b_f64 { - prop_assert!(sol_lt, "lt: {a_f64} < {b_f64} should be true"); - prop_assert!(!sol_gt, "gt: {a_f64} > {b_f64} should be false"); - } else { - prop_assert!(sol_gt, "gt: {a_f64} > {b_f64} should be true"); - prop_assert!(!sol_lt, "lt: {a_f64} < {b_f64} should be false"); - } - } - } -} diff --git a/crates/float/src/js_api.rs b/crates/float/src/js_api.rs deleted file mode 100644 index 68c47a08..00000000 --- a/crates/float/src/js_api.rs +++ /dev/null @@ -1,989 +0,0 @@ -use crate::{Float, FloatError}; -use revm::primitives::{B256, U256}; -use serde::{Deserialize, Serialize}; -use std::{ - ops::{Add, Div, Mul, Neg, Sub}, - str::FromStr, -}; -use wasm_bindgen_utils::{ - impl_wasm_traits, - prelude::{js_sys::BigInt, *}, -}; - -#[wasm_bindgen] -pub struct FromFixedDecimalLossyResult { - float: Float, - lossless: bool, -} - -#[wasm_bindgen] -impl FromFixedDecimalLossyResult { - #[wasm_bindgen(getter)] - pub fn float(&self) -> Float { - self.float - } - - #[wasm_bindgen(getter)] - pub fn lossless(&self) -> bool { - self.lossless - } -} - -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Tsify)] -pub struct ToFixedDecimalLossyResult { - pub value: String, - pub lossless: bool, -} -impl_wasm_traits!(ToFixedDecimalLossyResult); - -#[wasm_bindgen] -impl Float { - /// Returns the 32-byte hexadecimal string representation of the float. - /// - /// # Returns - /// - /// * `String` - The 32-byte hex string. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.fromHex("0x0000000000000000000000000000000000000000000000000000000000000005").value!; - /// assert(float.asHex() === "0x0000000000000000000000000000000000000000000000000000000000000005"); - /// ``` - #[wasm_bindgen(js_name = "asHex", unchecked_return_type = "`0x${string}`")] - pub fn as_hex_js(&self) -> String { - self.as_hex() - } - - /// Convert the float to a JS/TS bigint equivalent of `asHex()` returned hex string. - /// - /// # Throws - /// if conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.fromHex("0xfffffffe0000000000000000000000000000000000000000000000000000013a"); - /// const value = float.toBigInt(); - /// assert(value === 115792089183396302089269705419353877679230723318366275194376439045705909141818n); - /// ``` - #[wasm_bindgen(js_name = "toBigint", unchecked_return_type = "bigint")] - pub fn to_bigint(&self) -> BigInt { - self.try_to_bigint().unwrap_throw() - } - - /// Constructs a `Float` from a bigint equivalent of the `fromHex()` returned Float. - /// - /// # Throws - /// if conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.fromBigint(115792089183396302089269705419353877679230723318366275194376439045705909141818n); - /// assert(float.asHex() === "0xfffffffe0000000000000000000000000000000000000000000000000000013a"); - /// ``` - #[wasm_bindgen(js_name = "fromBigint")] - pub fn from_bigint(value: BigInt) -> Float { - Self::try_from_bigint(value).unwrap_throw() - } - - /// Converts a fixed-point decimal value to a `Float` using the specified number of decimals, - /// allowing lossy conversions and reporting whether precision was preserved. - /// - /// This function attempts to convert a fixed-point decimal representation to a `Float`. - /// Unlike `fromFixedDecimal`, this method will not fail if precision is lost during conversion, - /// but instead reports the loss through the `lossless` flag in the result. - /// - /// # Arguments - /// - /// * `value` - The fixed-point decimal value as a bigint (e.g., 12345n for 123.45 with 2 decimals). - /// * `decimals` - The number of decimal places in the fixed-point representation (0-255). - /// - /// # Returns - /// - /// Returns a `FromFixedDecimalLossyResult` containing: - /// * `float` - The resulting `Float` value. - /// * `lossless` - Boolean flag indicating whether the conversion preserved all precision (true) or was lossy (false). - /// - /// # Errors - /// - /// Throws a `JsValue` error if: - /// * The bigint value cannot be converted to a string. - /// * The value string cannot be parsed as a valid U256. - /// * The underlying EVM conversion fails. - /// - /// # Example - /// - /// ```typescript - /// // Lossless conversion - /// const result = Float.fromFixedDecimalLossy(12345n, 2); - /// const float = result.float; - /// const wasLossless = result.lossless; - /// assert(float.format()?.value === "123.45"); - /// assert(wasLossless === true); - /// - /// // Potentially lossy conversion - /// const result2 = Float.fromFixedDecimalLossy(123456789012345678901234567890n, 18); - /// if (!result2.lossless) { - /// console.warn("Precision was lost during conversion"); - /// } - /// ``` - #[wasm_bindgen(js_name = "fromFixedDecimalLossy")] - pub fn from_fixed_decimal_lossy_js( - value: BigInt, - decimals: u8, - ) -> Result { - let value_str: String = value.to_string(10).map_err(|e| JsValue::from(&e))?.into(); - let val = U256::from_str(&value_str).map_err(|e| JsValue::from_str(&e.to_string()))?; - let (float, lossless) = Float::from_fixed_decimal_lossy(val, decimals) - .map_err(|e| JsValue::from_str(&e.to_string()))?; - Ok(FromFixedDecimalLossyResult { float, lossless }) - } -} - -#[wasm_export] -impl Float { - /// Tries to convert the float to a JS/TS bigint equivalent of `asHex()` returned hex string. - /// - /// # Returns - /// - /// * `Ok(bigint)` - The resulting `bigint` value. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.fromHex("0xfffffffe0000000000000000000000000000000000000000000000000000013a"); - /// const bigintResult = float.tryToBigInt(); - /// if (bigintResult.error) { - /// console.error(bigintResult.error); - /// } - /// assert(bigintResult.value === 115792089183396302089269705419353877679230723318366275194376439045705909141818n); - /// ``` - #[wasm_export( - js_name = "tryToBigint", - preserve_js_class, - unchecked_return_type = "bigint" - )] - pub fn try_to_bigint(&self) -> Result { - Ok(BigInt::from_str(&self.as_hex())?) - } - - /// Constructs a `Float` from a bigint equivalent of the `fromHex()` returned Float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The resulting `Float` value. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const floatResult = Float.tryFromBigint(115792089183396302089269705419353877679230723318366275194376439045705909141818n); - /// if (floatResult.error) { - /// console.error(floatResult.error); - /// } - /// const value = float.value; - /// assert(value.asHex() === "0xfffffffe0000000000000000000000000000000000000000000000000000013a"); - /// ``` - #[wasm_export(js_name = "tryFromBigint", preserve_js_class)] - pub fn try_from_bigint(value: BigInt) -> Result { - // convert to 16 radix string and append 0 if length is odd - let mut value: String = value.to_string(16)?.into(); - if value.len() % 2 == 1 { - value = format!("0{}", value); - } - Ok(Float(B256::left_padding_from(&alloy::hex::decode(&value)?))) - } - - /// Converts a fixed-point decimal value to a `Float` using the specified number of decimals. - /// - /// # Arguments - /// - /// * `value` - The fixed-point decimal value as a `string`. - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The resulting `Float` value. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const floatResult = Float.fromFixedDecimal("12345", 2); - /// if (floatResult.error) { - /// console.error(floatResult.error); - /// } - /// const float = floatResult.value; - /// assert(float.format() === "123.45"); - /// ``` - #[wasm_export(js_name = "fromFixedDecimal", preserve_js_class)] - pub fn from_fixed_decimal_js(value: BigInt, decimals: u8) -> Result { - let value_str: String = value.to_string(10)?.into(); - let val = U256::from_str(&value_str)?; - Self::from_fixed_decimal(val, decimals) - } - - /// Converts a `Float` to a fixed-point decimal value using the specified number of decimals. - /// - /// # Arguments - /// - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok(String)` - The resulting fixed-point decimal value as a string. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.parse("123.45").value!; - /// const result = float.toFixedDecimal(2); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value === "12345"); - /// ``` - #[wasm_export( - js_name = "toFixedDecimal", - preserve_js_class, - unchecked_return_type = "bigint" - )] - pub fn to_fixed_decimal_js(&self, decimals: u8) -> Result { - let fixed = self.to_fixed_decimal(decimals)?; - BigInt::from_str(&fixed.to_string()) - .map_err(|e| FloatError::JsSysError(e.to_string().into())) - } - - /// Converts a `Float` to a fixed-point decimal value using the specified number of decimals lossy. - /// - /// # Returns - /// - /// ToFixedDecimalLossyResult containing the value and lossless flag. - #[wasm_export( - js_name = "toFixedDecimalLossy", - preserve_js_class, - unchecked_return_type = "ToFixedDecimalLossyResult" - )] - pub fn to_fixed_decimal_lossy_js( - &self, - decimals: u8, - ) -> Result { - let (fixed, lossless) = self.to_fixed_decimal_lossy(decimals)?; - Ok(ToFixedDecimalLossyResult { - value: fixed.to_string(), - lossless, - }) - } - - /// Parses a decimal string into a `Float`. - /// - /// # Arguments - /// - /// * `str` - The string to parse. - /// - /// # Returns - /// - /// * `Ok(Float)` - The parsed float. - /// * `Err(FloatError)` - If parsing fails. - /// - /// # Example - /// - /// ```typescript - /// const floatResult = Float.parse("3.1415"); - /// if (floatResult.error) { - /// console.error(floatResult.error); - /// } - /// const float = floatResult.value; - /// assert(float.format() === "3.1415"); - /// ``` - #[wasm_export(js_name = "parse", preserve_js_class)] - pub fn parse_js(str: String) -> Result { - Self::parse(str) - } - - /// Constructs a `Float` from a 32-byte hexadecimal string. - /// - /// # Arguments - /// - /// * `hex` - The 32-byte hex string to parse. - /// - /// # Returns - /// - /// * `Ok(Float)` - The float parsed from the hex string. - /// * `Err(FloatError)` - If the hex string is not valid or not 32 bytes. - /// - /// # Example - /// - /// ```typescript - /// const floatResult = Float.fromHex("0x0000000000000000000000000000000000000000000000000000000000000005"); - /// if (floatResult.error) { - /// console.error(floatResult.error); - /// } - /// const float = floatResult.value; - /// assert(float.asHex() === "0x0000000000000000000000000000000000000000000000000000000000000005"); - /// ``` - #[wasm_export(js_name = "fromHex", preserve_js_class)] - pub fn from_hex_js( - #[wasm_export(unchecked_param_type = "`0x${string}`")] hex: &str, - ) -> Result { - Self::from_hex(hex) - } - - /// Returns the maximum positive value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum positive value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const maxPosResult = Float.maxPositiveValue(); - /// if (maxPosResult.error) { - /// console.error(maxPosResult.error); - /// } - /// const maxPos = maxPosResult.value; - /// assert(!maxPos.format().error); - /// ``` - #[wasm_export(js_name = "maxPositiveValue", preserve_js_class)] - pub fn max_positive_value_js() -> Result { - Self::max_positive_value() - } - - /// Returns the minimum positive value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum positive value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const minPosResult = Float.minPositiveValue(); - /// if (minPosResult.error) { - /// console.error(minPosResult.error); - /// } - /// const minPos = minPosResult.value; - /// assert(!minPos.format().error); - /// ``` - #[wasm_export(js_name = "minPositiveValue", preserve_js_class)] - pub fn min_positive_value_js() -> Result { - Self::min_positive_value() - } - - /// Returns the maximum negative value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum negative value (closest to zero). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const maxNegResult = Float.maxNegativeValue(); - /// if (maxNegResult.error) { - /// console.error(maxNegResult.error); - /// } - /// const maxNeg = maxNegResult.value; - /// assert(!maxNeg.format().error); - /// ``` - #[wasm_export(js_name = "maxNegativeValue", preserve_js_class)] - pub fn max_negative_value_js() -> Result { - Self::max_negative_value() - } - - /// Returns the minimum negative value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum negative value (furthest from zero). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const minNegResult = Float.minNegativeValue(); - /// if (minNegResult.error) { - /// console.error(minNegResult.error); - /// } - /// const minNeg = minNegResult.value; - /// assert(!minNeg.format().error); - /// ``` - #[wasm_export(js_name = "minNegativeValue", preserve_js_class)] - pub fn min_negative_value_js() -> Result { - Self::min_negative_value() - } - - /// Returns the zero value of a `Float` in its maximized representation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The zero value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const zeroResult = Float.zero(); - /// if (zeroResult.error) { - /// console.error(zeroResult.error); - /// } - /// const zero = zeroResult.value; - /// assert(zero.isZero().value); - /// assert(zero.format().value === "0"); - /// ``` - #[wasm_export(js_name = "zero", preserve_js_class)] - pub fn zero_js() -> Result { - Self::zero() - } - - /// Returns the default minimum value for scientific notation formatting (1e-4). - /// - /// # Returns - /// - /// * `Ok(Float)` - The default minimum (1e-4). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const minResult = Float.formatDefaultScientificMin(); - /// if (minResult.error) { - /// console.error(minResult.error); - /// } - /// const min = minResult.value; - /// assert(min.format().value === "0.0001"); - /// ``` - #[wasm_export(js_name = "formatDefaultScientificMin", preserve_js_class)] - pub fn format_default_scientific_min_js() -> Result { - Self::format_default_scientific_min() - } - - /// Returns the default maximum value for scientific notation formatting (1e9). - /// - /// # Returns - /// - /// * `Ok(Float)` - The default maximum (1e9). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ```typescript - /// const maxResult = Float.formatDefaultScientificMax(); - /// if (maxResult.error) { - /// console.error(maxResult.error); - /// } - /// const max = maxResult.value; - /// assert(max.format().value === "1000000000"); - /// ``` - #[wasm_export(js_name = "formatDefaultScientificMax", preserve_js_class)] - pub fn format_default_scientific_max_js() -> Result { - Self::format_default_scientific_max() - } - - /// Formats the float as a decimal string using default scientific notation range (1e-4 to 1e9). - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Example - /// - /// ```typescript - /// const floatResult = Float.parse("2.5"); - /// if (floatResult.error) { - /// console.error(floatResult.error); - /// } - /// const float = floatResult.value; - /// const formatResult = float.format(); - /// assert(formatResult.value === "2.5"); - /// ``` - #[wasm_export(js_name = "format")] - pub fn format_js(&self) -> Result { - self.format() - } - - /// Formats the float as a decimal string with explicit scientific notation control. - /// - /// # Arguments - /// - /// * `scientific` - If true, always use scientific notation. If false, use decimal notation. - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.parse("123.456").value!; - /// - /// const decResult = float.formatWithScientific(false); - /// assert(decResult.value === "123.456"); - /// - /// const sciResult = float.formatWithScientific(true); - /// assert(sciResult.value === "1.23456e2"); - /// ``` - #[wasm_export(js_name = "formatWithScientific")] - pub fn format_with_scientific_js(&self, scientific: bool) -> Result { - self.format_with_scientific(scientific) - } - - /// Formats the float as a decimal string with a custom scientific notation range. - /// - /// # Arguments - /// - /// * `scientific_min` - Values smaller than this (in absolute value) use scientific notation. - /// * `scientific_max` - Values larger than this (in absolute value) use scientific notation. - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Example - /// - /// ```typescript - /// const float = Float.parse("0.5").value!; - /// const min = Float.parse("1").value!; - /// const max = Float.parse("100").value!; - /// const result = float.formatWithRange(min, max); - /// assert(result.value === "5e-1"); - /// ``` - #[wasm_export(js_name = "formatWithRange")] - pub fn format_with_range_js( - &self, - scientific_min: &Self, - scientific_max: &Self, - ) -> Result { - self.format_with_range(*scientific_min, *scientific_max) - } - - /// Returns `true` if `self` is less than `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is less than `b`. - /// * `Ok(false)` if `self` is not less than `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("1.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.lt(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "lt", unchecked_return_type = "boolean")] - pub fn lt_js(&self, b: &Self) -> Result { - self.lt(*b) - } - - /// Returns `true` if `self` is equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is equal to `b`. - /// * `Ok(false)` if `self` is not equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("2.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.eq(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "eq", unchecked_return_type = "boolean")] - pub fn eq_js(&self, b: &Self) -> Result { - self.eq(*b) - } - - /// Returns `true` if `self` is less than or equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is less than or equal to `b`. - /// * `Ok(false)` if `self` is not less than or equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("1.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.lte(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "lte", unchecked_return_type = "boolean")] - pub fn lte_js(&self, b: &Self) -> Result { - self.lte(*b) - } - - /// Returns `true` if `self` is greater than or equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is greater than or equal to `b`. - /// * `Ok(false)` if `self` is not greater than or equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("2.0").value!; - /// const b = Float.parse("1.0").value!; - /// const result = a.gte(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "gte", unchecked_return_type = "boolean")] - pub fn gte_js(&self, b: &Self) -> Result { - self.gte(*b) - } - - /// Returns `true` if `self` is greater than `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is greater than `b`. - /// * `Ok(false)` if `self` is not greater than `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("2.0").value!; - /// const b = Float.parse("1.0").value!; - /// const result = a.gt(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "gt", unchecked_return_type = "boolean")] - pub fn gt_js(&self, b: &Self) -> Result { - self.gt(*b) - } - - /// Returns the multiplicative inverse of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The inverse. - /// * `Err(FloatError)` - If inversion fails. - /// - /// # Example - /// - /// ```typescript - /// const x = Float.parse("2.0").value!; - /// const inv = x.inv(); - /// if (inv.error) { - /// console.error(inv.error); - /// } - /// assert(inv.value.format().startsWith("0.5")); - /// ``` - #[wasm_export(js_name = "inv", preserve_js_class)] - pub fn inv_js(&self) -> Result { - self.inv() - } - - /// Returns the absolute value of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The absolute value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const x = Float.parse("-3.14").value!; - /// const abs = x.abs(); - /// if (abs.error) { - /// console.error(abs.error); - /// } - /// assert(abs.value.format() === "3.14"); - /// ``` - #[wasm_export(js_name = "abs", preserve_js_class)] - pub fn abs_js(&self) -> Result { - self.abs() - } - - /// Adds two floats. - /// - /// # Returns - /// - /// * `Ok(Float)` - The sum. - /// * `Err(FloatError)` - If addition fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("1.5").value!; - /// const b = Float.parse("2.5").value!; - /// const result = a.add(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "4"); - /// ``` - #[wasm_export(js_name = "add", preserve_js_class)] - pub fn add_js(&self, b: &Self) -> Result { - self.add(*b) - } - - /// Subtracts `b` from `self`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The difference. - /// * `Err(FloatError)` - If subtraction fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("5.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.sub(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "3"); - /// ``` - #[wasm_export(js_name = "sub", preserve_js_class)] - pub fn sub_js(&self, b: &Self) -> Result { - self.sub(*b) - } - - /// Multiplies two floats. - /// - /// # Returns - /// - /// * `Ok(Float)` - The product. - /// * `Err(FloatError)` - If multiplication fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("2.0").value!; - /// const b = Float.parse("3.0").value!; - /// const result = a.mul(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "6"); - /// ``` - #[wasm_export(js_name = "mul", preserve_js_class)] - pub fn mul_js(&self, b: &Self) -> Result { - self.mul(*b) - } - - /// Divides `self` by `b`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The quotient. - /// * `Err(FloatError)` - If division fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("6.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.div(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "3"); - /// ``` - #[wasm_export(js_name = "div", preserve_js_class)] - pub fn div_js(&self, b: &Self) -> Result { - self.div(*b) - } - - /// Returns the fractional part of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The fractional part. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const x = Float.parse("3.75").value!; - /// const result = x.frac(); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "0.75"); - /// ``` - #[wasm_export(js_name = "frac", preserve_js_class)] - pub fn frac_js(&self) -> Result { - self.frac() - } - - /// Returns the floor of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The floored value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const x = Float.parse("3.75").value!; - /// const result = x.floor(); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "3"); - /// ``` - #[wasm_export(js_name = "floor", preserve_js_class)] - pub fn floor_js(&self) -> Result { - self.floor() - } - - /// Returns the minimum of `self` and `b`. - /// - /// # Arguments - /// - /// * `b` - The other `Float` to compare with. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("1.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.min(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "1"); - /// ``` - #[wasm_export(js_name = "min", preserve_js_class)] - pub fn min_js(&self, b: &Self) -> Result { - self.min(*b) - } - - /// Returns the maximum of `self` and `b`. - /// - /// # Arguments - /// - /// * `b` - The other `Float` to compare with. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const a = Float.parse("1.0").value!; - /// const b = Float.parse("2.0").value!; - /// const result = a.max(b); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "2"); - /// ``` - #[wasm_export(js_name = "max", preserve_js_class)] - pub fn max_js(&self, b: &Self) -> Result { - self.max(*b) - } - - /// Checks if the float is zero. - /// - /// # Returns - /// - /// * `Ok(true)` if the float is zero. - /// * `Ok(false)` if the float is not zero. - /// * `Err(FloatError)` if the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const zero = Float.parse("0").value!; - /// const result = zero.isZero(); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value); - /// ``` - #[wasm_export(js_name = "isZero", unchecked_return_type = "boolean")] - pub fn is_zero_js(&self) -> Result { - self.is_zero() - } - - /// Returns the negation of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The negated value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ```typescript - /// const x = Float.parse("3.14").value!; - /// const result = x.neg(); - /// if (result.error) { - /// console.error(result.error); - /// } - /// assert(result.value.format() === "-3.14"); - /// ``` - #[wasm_export(js_name = "neg", preserve_js_class)] - pub fn neg_js(&self) -> Result { - self.neg() - } -} diff --git a/crates/float/src/lib.rs b/crates/float/src/lib.rs deleted file mode 100644 index 994b8fd8..00000000 --- a/crates/float/src/lib.rs +++ /dev/null @@ -1,2316 +0,0 @@ -use alloy::hex::FromHex; -use alloy::primitives::{Bytes, B256}; -use alloy::{sol, sol_types::SolCall}; -use revm::primitives::{fixed_bytes, U256}; -use serde::{Deserialize, Serialize}; -use std::ops::{Add, Div, Mul, Neg, Sub}; -use wasm_bindgen_utils::prelude::*; - -#[cfg(test)] -use alloy::primitives::aliases::I224; - -pub mod error; -mod evm; -mod fuzz_ops; -pub mod js_api; -pub mod tables; - -use error::DecimalFloatErrorSelector; -pub use error::FloatError; -use evm::execute_call; -#[cfg(test)] -use evm::execute_test_call; - -sol!( - #![sol(all_derives)] - DecimalFloat, - concat!(env!("CARGO_MANIFEST_DIR"), "/abi/DecimalFloat.json") -); - -#[cfg(test)] -sol!( - #![sol(all_derives)] - TestDecimalFloat, - concat!(env!("CARGO_MANIFEST_DIR"), "/abi/TestDecimalFloat.json") -); - -#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize, Hash)] -#[wasm_bindgen] -pub struct Float(B256); - -impl Float { - /// Creates a new `Float` from the given 32-byte value `B256`. - pub const fn from_raw(value: B256) -> Self { - Float(value) - } - - /// Getter for inner 32-bytes value of this Float instance as `B256`. - pub fn get_inner(&self) -> B256 { - self.0 - } - - /// Sets the inner 32-byte value of this float from the given `B256`. - pub fn set_inner(&mut self, value: B256) { - self.0 = value; - } - - /// Converts a fixed-point decimal value to a `Float` using the specified number of decimals. - /// - /// # Arguments - /// - /// * `value` - The fixed-point decimal value as a `U256`. - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The resulting `Float` value. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// use alloy::primitives::U256; - /// - /// // 123.45 with 2 decimals is represented as 12345 - /// let value = U256::from(12345u64); - /// let decimals = 2u8; - /// let float = Float::from_fixed_decimal(value, decimals)?; - /// assert_eq!(float.format()?, "123.45"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn from_fixed_decimal(value: U256, decimals: u8) -> Result { - let calldata = DecimalFloat::fromFixedDecimalLosslessCall { value, decimals }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = - DecimalFloat::fromFixedDecimalLosslessCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Converts a `Float` to a fixed-point decimal value using the specified number of decimals. - /// - /// # Arguments - /// - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok(U256)` - The resulting fixed-point decimal value. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// use alloy::primitives::U256; - /// - /// // 123.45 with 2 decimals becomes 12345 - /// let float = Float::parse("123.45".to_string())?; - /// let fixed = float.to_fixed_decimal(2)?; - /// assert_eq!(fixed, U256::from(12345u64)); - /// - /// anyhow::Ok(()) - /// ``` - pub fn to_fixed_decimal(self, decimals: u8) -> Result { - let Float(float) = self; - let calldata = DecimalFloat::toFixedDecimalLosslessCall { float, decimals }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = - DecimalFloat::toFixedDecimalLosslessCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Converts a fixed-point decimal value to a `Float` using the specified number of decimals lossy. - /// - /// # Arguments - /// - /// * `value` - The fixed-point decimal value as a `U256`. - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok((Float, bool))` - The resulting `Float` value and a boolean indicating if the conversion was lossless. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// use alloy::primitives::U256; - /// - /// // 123.45 with 2 decimals is represented as 12345 - /// let value = U256::from(12345u64); - /// let decimals = 2u8; - /// let (float, lossless) = Float::from_fixed_decimal_lossy(value, decimals)?; - /// assert_eq!(float.format()?, "123.45"); - /// assert!(lossless); - /// - /// anyhow::Ok(()) - /// ``` - pub fn from_fixed_decimal_lossy(value: U256, decimals: u8) -> Result<(Self, bool), FloatError> { - let calldata = DecimalFloat::fromFixedDecimalLossyCall { value, decimals }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = - DecimalFloat::fromFixedDecimalLossyCall::abi_decode_returns(output.as_ref())?; - Ok((Float(decoded._0), decoded._1)) - }) - } - - /// Converts a `Float` to a fixed-point decimal value using the specified number of decimals lossy. - /// - /// # Arguments - /// - /// * `decimals` - The number of decimals in the fixed-point representation. - /// - /// # Returns - /// - /// * `Ok((U256, bool))` - The resulting fixed-point decimal value and a boolean indicating if the conversion was lossless. - /// * `Err(FloatError)` - If the conversion fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// use alloy::primitives::U256; - /// - /// // 123.45 with 2 decimals becomes 12345 - /// let float = Float::from_fixed_decimal(U256::from(12345), 3)?; - /// let (fixed, lossless) = float.to_fixed_decimal_lossy(2)?; - /// assert_eq!(fixed, U256::from(1234u64)); - /// assert!(!lossless); - /// - /// anyhow::Ok(()) - /// ``` - pub fn to_fixed_decimal_lossy(self, decimals: u8) -> Result<(U256, bool), FloatError> { - let Float(float) = self; - let calldata = DecimalFloat::toFixedDecimalLossyCall { float, decimals }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = - DecimalFloat::toFixedDecimalLossyCall::abi_decode_returns(output.as_ref())?; - Ok((decoded._0, decoded._1)) - }) - } - - /// Packs a coefficient and exponent into a `Float` in a lossless manner. - /// - /// # Arguments - /// - /// * `coefficient` - The coefficient as an `I224`. - /// * `exponent` - The exponent as an `i32`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The packed float. - /// * `Err(FloatError)` - If the packing fails (e.g., overflow). - /// - /// # Example - /// - /// ``` - /// use std::str::FromStr; - /// use alloy::primitives::aliases::I224; - /// use rain_math_float::{Float, FloatError}; - /// - /// let coefficient = I224::from_str("314")?; - /// let exponent = -2; - /// let float = Float::pack_lossless(coefficient, exponent)?; - /// assert_eq!(float.format()?, "3.14"); - /// - /// anyhow::Ok(()) - /// ``` - #[cfg(test)] - pub fn pack_lossless(coefficient: I224, exponent: i32) -> Result { - let calldata = TestDecimalFloat::packLosslessCall { - coefficient, - exponent, - } - .abi_encode(); - - execute_test_call(Bytes::from(calldata), |output| { - let decoded = TestDecimalFloat::packLosslessCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - #[cfg(test)] - fn unpack(self) -> Result<(alloy::primitives::I256, alloy::primitives::I256), FloatError> { - let Float(float) = self; - let calldata = TestDecimalFloat::unpackCall { float }.abi_encode(); - - execute_test_call(Bytes::from(calldata), |output| { - let TestDecimalFloat::unpackReturn { - _0: coefficient, - _1: exponent, - } = TestDecimalFloat::unpackCall::abi_decode_returns(output.as_ref())?; - - Ok((coefficient, exponent)) - }) - } - - #[cfg(test)] - fn show_unpacked(self) -> Result { - let (coefficient, exponent) = self.unpack()?; - Ok(format!("{coefficient}e{exponent}")) - } - - /// Parses a decimal string into a `Float`. - /// - /// # Arguments - /// - /// * `str` - The string to parse. - /// - /// # Returns - /// - /// * `Ok(Float)` - The parsed float. - /// * `Err(FloatError)` - If parsing fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let float = Float::parse("3.1415".to_string())?; - /// assert_eq!(float.format()?, "3.1415"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn parse(str: String) -> Result { - let calldata = DecimalFloat::parseCall { str }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let DecimalFloat::parseReturn { - _0: error_selector, - _1: parsed_float, - } = DecimalFloat::parseCall::abi_decode_returns(output.as_ref())?; - - if error_selector != fixed_bytes!("00000000") { - let selector = DecimalFloatErrorSelector::try_from(error_selector); - return Err(FloatError::DecimalFloatSelector(selector)); - } - - Ok(Float(parsed_float)) - }) - } - - /// Returns the 32-byte hexadecimal string representation of the float. - /// - /// # Returns - /// - /// * `String` - The 32-byte hex string. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// let float = Float::from_hex("0x0000000000000000000000000000000000000000000000000000000000000005").unwrap(); - /// assert_eq!(float.as_hex(), "0x0000000000000000000000000000000000000000000000000000000000000005"); - /// ``` - pub fn as_hex(self) -> String { - alloy::hex::encode_prefixed(self.0) - } - - /// Constructs a `Float` from a 32-byte hexadecimal string. - /// - /// # Arguments - /// - /// * `hex` - The 32-byte hex string to parse. - /// - /// # Returns - /// - /// * `Ok(Float)` - The float parsed from the hex string. - /// * `Err(FloatError)` - If the hex string is not valid or not 32 bytes. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// let float = Float::from_hex("0x0000000000000000000000000000000000000000000000000000000000000005")?; - /// assert_eq!(float.as_hex(), "0x0000000000000000000000000000000000000000000000000000000000000005"); - /// anyhow::Ok(()) - /// ``` - pub fn from_hex(hex: &str) -> Result { - let bytes = B256::from_hex(hex).map_err(|_| FloatError::InvalidHex(hex.to_string()))?; - Ok(Float(bytes)) - } - - /// Returns the maximum positive value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum positive value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let max_pos = Float::max_positive_value()?; - /// let zero = Float::parse("0".to_string())?; - /// - /// // Max positive is greater than zero - /// assert!(max_pos.gt(zero)?); - /// - /// // Max positive is greater than any normal large number - /// let big_number = Float::parse("999999999999999999999".to_string())?; - /// assert!(max_pos.gt(big_number)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn max_positive_value() -> Result { - let calldata = DecimalFloat::maxPositiveValueCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::maxPositiveValueCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the minimum positive value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum positive value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let min_pos = Float::min_positive_value()?; - /// let zero = Float::parse("0".to_string())?; - /// - /// // Min positive is greater than zero but smaller than any other positive number - /// assert!(min_pos.gt(zero)?); - /// - /// let small_number = Float::parse("0.000000000000000001".to_string())?; - /// assert!(min_pos.lt(small_number)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn min_positive_value() -> Result { - let calldata = DecimalFloat::minPositiveValueCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::minPositiveValueCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the maximum negative value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum negative value (closest to zero). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let max_neg = Float::max_negative_value()?; - /// let zero = Float::parse("0".to_string())?; - /// - /// // Max negative is less than zero but greater than any other negative number - /// assert!(max_neg.lt(zero)?); - /// - /// let small_negative = Float::parse("-0.000000000000000001".to_string())?; - /// assert!(max_neg.gt(small_negative)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn max_negative_value() -> Result { - let calldata = DecimalFloat::maxNegativeValueCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::maxNegativeValueCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the minimum negative value that can be represented as a `Float`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum negative value (furthest from zero). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let min_neg = Float::min_negative_value()?; - /// let zero = Float::parse("0".to_string())?; - /// - /// // Min negative is less than zero - /// assert!(min_neg.lt(zero)?); - /// - /// // Min negative is less than any normal negative number - /// let big_negative = Float::parse("-999999999999999999999".to_string())?; - /// assert!(min_neg.lt(big_negative)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn min_negative_value() -> Result { - let calldata = DecimalFloat::minNegativeValueCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::minNegativeValueCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the zero value of a `Float` in its maximized representation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The zero value. - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let zero = Float::zero()?; - /// assert!(zero.is_zero()?); - /// assert_eq!(zero.format()?, "0"); - /// - /// // Should be equal to parsed zero - /// let parsed_zero = Float::parse("0".to_string())?; - /// assert!(zero.eq(parsed_zero)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn zero() -> Result { - let calldata = DecimalFloat::zeroCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::zeroCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the default minimum value for scientific notation formatting (1e-4). - /// - /// Values smaller than this (in absolute value) will be formatted in scientific notation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The default minimum (1e-4). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let min = Float::format_default_scientific_min()?; - /// assert_eq!(min.format()?, "0.0001"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn format_default_scientific_min() -> Result { - let calldata = DecimalFloat::FORMAT_DEFAULT_SCIENTIFIC_MINCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::FORMAT_DEFAULT_SCIENTIFIC_MINCall::abi_decode_returns( - output.as_ref(), - )?; - Ok(Float(decoded)) - }) - } - - /// Returns the default maximum value for scientific notation formatting (1e9). - /// - /// Values larger than this (in absolute value) will be formatted in scientific notation. - /// - /// # Returns - /// - /// * `Ok(Float)` - The default maximum (1e9). - /// * `Err(FloatError)` - If the EVM call fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let max = Float::format_default_scientific_max()?; - /// assert_eq!(max.format()?, "1000000000"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn format_default_scientific_max() -> Result { - let calldata = DecimalFloat::FORMAT_DEFAULT_SCIENTIFIC_MAXCall {}.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::FORMAT_DEFAULT_SCIENTIFIC_MAXCall::abi_decode_returns( - output.as_ref(), - )?; - Ok(Float(decoded)) - }) - } - - /// Formats the float as a decimal string using default scientific notation range (1e-4 to 1e9). - /// - /// Values within the range [1e-4, 1e9] will use decimal notation. - /// Values outside this range will use scientific notation. - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Examples - /// - /// Values within the default range use decimal notation: - /// ``` - /// use rain_math_float::Float; - /// - /// // At the boundaries (inclusive) - /// assert_eq!(Float::parse("0.0001".to_string())?.format()?, "0.0001"); // 1e-4 - /// assert_eq!(Float::parse("1000000000".to_string())?.format()?, "1000000000"); // 1e9 - /// - /// // Within range - /// assert_eq!(Float::parse("2.5".to_string())?.format()?, "2.5"); - /// assert_eq!(Float::parse("123.456".to_string())?.format()?, "123.456"); - /// assert_eq!(Float::parse("0.001".to_string())?.format()?, "0.001"); - /// assert_eq!(Float::parse("1000000".to_string())?.format()?, "1000000"); - /// - /// anyhow::Ok(()) - /// ``` - /// - /// Values outside the default range use scientific notation: - /// ``` - /// use rain_math_float::Float; - /// - /// // Smaller than 1e-4 - /// assert_eq!(Float::parse("0.00001".to_string())?.format()?, "1e-5"); - /// assert_eq!(Float::parse("0.000001".to_string())?.format()?, "1e-6"); - /// - /// // Larger than 1e9 - /// assert_eq!(Float::parse("10000000000".to_string())?.format()?, "1e10"); - /// assert_eq!(Float::parse("123000000000".to_string())?.format()?, "1.23e11"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn format(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::format_1Call { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::format_1Call::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Formats the float as a decimal string with explicit scientific notation control. - /// - /// # Arguments - /// - /// * `scientific` - If true, always use scientific notation. If false, use decimal notation. - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let float = Float::parse("3.14".to_string())?; - /// assert_eq!(float.format_with_scientific(false)?, "3.14"); - /// assert_eq!(float.format_with_scientific(true)?, "3.14"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn format_with_scientific(self, scientific: bool) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::format_0Call { a, scientific }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::format_0Call::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Formats the float as a decimal string with a custom scientific notation range. - /// - /// # Arguments - /// - /// * `scientific_min` - Values smaller than this (in absolute value) use scientific notation. - /// * `scientific_max` - Values larger than this (in absolute value) use scientific notation. - /// - /// # Returns - /// - /// * `Ok(String)` - The formatted string. - /// * `Err(FloatError)` - If formatting fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let float = Float::parse("0.001".to_string())?; - /// let min = Float::parse("0.01".to_string())?; - /// let max = Float::parse("100".to_string())?; - /// assert_eq!(float.format_with_range(min, max)?, "1e-3"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn format_with_range( - self, - scientific_min: Self, - scientific_max: Self, - ) -> Result { - let Float(a) = self; - let Float(scientific_min_inner) = scientific_min; - let Float(scientific_max_inner) = scientific_max; - let calldata = DecimalFloat::format_2Call { - a, - scientificMin: scientific_min_inner, - scientificMax: scientific_max_inner, - } - .abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::format_2Call::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Returns `true` if `self` is less than `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is less than `b`. - /// * `Ok(false)` if `self` is not less than `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("1.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// assert!(a.lt(b)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn lt(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::ltCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::ltCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Returns `true` if `self` is equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is equal to `b`. - /// * `Ok(false)` if `self` is not equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("3.14".to_string())?; - /// let b = Float::parse("3.14".to_string())?; - /// assert!(a.eq(b)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn eq(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::eqCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::eqCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Returns `true` if `self` is greater than `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is greater than `b`. - /// * `Ok(false)` if `self` is not greater than `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("5.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// assert!(a.gt(b)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn gt(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::gtCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::gtCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Returns the multiplicative inverse of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The inverse. - /// * `Err(FloatError)` - If inversion fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("2.0".to_string())?; - /// let inv = x.inv()?; - /// assert!(inv.format()?.starts_with("0.5")); - /// - /// anyhow::Ok(()) - /// ``` - pub fn inv(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::invCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::invCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the absolute value of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The absolute value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("-3.14".to_string())?; - /// let abs = x.abs()?; - /// assert_eq!(abs.format()?, "3.14"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn abs(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::absCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::absCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns `true` if `self` is less than or equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is less than or equal to `b`. - /// * `Ok(false)` if `self` is not less than or equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("1.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// assert!(a.lte(b)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn lte(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::lteCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::lteCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } - - /// Returns `true` if `self` is greater than or equal to `b`. - /// - /// # Arguments - /// - /// * `b` - The `Float` value to compare with `self`. - /// - /// # Returns - /// - /// * `Ok(true)` if `self` is greater than or equal to `b`. - /// * `Ok(false)` if `self` is not greater than or equal to `b`. - /// * `Err(FloatError)` if the comparison fails due to an error in the underlying EVM call or decoding. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("2.0".to_string())?; - /// let b = Float::parse("1.0".to_string())?; - /// assert!(a.gte(b)?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn gte(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::gteCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::gteCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } -} - -impl Add for Float { - type Output = Result; - - /// Adds two floats. - /// - /// # Returns - /// - /// * `Ok(Float)` - The sum. - /// * `Err(FloatError)` - If addition fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("1.5".to_string())?; - /// let b = Float::parse("2.5".to_string())?; - /// let sum = (a + b)?; - /// assert_eq!(sum.format()?, "4"); - /// - /// anyhow::Ok(()) - /// ``` - fn add(self, b: Self) -> Self::Output { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::addCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::addCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } -} - -impl Sub for Float { - type Output = Result; - - /// Subtracts `b` from `self`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The difference. - /// * `Err(FloatError)` - If subtraction fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("5.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// let diff = (a - b)?; - /// assert_eq!(diff.format()?, "3"); - /// - /// anyhow::Ok(()) - /// ``` - fn sub(self, b: Self) -> Self::Output { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::subCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::subCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } -} - -impl Mul for Float { - type Output = Result; - - /// Multiplies two floats. - /// - /// # Returns - /// - /// * `Ok(Float)` - The product. - /// * `Err(FloatError)` - If multiplication fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("2.0".to_string())?; - /// let b = Float::parse("3.0".to_string())?; - /// let product = (a * b)?; - /// assert_eq!(product.format()?, "6"); - /// - /// anyhow::Ok(()) - /// ``` - fn mul(self, b: Self) -> Self::Output { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::mulCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::mulCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } -} - -impl Div for Float { - type Output = Result; - - /// Divides `self` by `b`. - /// - /// # Returns - /// - /// * `Ok(Float)` - The quotient. - /// * `Err(FloatError)` - If division fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("6.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// let quotient = (a / b)?; - /// assert_eq!(quotient.format()?, "3"); - /// - /// anyhow::Ok(()) - /// ``` - fn div(self, b: Self) -> Self::Output { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::divCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::divCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } -} - -impl Float { - /// Returns the integer part of the float (truncation toward zero). - /// - /// # Returns - /// - /// * `Ok(Float)` - The integer part. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("3.75".to_string())?; - /// let int = x.integer()?; - /// assert_eq!(int.format()?, "3"); - /// - /// let y = Float::parse("-3.75".to_string())?; - /// let int_y = y.integer()?; - /// assert_eq!(int_y.format()?, "-3"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn integer(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::integerCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::integerCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the fractional part of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The fractional part. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("3.75".to_string())?; - /// let frac = x.frac()?; - /// assert_eq!(frac.format()?, "0.75"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn frac(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::fracCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::fracCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the floor of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The floored value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("3.75".to_string())?; - /// let floor = x.floor()?; - /// assert_eq!(floor.format()?, "3"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn floor(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::floorCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::floorCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the minimum of `self` and `b`. - /// - /// # Arguments - /// - /// * `b` - The other `Float` to compare with. - /// - /// # Returns - /// - /// * `Ok(Float)` - The minimum value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("1.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// let min = a.min(b)?; - /// assert_eq!(min.format()?, "1"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn min(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::minCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::minCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Returns the maximum of `self` and `b`. - /// - /// # Arguments - /// - /// * `b` - The other `Float` to compare with. - /// - /// # Returns - /// - /// * `Ok(Float)` - The maximum value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let a = Float::parse("1.0".to_string())?; - /// let b = Float::parse("2.0".to_string())?; - /// let max = a.max(b)?; - /// assert_eq!(max.format()?, "2"); - /// - /// anyhow::Ok(()) - /// ``` - pub fn max(self, b: Self) -> Result { - let Float(a) = self; - let Float(b) = b; - let calldata = DecimalFloat::maxCall { a, b }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::maxCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } - - /// Checks if the float is zero. - /// - /// # Returns - /// - /// * `Ok(true)` if the float is zero. - /// * `Ok(false)` if the float is not zero. - /// * `Err(FloatError)` if the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let zero = Float::parse("0".to_string())?; - /// assert!(zero.is_zero()?); - /// let nonzero = Float::parse("1.23".to_string())?; - /// assert!(!nonzero.is_zero()?); - /// - /// anyhow::Ok(()) - /// ``` - pub fn is_zero(self) -> Result { - let Float(a) = self; - let calldata = DecimalFloat::isZeroCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::isZeroCall::abi_decode_returns(output.as_ref())?; - Ok(decoded) - }) - } -} - -impl Neg for Float { - type Output = Result; - - /// Returns the negation of the float. - /// - /// # Returns - /// - /// * `Ok(Float)` - The negated value. - /// * `Err(FloatError)` - If the operation fails. - /// - /// # Example - /// - /// ``` - /// use rain_math_float::Float; - /// - /// let x = Float::parse("3.14".to_string())?; - /// let neg = (-x)?; - /// assert_eq!(neg.format()?, "-3.14"); - /// - /// anyhow::Ok(()) - /// ``` - fn neg(self) -> Self::Output { - let Float(a) = self; - let calldata = DecimalFloat::minusCall { a }.abi_encode(); - - execute_call(Bytes::from(calldata), |output| { - let decoded = DecimalFloat::minusCall::abi_decode_returns(output.as_ref())?; - Ok(Float(decoded)) - }) - } -} - -impl From for Float { - fn from(value: B256) -> Self { - Float(value) - } -} - -impl From for B256 { - fn from(value: Float) -> Self { - value.0 - } -} - -#[cfg(test)] -mod tests { - use crate::DecimalFloat::DecimalFloatErrors; - - use super::*; - use core::str::FromStr; - use proptest::prelude::*; - use serde_json::json; - - /// Float::default() equals parsed "0". - #[test] - fn test_default() { - let zero = Float::parse("0".to_string()).unwrap(); - assert!(zero.eq(Float::default()).unwrap()); - } - - /// Float::zero() is_zero, formats as "0", equals parsed "0" and default. - #[test] - fn test_zero() { - let zero = Float::zero().unwrap(); - assert!(zero.is_zero().unwrap()); - assert_eq!(zero.format().unwrap(), "0"); - - // Test that zero equals parsed zero - let parsed_zero = Float::parse("0".to_string()).unwrap(); - assert!(zero.eq(parsed_zero).unwrap()); - - // Test that zero equals default - assert!(zero.eq(Float::default()).unwrap()); - } - - prop_compose! { - fn arb_float()( - coefficient in any::(), - exponent in any::(), - ) -> Float { - Float::pack_lossless(coefficient, exponent).unwrap() - } - } - - prop_compose! { - fn reasonable_float()( - int_part in -10i128.pow(18)..10i128.pow(18), - decimal_part in 0u128..10u128.pow(18u32) - ) -> Float { - let num_str = if decimal_part == 0 { - format!("{int_part}") - } else { - format!("{int_part}.{decimal_part}") - }; - - Float::parse(num_str).unwrap() - } - } - - /// JSON serialize then deserialize preserves equality and hex representation. - #[test] - fn test_serde() { - let float = Float::parse("1.1341234234625468391".to_string()).unwrap(); - let serialized = serde_json::to_string(&float).unwrap(); - assert_eq!( - serialized, - json!("0xffffffed00000000000000000000000000000000000000009d642872ad59a7e7").to_string() - ); - let deserialized: Float = serde_json::from_str(&serialized).unwrap(); - assert!(float.eq(deserialized).unwrap()); - } - - proptest! { - #[test] - /// JSON round-trip preserves equality and serialized form for all floats. - fn proptest_serde(float in arb_float()) { - let serialized = serde_json::to_string(&float).unwrap(); - let deserialized: Float = serde_json::from_str(&serialized).unwrap(); - prop_assert!(float.eq(deserialized).unwrap()); - let re_serialized = serde_json::to_string(&deserialized).unwrap(); - prop_assert_eq!(serialized, re_serialized); - } - } - - /// Parsing an empty string returns a DecimalFloatSelector error. - #[test] - fn test_parse_empty_string_error() { - let err = Float::parse("".to_string()).unwrap_err(); - // We don't know the exact selector here, just ensure the error path is hit. - assert!(matches!(err, FloatError::DecimalFloatSelector(_))); - } - - #[test] - fn test_parse_exponent_overflow_error() { - // Extremely large exponent expected to overflow (exponent >> i32::MAX). - let err = Float::parse("1e3000000000".to_string()).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentOverflow(_)) - )); - } - - /// Malformed inputs ("1.2.3", "abc") return specific error selectors. - #[test] - fn test_parse_edge_cases() { - let err = Float::parse("1.2.3".to_string()).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloatSelector(Err(selector)) - if selector == fixed_bytes!("ad384e87") - )); - - let err = Float::parse("abc".to_string()).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloatSelector(Err(selector)) - if selector == fixed_bytes!("34bd2069") - )); - } - - /// Boundary constants are distinct, correctly signed, correctly ordered, - /// and bound normal values like 1 and -1. - #[test] - fn test_float_constants() { - // Test that all constant methods return valid floats - let max_pos = Float::max_positive_value().unwrap(); - let min_pos = Float::min_positive_value().unwrap(); - let max_neg = Float::max_negative_value().unwrap(); - let min_neg = Float::min_negative_value().unwrap(); - - let zero = Float::parse("0".to_string()).unwrap(); - - // Test mathematical properties without exposing binary representation - - // All constants should be distinct - assert!(!max_pos.eq(min_pos).unwrap()); - assert!(!max_neg.eq(min_neg).unwrap()); - assert!(!max_pos.eq(max_neg).unwrap()); - assert!(!min_pos.eq(min_neg).unwrap()); - - // Test sign properties - assert!(min_pos.gt(zero).unwrap()); // min positive should be > 0 - assert!(max_pos.gt(zero).unwrap()); // max positive should be > 0 - assert!(max_neg.lt(zero).unwrap()); // max negative should be < 0 - assert!(min_neg.lt(zero).unwrap()); // min negative should be < 0 - - // Test ordering relationships - assert!(min_pos.lt(max_pos).unwrap()); // min positive < max positive - assert!(min_neg.lt(max_neg).unwrap()); // min negative < max negative - - // Test boundary properties - let one = Float::parse("1".to_string()).unwrap(); - let neg_one = Float::parse("-1".to_string()).unwrap(); - - // Positive constants should be greater than normal values - assert!(max_pos.gt(one).unwrap()); - assert!(min_pos.lt(one).unwrap()); - - // Negative constants should be more extreme than normal negative values - assert!(max_neg.gt(neg_one).unwrap()); - assert!(min_neg.lt(neg_one).unwrap()); - } - - proptest! { - #[test] - /// format() then parse() round-trips to an equal value. - fn test_format_parse(float in reasonable_float()) { - let formatted = float.format().unwrap(); - let parsed = Float::parse(formatted.clone()).unwrap(); - prop_assert!(float.eq(parsed).unwrap()); - } - } - - proptest! { - #[test] - /// as_hex() then from_hex() round-trips to identical hex. - fn test_as_from_hex(float in arb_float()) { - let hex = float.as_hex(); - let parsed = Float::from_hex(&hex).unwrap(); - prop_assert_eq!(parsed.as_hex(), hex); - } - } - - /// Adding two max-exponent floats overflows with ExponentOverflow. - #[test] - fn test_add_exponent_overflow_error() { - let max_coeff_str = "13479973333575319897333507543509815336818572211270286240551805124607"; - let large_coeff_i224 = I224::from_str(max_coeff_str).unwrap(); - let exponent_max = i32::MAX; - - let a = Float::pack_lossless(large_coeff_i224, exponent_max).unwrap(); - - let err = (a + a).unwrap_err(); - - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentOverflow(_)) - )); - } - - /// Subtracting opposite-sign max-exponent floats overflows. - #[test] - fn test_sub_exponent_overflow_error() { - let max_coeff_str = "13479973333575319897333507543509815336818572211270286240551805124607"; - let large_coeff_i224 = I224::from_str(max_coeff_str).unwrap(); - let exponent_max = i32::MAX; - - let a = Float::pack_lossless(large_coeff_i224, exponent_max).unwrap(); - let b = Float::pack_lossless(-large_coeff_i224, exponent_max).unwrap(); - - let err = (b - a).unwrap_err(); - - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentOverflow(_)) - )); - } - - proptest! { - #[test] - /// Addition does not panic for reasonable inputs. - fn test_add(a in reasonable_float(), b in reasonable_float()) { - (a + b).unwrap(); - } - } - - proptest! { - #[test] - /// Subtraction does not panic for reasonable inputs. - fn test_sub(a in reasonable_float(), b in reasonable_float()) { - (a - b).unwrap(); - } - } - - proptest! { - #[test] - /// (a + b) - b == a: subtraction inverts addition. - fn test_add_sub(a in reasonable_float(), b in reasonable_float()) { - let sum = (a + b).unwrap(); - let diff = (sum - b).unwrap(); - prop_assert_eq!( - a.format().unwrap(), - diff.format().unwrap(), - "a: {}, b: {}", - a.format().unwrap(), - b.format().unwrap(), - ); - } - } - - /// Manual check: -1 < 0 < 3, with correct lt/eq/gt for each pair. - #[test] - fn test_lt_eq_gt() { - let negone = Float::parse("-1".to_string()).unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - let three = Float::parse("3".to_string()).unwrap(); - - assert!(negone.lt(zero).unwrap()); - assert!(!negone.eq(zero).unwrap()); - assert!(!negone.gt(zero).unwrap()); - - assert!(!three.lt(zero).unwrap()); - assert!(!three.eq(zero).unwrap()); - assert!(three.gt(zero).unwrap()); - - assert!(zero.lt(three).unwrap()); - assert!(!zero.eq(three).unwrap()); - assert!(!zero.gt(three).unwrap()); - } - - proptest! { - #[test] - /// a == a, a-1 < a, a+1 > a for all reasonable floats. - fn test_lt_eq_gt_with_add(a in reasonable_float()) { - let b = a; - let eq = a.eq(b).unwrap(); - prop_assert!(eq); - - let one = Float::parse("1".to_string()).unwrap(); - - let a = (a - one).unwrap(); - let lt = a.lt(b).unwrap(); - prop_assert!(lt); - - let a = (a + one).unwrap(); - let eq = a.eq(b).unwrap(); - prop_assert!(eq); - - let a = (a + one).unwrap(); - let gt = a.gt(b).unwrap(); - prop_assert!(gt); - } - - #[test] - /// Trichotomy: exactly one of lt, eq, gt is true for any two floats. - fn test_exactly_one_lt_eq_gt(a in arb_float(), b in arb_float()) { - let eq = a.eq(b).unwrap(); - let lt = a.lt(b).unwrap(); - let gt = a.gt(b).unwrap(); - - let a_str = a.show_unpacked().unwrap(); - let b_str = b.show_unpacked().unwrap(); - - prop_assert!(lt || eq || gt, "a: {a_str}, b: {b_str}"); - prop_assert!(!(lt && eq), "both less than and equal: a: {a_str}, b: {b_str}"); - prop_assert!(!(eq && gt), "both equal and greater than: a: {a_str}, b: {b_str}"); - prop_assert!(!(lt && gt), "both less than and greater than: a: {a_str}, b: {b_str}"); - } - } - - /// abs(-x) == abs(x) == |x| for manual positive, negative, and zero cases. - #[test] - fn test_abs() { - let float = Float::parse("-3613.1324123".to_string()).unwrap(); - let abs = float.abs().unwrap(); - let formatted = abs.format().unwrap(); - assert_eq!(formatted, "3613.1324123"); - - let float = Float::parse("3613.1324123".to_string()).unwrap(); - let abs = float.abs().unwrap(); - let formatted = abs.format().unwrap(); - assert_eq!(formatted, "3613.1324123"); - - let float = Float::parse("0".to_string()).unwrap(); - let abs = float.abs().unwrap(); - let formatted = abs.format().unwrap(); - assert_eq!(formatted, "0"); - } - - proptest! { - #[test] - /// Multiplication does not panic for reasonable inputs. - fn test_mul(a in reasonable_float(), b in reasonable_float()) { - (a * b).unwrap(); - } - } - - /// Negating a negative produces positive format; negating zero stays "0". - #[test] - fn test_minus_format() { - let float = Float::parse("-123.1234234625468391".to_string()).unwrap(); - let negated = float.neg().unwrap(); - - let formatted_decimal = negated.format_with_scientific(false).unwrap(); - assert_eq!(formatted_decimal, "123.1234234625468391"); - - let float = Float::parse("0".to_string()).unwrap(); - let negated = float.neg().unwrap(); - let formatted = negated.format().unwrap(); - assert_eq!(formatted, "0"); - } - - proptest! { - #[test] - /// Double negation is identity: -(-a) == a. - fn test_minus_minus(float in arb_float()) { - let negated = float.neg().unwrap(); - let renegated = negated.neg().unwrap(); - prop_assert!(float.eq(renegated).unwrap()); - } - } - - proptest! { - #[test] - /// a * inv(a) ≈ 1 within ±1e-37 for nonzero a. - fn test_inv_prod(float in reasonable_float()) { - let zero = Float::parse("0".to_string()).unwrap(); - prop_assume!(!float.eq(zero).unwrap()); - - let inv = float.inv().unwrap(); - let product = (float * inv).unwrap(); - let one = Float::parse("1".to_string()).unwrap(); - - // Allow for minor rounding errors introduced by the lossy - // `inv` implementation. We consider the property to - // hold if the product is within `±1e-37` of 1. - - let eps = Float::parse("1e-37".to_string()).unwrap(); - let one_plus_eps = (one + eps).unwrap(); - let one_minus_eps = (one - eps).unwrap(); - - let within_upper = !product.gt(one_plus_eps).unwrap(); - let within_lower = !product.lt(one_minus_eps).unwrap(); - - prop_assert!( - within_upper && within_lower, - "float: {}, inv: {}, product: {} (not within ±ε)", - float.show_unpacked().unwrap(), - inv.show_unpacked().unwrap(), - product.show_unpacked().unwrap(), - ); - } - } - - proptest! { - #[test] - /// abs() never produces a string starting with "-". - fn test_abs_no_minus_sign(float in reasonable_float()) { - let abs = float.abs().unwrap(); - let formatted = abs.format().unwrap(); - prop_assert!(!formatted.starts_with("-")); - } - - #[test] - /// abs is idempotent: abs(abs(a)) == abs(a). - fn test_abs_abs(float in arb_float()) { - let abs = float.abs().unwrap(); - let abs_abs = abs.abs().unwrap(); - prop_assert!(abs.eq(abs_abs).unwrap()); - } - } - - proptest! { - #[test] - /// Division does not panic for nonzero divisor. - fn test_div(a in reasonable_float(), b in reasonable_float()) { - let zero = Float::parse("0".to_string()).unwrap(); - prop_assume!(!b.eq(zero).unwrap()); - - (a / b).unwrap(); - } - } - - prop_compose! { - fn small_int_float()(int_part in -1_000_000_000_000i128..1_000_000_000_000i128) -> Float { - Float::parse(int_part.to_string()).unwrap() - } - } - - proptest! { - #[test] - /// (a * b) / b == a: division inverts multiplication for small integers. - fn test_mul_div_int(a in small_int_float(), b in small_int_float()) { - let zero = Float::parse("0".to_string()).unwrap(); - prop_assume!(!b.eq(zero).unwrap()); - - let product = (a * b).unwrap(); - let quotient = (product / b).unwrap(); - - prop_assert!( - a.eq(quotient).unwrap(), - "a: {}, quotient: {}, b: {}", - a.show_unpacked().unwrap(), - quotient.show_unpacked().unwrap(), - b.show_unpacked().unwrap() - ); - } - } - - /// 6/3 == 2 and 2*3 == 6. - #[test] - fn test_mul_div_manual() { - let two = Float::parse("2".to_string()).unwrap(); - let three = Float::parse("3".to_string()).unwrap(); - let six = Float::parse("6".to_string()).unwrap(); - - assert!(two.eq((six / three).unwrap()).unwrap()); - assert!(six.eq((two * three).unwrap()).unwrap()); - } - - /// 1/0 returns DivisionByZero error. - #[test] - fn test_divide_by_zero_error() { - let one = Float::parse("1".to_string()).unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - let err = (one / zero).unwrap_err(); - - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::DivisionByZero(_)) - )); - } - - /// Multiplying near-max exponents overflows. - #[test] - fn test_mul_exponent_overflow_error() { - let near_max_exp = Float::parse("1e2147483646".to_string()).unwrap(); - let one_e_two = Float::parse("1e2".to_string()).unwrap(); - - let err = (near_max_exp * one_e_two).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentOverflow(_)) - )); - } - - /// Dividing near-max exponent by small exponent overflows. - #[test] - fn test_div_exponent_overflow_error() { - let near_max_exp = Float::parse("1e2147483646".to_string()).unwrap(); - let one_e_neg_hundred = Float::parse("1e-100".to_string()).unwrap(); - - let err = (near_max_exp / one_e_neg_hundred).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentOverflow(_)) - )); - } - - /// Multiplying near-min exponents underflows; the public arithmetic - /// surface reverts with `ExponentUnderflow` rather than silently - /// producing zero. - #[test] - fn test_mul_exponent_underflow_error() { - let near_min_exp = Float::parse("1e-2147483646".to_string()).unwrap(); - let one_e_neg_three = Float::parse("1e-3".to_string()).unwrap(); - - let err = (near_min_exp * one_e_neg_three).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::ExponentUnderflow(_)) - )); - } - - /// from_fixed_decimal for known value/decimals pairs matches parsed strings. - #[test] - fn test_from_fixed_decimal() { - let cases = vec![ - (U256::from(0u128), 0u8, "0"), - (U256::from(0u128), 18u8, "0"), - (U256::from(1u128), 18u8, "1e-18"), - (U256::from(123456789u128), 0u8, "123456789"), - (U256::from(123456789u128), 2u8, "123456789e-2"), - (U256::from(1000000000000000000u128), 18u8, "1"), - ]; - - for (amount, decimals, expected) in cases { - let float = Float::from_fixed_decimal(amount, decimals).expect("should convert"); - let expected = Float::parse(expected.to_string()).unwrap(); - assert!(float.eq(expected).unwrap()); - } - } - - /// U256::MAX with 1 decimal overflows (LossyConversionToFloat). - #[test] - fn test_from_fixed_decimal_err() { - let err = Float::from_fixed_decimal(U256::MAX, 1).unwrap_err(); - assert!(matches!( - err, - FloatError::DecimalFloat(e) if matches!(*e, DecimalFloatErrors::LossyConversionToFloat(_)) - )); - } - - /// to_fixed_decimal for known inputs matches expected U256 values. - #[test] - fn test_to_fixed_decimal() { - let cases = vec![ - ("0", 0u8, 0u128), - ("0", 18u8, 0u128), - ("1e-18", 18u8, 1u128), - ("123456789", 0u8, 123456789u128), - ("123456789e-2", 2u8, 123456789u128), - ("1", 18u8, 1000000000000000000u128), - ]; - - for (input, decimals, expected) in cases { - let float = Float::parse(input.to_string()).unwrap(); - let fixed = float.to_fixed_decimal(decimals).unwrap(); - assert_eq!(fixed, U256::from(expected)); - } - } - - /// For integers: floor == self, frac == 0, and floor + frac == self. - #[test] - fn test_frac_and_floor_integers() { - let int_float = Float::parse("12345".to_string()).unwrap(); - let floor = int_float.floor().unwrap(); - let frac = int_float.frac().unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - - assert!(int_float.eq(floor).unwrap()); - assert!(frac.eq(zero).unwrap()); - - let int_float = Float::parse("-98765".to_string()).unwrap(); - let floor = int_float.floor().unwrap(); - let frac = int_float.frac().unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - - assert!(int_float.eq(floor).unwrap()); - assert!(frac.eq(zero).unwrap()); - - let recombined = (floor + frac).unwrap(); - assert!(int_float.eq(recombined).unwrap()); - } - - /// floor(12345.6789) == 12345, frac(12345.6789) == 0.6789. - #[test] - fn test_frac_and_floor_floats() { - let float = Float::parse("12345.6789".to_string()).unwrap(); - let floor = float.floor().unwrap(); - let frac = float.frac().unwrap(); - - let expected_floor = Float::parse("12345".to_string()).unwrap(); - let expected_frac = Float::parse("0.6789".to_string()).unwrap(); - - assert!(floor.eq(expected_floor).unwrap()); - assert!(frac.eq(expected_frac).unwrap()); - } - - /// integer(12345.6789) == 12345, and integer + frac == original. - #[test] - fn test_integer_positive() { - let float = Float::parse("12345.6789".to_string()).unwrap(); - let int = float.integer().unwrap(); - let expected = Float::parse("12345".to_string()).unwrap(); - assert!(int.eq(expected).unwrap()); - - let frac = float.frac().unwrap(); - let recombined = (int + frac).unwrap(); - assert!(float.eq(recombined).unwrap()); - } - - /// integer truncates toward zero: integer(-12345.6789) == -12345. - #[test] - fn test_integer_negative() { - let float = Float::parse("-12345.6789".to_string()).unwrap(); - let int = float.integer().unwrap(); - let frac = float.frac().unwrap(); - - // integer truncates toward zero, so -12345.6789 -> -12345 - let expected_int = Float::parse("-12345".to_string()).unwrap(); - let expected_frac = Float::parse("-0.6789".to_string()).unwrap(); - - assert!(int.eq(expected_int).unwrap()); - assert!(frac.eq(expected_frac).unwrap()); - - // integer + frac == original - let recombined = (int + frac).unwrap(); - assert!(float.eq(recombined).unwrap()); - } - - /// integer(42) == 42, frac(42) == 0 for positive and negative whole numbers. - #[test] - fn test_integer_whole_numbers() { - let pos = Float::parse("42".to_string()).unwrap(); - assert!(pos.integer().unwrap().eq(pos).unwrap()); - let zero = Float::parse("0".to_string()).unwrap(); - assert!(pos.frac().unwrap().eq(zero).unwrap()); - - let neg = Float::parse("-42".to_string()).unwrap(); - assert!(neg.integer().unwrap().eq(neg).unwrap()); - assert!(neg.frac().unwrap().eq(zero).unwrap()); - } - - proptest! { - #[test] - /// from_fixed_decimal then to_fixed_decimal round-trips for any non-negative I224. - fn test_from_to_fixed_decimal_valid_range(coeff in any::(), decimals in 0u8..=66u8) { - prop_assume!(coeff >= I224::ZERO); - - let exponent = -(decimals as i32); - let value = U256::from(coeff); - - let float = Float::from_fixed_decimal(value, decimals).unwrap(); - let expected = Float::pack_lossless(coeff, exponent).unwrap(); - prop_assert!(float.eq(expected).unwrap()); - - let fixed = float.to_fixed_decimal(decimals).unwrap(); - assert_eq!(fixed, value); - } - } - - proptest! { - #[test] - /// integer(a) + frac(a) == a, frac has no integer part, integer has - /// no fractional part, and |frac| < 1. - fn test_int_frac_properties(float in arb_float()) { - let int = float.integer().unwrap(); - let frac = float.frac().unwrap(); - - let zero = Float::parse("0".to_string()).unwrap(); - - prop_assert!( - int.frac().unwrap().eq(zero).unwrap(), - "int.frac() is not zero: {}", - int.show_unpacked().unwrap() - ); - - prop_assert!( - frac.integer().unwrap().eq(zero).unwrap(), - "frac.integer() is not zero: {}", - frac.show_unpacked().unwrap() - ); - - let recombined = (int + frac).unwrap(); - prop_assert!( - float.eq(recombined).unwrap(), - "original: {}, int: {}, frac: {}, recombined: {}", - float.show_unpacked().unwrap(), - int.show_unpacked().unwrap(), - frac.show_unpacked().unwrap(), - recombined.show_unpacked().unwrap() - ); - - let one = Float::parse("1".to_string()).unwrap(); - let neg_one = one.neg().unwrap(); - prop_assert!( - frac.lt(one).unwrap(), - "frac not < 1: {}", - frac.show_unpacked().unwrap() - ); - prop_assert!( - frac.gt(neg_one).unwrap(), - "frac not > -1: {}", - frac.show_unpacked().unwrap() - ); - } - } - - /// min/max for known value pairs, including identical arguments. - #[test] - fn test_min_max_manual() { - let negone = Float::parse("-1".to_string()).unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - let three = Float::parse("3".to_string()).unwrap(); - let seven = Float::parse("7".to_string()).unwrap(); - - // --- min --- - assert!(negone.eq(negone.min(zero).unwrap()).unwrap()); - assert!(negone.eq(negone.min(three).unwrap()).unwrap()); - assert!(zero.eq(zero.min(three).unwrap()).unwrap()); - // min with identical arguments should return that argument - assert!(seven.eq(seven.min(seven).unwrap()).unwrap()); - - // --- max --- - assert!(zero.eq(negone.max(zero).unwrap()).unwrap()); - assert!(three.eq(negone.max(three).unwrap()).unwrap()); - assert!(three.eq(zero.max(three).unwrap()).unwrap()); - // max with identical arguments should return that argument - assert!(seven.eq(seven.max(seven).unwrap()).unwrap()); - } - - /// is_zero for "0", "-0", "0.0" (all true) and "1" (false). - #[test] - fn test_is_zero_manual() { - let zero = Float::parse("0".to_string()).unwrap(); - assert!(zero.is_zero().unwrap()); - - // Alternative zero representations that should also be considered zero. - let neg_zero = Float::parse("-0".to_string()).unwrap(); - assert!(neg_zero.is_zero().unwrap()); - let zero_point = Float::parse("0.0".to_string()).unwrap(); - assert!(zero_point.is_zero().unwrap()); - - let one = Float::parse("1".to_string()).unwrap(); - assert!(!one.is_zero().unwrap()); - } - - proptest! { - #[test] - /// min(a,b) <= both, max(a,b) >= both, each equals one operand, - /// and min <= max. - fn test_min_max_properties(a in reasonable_float(), b in reasonable_float()) { - let min = a.min(b).unwrap(); - let max = a.max(b).unwrap(); - - prop_assert!( - !min.gt(a).unwrap(), - "min > a: min={}, a={}", - min.show_unpacked().unwrap(), - a.show_unpacked().unwrap() - ); - prop_assert!( - !min.gt(b).unwrap(), - "min > b: min={}, b={}", - min.show_unpacked().unwrap(), - b.show_unpacked().unwrap() - ); - - prop_assert!( - !max.lt(a).unwrap(), - "max < a: max={}, a={}", - max.show_unpacked().unwrap(), - a.show_unpacked().unwrap() - ); - prop_assert!( - !max.lt(b).unwrap(), - "max < b: max={}, b={}", - max.show_unpacked().unwrap(), - b.show_unpacked().unwrap() - ); - - let min_is_a = min.eq(a).unwrap(); - let min_is_b = min.eq(b).unwrap(); - prop_assert!( - min_is_a || min_is_b, - "min is not equal to either operand: a={}, b={}, min={}", - a.show_unpacked().unwrap(), - b.show_unpacked().unwrap(), - min.show_unpacked().unwrap() - ); - - let max_is_a = max.eq(a).unwrap(); - let max_is_b = max.eq(b).unwrap(); - prop_assert!( - max_is_a || max_is_b, - "max is not equal to either operand: a={}, b={}, max={}", - a.show_unpacked().unwrap(), - b.show_unpacked().unwrap(), - max.show_unpacked().unwrap() - ); - - prop_assert!( - !min.gt(max).unwrap(), - "min > max: min={}, max={}", - min.show_unpacked().unwrap(), - max.show_unpacked().unwrap() - ); - } - } - - /// Manual lte/gte checks: -1 <= 0 <= 3, 0 >= -1, 3 >= 0. - #[test] - fn test_lte_gte() { - let negone = Float::parse("-1".to_string()).unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - let three = Float::parse("3".to_string()).unwrap(); - - assert!(negone.lte(zero).unwrap()); - assert!(zero.lte(three).unwrap()); - assert!(negone.lte(three).unwrap()); - - assert!(zero.gte(negone).unwrap()); - assert!(three.gte(zero).unwrap()); - assert!(three.gte(negone).unwrap()); - } - - proptest! { - #[test] - /// a-1 lte a, a lte a and gte a, a+1 gte a. - fn test_lte_gte_fuzz(a in reasonable_float()) { - let b = a; - let one = Float::parse("1".to_string()).unwrap(); - - let a = (a - one).unwrap(); - let lte = a.lte(b).unwrap(); - prop_assert!(lte); // lt - - let a = (a + one).unwrap(); - let gte = a.gte(b).unwrap(); - let lte = a.lte(b).unwrap(); - prop_assert!(gte); // eq - prop_assert!(lte); // eq - - let a = (a + one).unwrap(); - let gte = a.gte(b).unwrap(); - prop_assert!(gte); // gt - } - } - - /// from_fixed_decimal_lossy: lossless for small values, lossy for U256::MAX. - #[test] - fn test_from_fixed_decimal_lossy() { - // Test lossless conversions (values that fit in Float's precision) - let lossless_cases = vec![ - (U256::from(0u128), 0u8, "0"), - (U256::from(0u128), 18u8, "0"), - (U256::from(1u128), 18u8, "1e-18"), - (U256::from(123456789u128), 0u8, "123456789"), - (U256::from(123456789u128), 2u8, "123456789e-2"), - (U256::from(1000000000000000000u128), 18u8, "1"), - ]; - - for (amount, decimals, expected) in lossless_cases { - let (float, lossless) = - Float::from_fixed_decimal_lossy(amount, decimals).expect("should convert"); - let expected = Float::parse(expected.to_string()).unwrap(); - assert!(float.eq(expected).unwrap()); - assert!( - lossless, - "conversion should be lossless for amount={}, decimals={}", - amount, decimals - ); - } - - // Test lossy conversion with U256::MAX (too large to fit in Float's 224-bit coefficient) - let (float, lossless) = Float::from_fixed_decimal_lossy(U256::MAX, 1).unwrap(); - assert!(!lossless, "U256::MAX conversion should be lossy"); - assert!(!float.is_zero().unwrap(), "result should not be zero"); - } - - /// to_fixed_decimal_lossy: correctly reports lossy/lossless for precision loss. - #[test] - fn test_to_fixed_decimal_lossy() { - // Test lossy conversions (loss of precision) - let lossy_cases = vec![ - (U256::from(1), 18u8, 0u128), - (U256::from(123456789), 0u8, 12345678u128), - (U256::from(123456789), 2u8, 12345678u128), - ]; - - for (input, decimals, expected) in lossy_cases { - let float = Float::from_fixed_decimal(input, decimals + 1).unwrap(); - let (fixed, lossless) = float.to_fixed_decimal_lossy(decimals).unwrap(); - assert_eq!( - fixed, - U256::from(expected), - "wrong value for input={}, decimals={}", - input, - decimals - ); - assert!( - !lossless, - "should be lossy for input={}, decimals={}", - input, decimals - ); - } - - // Test lossless conversions (no loss of precision) - let lossless_cases = vec![ - // Zero is always lossless - (U256::from(0), 0u8, 0u128), - (U256::from(0), 18u8, 0u128), - // Converting 12340 with 3 decimals (12.340) to 2 decimals (12.34) is lossless - (U256::from(12340), 3u8, 1234u128), - ]; - - for (input, decimals, expected) in lossless_cases { - let float = Float::from_fixed_decimal(input, decimals + 1).unwrap(); - let (fixed, lossless) = float.to_fixed_decimal_lossy(decimals).unwrap(); - assert_eq!( - fixed, - U256::from(expected), - "wrong value for input={}, decimals={}", - input, - decimals - ); - assert!( - lossless, - "should be lossless for input={}, decimals={}", - input, decimals - ); - } - } - - proptest! { - #[test] - /// Lossy fixed-decimal round-trip: from(decimals+1) then to(decimals) is - /// lossy iff the last digit is nonzero. - fn test_from_to_fixed_decimal_lossy_valid_range(coeff in any::(), decimals in 0u8..=66u8) { - prop_assume!(coeff >= I224::ZERO); - - let exponent = -(decimals as i32 + 1); - let value = U256::from(coeff); - - let (float, from_lossless) = Float::from_fixed_decimal_lossy(value, decimals + 1).unwrap(); - let expected = Float::pack_lossless(coeff, exponent).unwrap(); - prop_assert!(float.eq(expected).unwrap()); - - // from_fixed_decimal_lossy should be lossless for values that fit in Float's precision - prop_assert!(from_lossless, "from_fixed_decimal_lossy should be lossless for coeff={coeff}"); - - let (fixed, to_lossless) = float.to_fixed_decimal_lossy(decimals).unwrap(); - assert_eq!(fixed, value / U256::from(10)); - - // Converting from decimals+1 to decimals should be lossy unless the value is zero or - // the last digit is zero (divisible by 10) - if value == U256::ZERO || value % U256::from(10) == U256::ZERO { - prop_assert!(to_lossless, "to_fixed_decimal_lossy should be lossless when last digit is 0: value={}", value); - } else { - prop_assert!(!to_lossless, "to_fixed_decimal_lossy should be lossy when losing precision: value={}", value); - } - } - } - - proptest! { - #[test] - /// All reasonable positive floats are bounded by min/max_positive_value, - /// all negative by min/max_negative_value. - fn test_constants_relationships(float in reasonable_float()) { - let max_pos = Float::max_positive_value().unwrap(); - let min_pos = Float::min_positive_value().unwrap(); - let max_neg = Float::max_negative_value().unwrap(); - let min_neg = Float::min_negative_value().unwrap(); - let zero = Float::parse("0".to_string()).unwrap(); - - // Test that constants are the extremes - // Any reasonable positive float should be <= max_positive and >= min_positive - if float.gt(zero).unwrap() { - prop_assert!(float.lte(max_pos).unwrap()); - prop_assert!(float.gte(min_pos).unwrap()); - } - - // Any reasonable negative float should be <= max_negative and >= min_negative - // (max_negative is closest to zero, min_negative is furthest from zero) - if float.lt(zero).unwrap() { - prop_assert!(float.lte(max_neg).unwrap()); - prop_assert!(float.gte(min_neg).unwrap()); - } - - // Constants should be consistent regardless of arbitrary float - prop_assert!(max_pos.gt(zero).unwrap()); - prop_assert!(min_pos.gt(zero).unwrap()); - prop_assert!(max_neg.lt(zero).unwrap()); - prop_assert!(min_neg.lt(zero).unwrap()); - - // Verify constants maintain their ordering - prop_assert!(min_pos.lt(max_pos).unwrap()); - prop_assert!(min_neg.lt(max_neg).unwrap()); - prop_assert!(max_neg.lt(zero).unwrap()); - prop_assert!(min_pos.gt(zero).unwrap()); - } - } - - proptest! { - #[test] - /// No arbitrary float exceeds max_positive or is below min_negative. - fn test_constants_edge_cases(float in arb_float()) { - let max_pos = Float::max_positive_value().unwrap(); - let min_pos = Float::min_positive_value().unwrap(); - let max_neg = Float::max_negative_value().unwrap(); - let min_neg = Float::min_negative_value().unwrap(); - - // Constants should always be distinct - prop_assert!(!max_pos.eq(min_pos).unwrap()); - prop_assert!(!max_neg.eq(min_neg).unwrap()); - prop_assert!(!max_pos.eq(max_neg).unwrap()); - prop_assert!(!min_pos.eq(min_neg).unwrap()); - - // Test that constants are at the boundaries - // (Note: We can't test arithmetic operations that would overflow/underflow - // since those would fail, but we can test comparisons) - - // No arbitrary float should be greater than max_pos or less than min_neg - if !float.eq(max_pos).unwrap() { - prop_assert!(!float.gt(max_pos).unwrap()); - } - if !float.eq(min_neg).unwrap() { - prop_assert!(!float.lt(min_neg).unwrap()); - } - } - } -} diff --git a/crates/float/src/tables.rs b/crates/float/src/tables.rs deleted file mode 100644 index 8f528894..00000000 --- a/crates/float/src/tables.rs +++ /dev/null @@ -1,644 +0,0 @@ -/// Independent generation of log/antilog lookup tables from f64 math. -/// Used to verify the hardcoded Solidity tables in LibLogTable.sol. -/// -/// ALT_TABLE_FLAG as used in LibLogTable.sol — bit 15 of a uint16. -pub const ALT_TABLE_FLAG: u16 = 0x8000; - -/// Generate the main log table: uint16[10][90]. -/// -/// Standard 4-figure log table layout. Row r (0-89) and column c (0-9) -/// represent the 3-digit mantissa prefix (10+r) and third digit c, so -/// the looked-up number is n = (10+r)*100 + c*10, ranging from 1000 to -/// 9990. The stored value is the fractional part of log10(n) scaled by -/// 10000: round((log10(n) - 3) * 10000). -/// -/// ALT_TABLE_FLAG is set on entries where the small alt table provides -/// different (more precise) mean differences than the regular small table. -pub fn generate_log_table(small: &[[u8; 10]; 90], small_alt: &[[u8; 10]; 10]) -> [[u16; 10]; 90] { - let mut table = [[0u16; 10]; 90]; - for (row, table_row) in table.iter_mut().enumerate() { - for (col, entry) in table_row.iter_mut().enumerate() { - let n = ((10 + row) * 100 + col * 10) as f64; - let base = ((n.log10() - 3.0) * 10000.0).round() as u16; - let needs_alt = row < 10 && small[row][col] != small_alt[row][col]; - *entry = if needs_alt { - base | ALT_TABLE_FLAG - } else { - base - }; - } - } - table -} - -/// Generate the small log table: uint8[10][90]. -/// -/// Mean differences for the 4th digit. Each entry is the rounded -/// difference in scaled log10 between the 4-digit number and the base -/// 3-digit number for that row. -pub fn generate_log_table_small() -> [[u8; 10]; 90] { - let mut table = [[0u8; 10]; 90]; - for (row, table_row) in table.iter_mut().enumerate() { - let base_n = (10 + row) * 100; - let base_log = (base_n as f64).log10(); - for (col, entry) in table_row.iter_mut().enumerate() { - let diff = ((base_n + col) as f64).log10() - base_log; - *entry = (diff * 10000.0).round() as u8; - } - } - table -} - -/// Generate the small alt log table: uint8[10][10]. -/// -/// Higher-precision mean differences for the first 10 rows (mantissa -/// 100-199). Uses floor of scaled values then takes the difference. -pub fn generate_log_table_small_alt() -> [[u8; 10]; 10] { - let mut table = [[0u8; 10]; 10]; - for (row, table_row) in table.iter_mut().enumerate() { - let base_n = (10 + row) * 100; - let base_log = (base_n as f64).log10(); - for (col, entry) in table_row.iter_mut().enumerate() { - let diff = ((base_n + col) as f64).log10() - base_log; - *entry = (diff * 10000.0).round() as u8; - } - } - table -} - -/// Generate the antilog table: uint16[10][100]. -/// -/// The full antilog index range is 0-9999 (ANTILOG_IDX_CARDINALITY). -/// The main table has 1000 entries (100 rows × 10 cols), one per group -/// of 10 consecutive indices. Flattened entry k corresponds to indices -/// k*10 through k*10+9. Value = round(10^(k*10/10000) * 1000). -pub fn generate_antilog_table() -> [[u16; 10]; 100] { - let mut table = [[0u16; 10]; 100]; - for (row, table_row) in table.iter_mut().enumerate() { - for (col, entry) in table_row.iter_mut().enumerate() { - let k = row * 10 + col; - *entry = (10.0_f64.powf((k * 10) as f64 / 10000.0) * 1000.0).round() as u16; - } - } - table -} - -/// Generate the small antilog table: uint8[10][100]. -/// -/// Indexed by [idx/100][idx%10] where idx is the full index (0-9999). -/// The value is the correction to add to the main table entry. -/// For a given idx: main covers idx rounded down to nearest 10, -/// small adds the sub-10 correction. -/// -/// Value = round(10^(idx/10000) * 1000) - main_table[idx/10] -/// But since many indices share the same [row][col], the table stores -/// a representative value. In practice it's computed for the first -/// occurrence (tens digit = 0). -pub fn generate_antilog_table_small() -> [[u8; 10]; 100] { - let mut table = [[0u8; 10]; 100]; - for (row, table_row) in table.iter_mut().enumerate() { - for (col, entry) in table_row.iter_mut().enumerate() { - let idx = row * 100 + col; - let main_k = idx / 10; - let main_val = (10.0_f64.powf((main_k * 10) as f64 / 10000.0) * 1000.0).round(); - let exact_val = (10.0_f64.powf(idx as f64 / 10000.0) * 1000.0).round(); - *entry = (exact_val - main_val).round() as u8; - } - } - table -} - -#[cfg(test)] -#[allow(clippy::needless_range_loop)] -mod tests { - use super::*; - - /// Verify the main log table entries are within ±1 of the true value. - /// The Solidity tables are transcribed from a published 4-figure log - /// table reference and may use rounding conventions that differ from - /// IEEE 754 f64, so we check proximity rather than exact equality. - #[test] - fn test_log_table_accuracy() { - let table = solidity_log_table(); - for row in 0..90 { - for col in 0..10 { - let n = ((10 + row) * 100 + col * 10) as f64; - let expected = ((n.log10() - 3.0) * 10000.0).round() as i32; - let actual = (table[row][col] & !ALT_TABLE_FLAG) as i32; - assert!( - (actual - expected).abs() <= 1, - "log table [{row}][{col}]: n={n}, expected={expected}, actual={actual}, diff={}", - actual - expected - ); - } - } - } - - /// Verify the main antilog table entries are within ±1 of the true value. - #[test] - fn test_antilog_table_accuracy() { - let table = solidity_antilog_table(); - for row in 0..100 { - for col in 0..10 { - let k = row * 10 + col; - let expected = (10.0_f64.powf((k * 10) as f64 / 10000.0) * 1000.0).round() as i32; - let actual = table[row][col] as i32; - assert!( - (actual - expected).abs() <= 1, - "antilog table [{row}][{col}]: k={k}, expected={expected}, actual={actual}, diff={}", - actual - expected - ); - } - } - } - - /// Verify that main + small gives a value close to the true log10 - /// for every 4-digit number 1000-9999. - #[test] - fn test_log_lookup_accuracy() { - let main = solidity_log_table(); - let small = solidity_log_table_small(); - let small_alt = solidity_log_table_small_alt(); - for n in 1000..10000_usize { - let row = n / 10 - 100; - let _col = (n / 10) % 10; - let d = n % 10; - let main_row = row / 10; - let main_col = row % 10; - - let main_entry = main[main_row][main_col]; - let main_val = (main_entry & !ALT_TABLE_FLAG) as i32; - let use_alt = main_entry & ALT_TABLE_FLAG != 0; - let small_val = if use_alt { - small_alt[main_row][d] as i32 - } else { - small[main_row][d] as i32 - }; - let table_result = main_val + small_val; - let true_val = ((n as f64).log10() - 3.0) * 10000.0; - - // The lookup should be within 2 of the true value (main has - // ±1 error, small has ±1 error). - assert!( - (table_result as f64 - true_val).abs() < 2.5, - "log lookup for n={n}: table={table_result}, true={true_val:.2}, diff={:.2}", - table_result as f64 - true_val - ); - } - } - - /// Verify that main + small gives a value close to the true antilog - /// for every index 0-9999. - #[test] - fn test_antilog_lookup_accuracy() { - let main = solidity_antilog_table(); - let small = solidity_antilog_table_small(); - for idx in 0..10000_usize { - let main_k = idx / 10; - let main_row = main_k / 10; - let main_col = main_k % 10; - let main_val = main[main_row][main_col] as i32; - - let small_row = idx / 100; - let small_col = idx % 10; - let small_val = small[small_row][small_col] as i32; - - let table_result = main_val + small_val; - let true_val = 10.0_f64.powf(idx as f64 / 10000.0) * 1000.0; - - assert!( - (table_result as f64 - true_val).abs() < 2.5, - "antilog lookup for idx={idx}: table={table_result}, true={true_val:.2}, diff={:.2}", - table_result as f64 - true_val - ); - } - } - - /// Verify that the main antilog table entries exactly match - /// round(10^(k*10/10000) * 1000). - #[test] - fn test_antilog_table_exact() { - let generated = generate_antilog_table(); - let solidity = solidity_antilog_table(); - for row in 0..100 { - for col in 0..10 { - assert_eq!( - generated[row][col], solidity[row][col], - "antilog table mismatch at [{row}][{col}]: generated={}, solidity={}", - generated[row][col], solidity[row][col] - ); - } - } - } - - /// Verify the small log table — generated values are either exact or - /// at most 1 above the Solidity value. The published reference table - /// uses rounding conventions that floor certain values where IEEE 754 - /// round-half-up produces the next integer. The direction is always - /// generated >= solidity. - #[test] - fn test_log_table_small_generation() { - let generated = generate_log_table_small(); - let solidity = solidity_log_table_small(); - for row in 0..90 { - for col in 0..10 { - let diff = generated[row][col] as i16 - solidity[row][col] as i16; - assert!( - diff.abs() <= 1, - "log small [{row}][{col}]: generated={}, solidity={}, diff={diff}", - generated[row][col], - solidity[row][col] - ); - } - } - } - - /// Verify the small alt log table — allows ±2 because the published - /// table uses interpolation conventions that differ from per-entry - /// floor differences by up to 2 units. - #[test] - fn test_log_table_small_alt_generation() { - let generated = generate_log_table_small_alt(); - let solidity = solidity_log_table_small_alt(); - for row in 0..10 { - for col in 0..10 { - let diff = generated[row][col] as i16 - solidity[row][col] as i16; - assert!( - diff.abs() <= 3, - "log small alt [{row}][{col}]: generated={}, solidity={}, diff={diff}", - generated[row][col], - solidity[row][col] - ); - } - } - } - - /// Verify the small antilog table — same +1 tolerance. - #[test] - fn test_antilog_table_small_generation() { - let generated = generate_antilog_table_small(); - let solidity = solidity_antilog_table_small(); - for row in 0..100 { - for col in 0..10 { - let diff = generated[row][col] as i16 - solidity[row][col] as i16; - assert!( - diff.abs() <= 1, - "antilog small [{row}][{col}]: generated={}, solidity={}, diff={diff}", - generated[row][col], - solidity[row][col] - ); - } - } - } - - /// Verify the main log table — the base values (without ALT flag) - /// match exactly. ALT flags depend on the small table generation - /// so they get +1 tolerance via the ALT flag being set or not. - #[test] - fn test_log_table_generation() { - let small = generate_log_table_small(); - let small_alt = generate_log_table_small_alt(); - let generated = generate_log_table(&small, &small_alt); - let solidity = solidity_log_table(); - for row in 0..90 { - for col in 0..10 { - let gen_base = generated[row][col] & !ALT_TABLE_FLAG; - let sol_base = solidity[row][col] & !ALT_TABLE_FLAG; - assert_eq!( - gen_base, sol_base, - "log [{row}][{col}] base: generated={gen_base}, solidity={sol_base}", - ); - } - } - } - - // The Solidity reference tables follow. These are copied verbatim from - // LibLogTable.sol so the Rust-generated values can be compared against - // the exact on-chain constants. - - #[rustfmt::skip] - fn solidity_log_table() -> [[u16; 10]; 90] { - [ - [0, 43, 86, 128, 170, 212|ALT_TABLE_FLAG, 253|ALT_TABLE_FLAG, 294|ALT_TABLE_FLAG, 334|ALT_TABLE_FLAG, 374|ALT_TABLE_FLAG], - [414, 453, 492, 531, 569, 607|ALT_TABLE_FLAG, 645|ALT_TABLE_FLAG, 682|ALT_TABLE_FLAG, 719|ALT_TABLE_FLAG, 755|ALT_TABLE_FLAG], - [792, 828, 864, 899, 934, 969, 1004|ALT_TABLE_FLAG, 1038|ALT_TABLE_FLAG, 1072|ALT_TABLE_FLAG, 1106|ALT_TABLE_FLAG], - [1139, 1173, 1206, 1239, 1271, 1303|ALT_TABLE_FLAG, 1335|ALT_TABLE_FLAG, 1367|ALT_TABLE_FLAG, 1399|ALT_TABLE_FLAG, 1430|ALT_TABLE_FLAG], - [1461, 1492, 1523, 1553, 1584|ALT_TABLE_FLAG, 1614|ALT_TABLE_FLAG, 1644|ALT_TABLE_FLAG, 1673|ALT_TABLE_FLAG, 1703|ALT_TABLE_FLAG, 1732|ALT_TABLE_FLAG], - [1761, 1790, 1818, 1847, 1875, 1903, 1931|ALT_TABLE_FLAG, 1959|ALT_TABLE_FLAG, 1987|ALT_TABLE_FLAG, 2014|ALT_TABLE_FLAG], - [2041, 2068, 2095, 2122, 2148, 2175|ALT_TABLE_FLAG, 2201|ALT_TABLE_FLAG, 2227|ALT_TABLE_FLAG, 2253|ALT_TABLE_FLAG, 2279|ALT_TABLE_FLAG], - [2304, 2330, 2355, 2380, 2405, 2430, 2455|ALT_TABLE_FLAG, 2480|ALT_TABLE_FLAG, 2504|ALT_TABLE_FLAG, 2529|ALT_TABLE_FLAG], - [2553, 2577, 2601, 2625, 2648, 2672|ALT_TABLE_FLAG, 2695|ALT_TABLE_FLAG, 2718|ALT_TABLE_FLAG, 2742|ALT_TABLE_FLAG, 2765|ALT_TABLE_FLAG], - [2788, 2810, 2833, 2856, 2878, 2900|ALT_TABLE_FLAG, 2923|ALT_TABLE_FLAG, 2945|ALT_TABLE_FLAG, 2967|ALT_TABLE_FLAG, 2989|ALT_TABLE_FLAG], - [3010, 3032, 3054, 3075, 3096, 3118, 3139, 3160, 3181, 3201], - [3222, 3243, 3263, 3284, 3304, 3324, 3345, 3365, 3385, 3404], - [3424, 3444, 3464, 3483, 3502, 3522, 3541, 3560, 3579, 3598], - [3617, 3636, 3655, 3674, 3692, 3711, 3729, 3747, 3766, 3784], - [3802, 3820, 3838, 3856, 3874, 3892, 3909, 3927, 3945, 3962], - [3979, 3997, 4014, 4031, 4048, 4065, 4082, 4099, 4116, 4133], - [4150, 4166, 4183, 4200, 4216, 4232, 4249, 4265, 4281, 4298], - [4314, 4330, 4346, 4362, 4378, 4393, 4409, 4425, 4440, 4456], - [4472, 4487, 4502, 4518, 4533, 4548, 4564, 4579, 4594, 4609], - [4624, 4639, 4654, 4669, 4683, 4698, 4713, 4728, 4742, 4757], - [4771, 4786, 4800, 4814, 4829, 4843, 4857, 4871, 4886, 4900], - [4914, 4928, 4942, 4955, 4969, 4983, 4997, 5011, 5024, 5038], - [5051, 5065, 5079, 5092, 5105, 5119, 5132, 5145, 5159, 5172], - [5185, 5198, 5211, 5224, 5237, 5250, 5263, 5276, 5289, 5302], - [5315, 5328, 5340, 5353, 5366, 5378, 5391, 5403, 5416, 5428], - [5441, 5453, 5465, 5478, 5490, 5502, 5514, 5527, 5539, 5551], - [5563, 5575, 5587, 5599, 5611, 5623, 5635, 5647, 5658, 5670], - [5682, 5694, 5705, 5717, 5729, 5740, 5752, 5763, 5775, 5786], - [5798, 5809, 5821, 5832, 5843, 5855, 5866, 5877, 5888, 5899], - [5911, 5922, 5933, 5944, 5955, 5966, 5977, 5988, 5999, 6010], - [6021, 6031, 6042, 6053, 6064, 6075, 6085, 6096, 6107, 6117], - [6128, 6138, 6149, 6160, 6170, 6180, 6191, 6201, 6212, 6222], - [6232, 6243, 6253, 6263, 6274, 6284, 6294, 6304, 6314, 6325], - [6335, 6345, 6355, 6365, 6375, 6385, 6395, 6405, 6415, 6425], - [6435, 6444, 6454, 6464, 6474, 6484, 6493, 6503, 6513, 6522], - [6532, 6542, 6551, 6561, 6571, 6580, 6590, 6599, 6609, 6618], - [6628, 6637, 6646, 6656, 6665, 6675, 6684, 6693, 6702, 6712], - [6721, 6730, 6739, 6749, 6758, 6767, 6776, 6785, 6794, 6803], - [6812, 6821, 6830, 6839, 6848, 6857, 6866, 6875, 6884, 6893], - [6902, 6911, 6920, 6928, 6937, 6946, 6955, 6964, 6972, 6981], - [6990, 6998, 7007, 7016, 7024, 7033, 7042, 7050, 7059, 7067], - [7076, 7084, 7093, 7101, 7110, 7118, 7126, 7135, 7143, 7152], - [7160, 7168, 7177, 7185, 7193, 7202, 7210, 7218, 7226, 7235], - [7243, 7251, 7259, 7267, 7275, 7284, 7292, 7300, 7308, 7316], - [7324, 7332, 7340, 7348, 7356, 7364, 7372, 7380, 7388, 7396], - [7404, 7412, 7419, 7427, 7435, 7443, 7451, 7459, 7466, 7474], - [7482, 7490, 7497, 7505, 7513, 7520, 7528, 7536, 7543, 7551], - [7559, 7566, 7574, 7582, 7589, 7597, 7604, 7612, 7619, 7627], - [7634, 7642, 7649, 7657, 7664, 7672, 7679, 7686, 7694, 7701], - [7709, 7716, 7723, 7731, 7738, 7745, 7752, 7760, 7767, 7774], - [7782, 7789, 7796, 7803, 7810, 7818, 7825, 7832, 7839, 7846], - [7853, 7860, 7868, 7875, 7882, 7889, 7896, 7903, 7910, 7917], - [7924, 7931, 7938, 7945, 7952, 7959, 7966, 7973, 7980, 7987], - [7993, 8000, 8007, 8014, 8021, 8028, 8035, 8041, 8048, 8055], - [8062, 8069, 8075, 8082, 8089, 8096, 8102, 8109, 8116, 8122], - [8129, 8136, 8142, 8149, 8156, 8162, 8169, 8176, 8182, 8189], - [8195, 8202, 8209, 8215, 8222, 8228, 8235, 8241, 8248, 8254], - [8261, 8267, 8274, 8280, 8287, 8293, 8299, 8306, 8312, 8319], - [8325, 8331, 8338, 8344, 8351, 8357, 8363, 8370, 8376, 8382], - [8388, 8395, 8401, 8407, 8414, 8420, 8426, 8432, 8439, 8445], - [8451, 8457, 8463, 8470, 8476, 8482, 8488, 8494, 8500, 8506], - [8513, 8519, 8525, 8531, 8537, 8543, 8549, 8555, 8561, 8567], - [8573, 8579, 8585, 8591, 8597, 8603, 8609, 8615, 8621, 8627], - [8633, 8639, 8645, 8651, 8657, 8663, 8669, 8675, 8681, 8686], - [8692, 8698, 8704, 8710, 8716, 8722, 8727, 8733, 8739, 8745], - [8751, 8756, 8762, 8768, 8774, 8779, 8785, 8791, 8797, 8802], - [8808, 8814, 8820, 8825, 8831, 8837, 8842, 8848, 8854, 8859], - [8865, 8871, 8876, 8882, 8887, 8893, 8899, 8904, 8910, 8915], - [8921, 8927, 8932, 8938, 8943, 8949, 8954, 8960, 8965, 8971], - [8976, 8982, 8987, 8993, 8998, 9004, 9009, 9015, 9020, 9025], - [9031, 9036, 9042, 9047, 9053, 9058, 9063, 9069, 9074, 9079], - [9085, 9090, 9096, 9101, 9106, 9112, 9117, 9122, 9128, 9133], - [9138, 9143, 9149, 9154, 9159, 9165, 9170, 9175, 9180, 9186], - [9191, 9196, 9201, 9206, 9212, 9217, 9222, 9227, 9232, 9238], - [9243, 9248, 9253, 9258, 9263, 9269, 9274, 9279, 9284, 9289], - [9294, 9299, 9304, 9309, 9315, 9320, 9325, 9330, 9335, 9340], - [9345, 9350, 9355, 9360, 9365, 9370, 9375, 9380, 9385, 9390], - [9395, 9400, 9405, 9410, 9415, 9420, 9425, 9430, 9435, 9440], - [9445, 9450, 9455, 9460, 9465, 9469, 9474, 9479, 9484, 9489], - [9494, 9499, 9504, 9509, 9513, 9518, 9523, 9528, 9533, 9538], - [9542, 9547, 9552, 9557, 9562, 9566, 9571, 9576, 9581, 9586], - [9590, 9595, 9600, 9605, 9609, 9614, 9619, 9624, 9628, 9633], - [9638, 9643, 9647, 9652, 9657, 9661, 9666, 9671, 9675, 9680], - [9685, 9689, 9694, 9699, 9703, 9708, 9713, 9717, 9722, 9727], - [9731, 9736, 9741, 9745, 9750, 9754, 9759, 9763, 9768, 9773], - [9777, 9782, 9786, 9791, 9795, 9800, 9805, 9809, 9814, 9818], - [9823, 9827, 9832, 9836, 9841, 9845, 9850, 9854, 9859, 9863], - [9868, 9872, 9877, 9881, 9886, 9890, 9894, 9899, 9903, 9908], - [9912, 9917, 9921, 9926, 9930, 9934, 9939, 9943, 9948, 9952], - [9956, 9961, 9965, 9969, 9974, 9978, 9983, 9987, 9991, 9996], - ] - } - - #[rustfmt::skip] - fn solidity_log_table_small() -> [[u8; 10]; 90] { - [ - [0, 4, 9, 13, 17, 21, 26, 30, 34, 38], [0, 4, 8, 12, 15, 19, 23, 27, 31, 35], - [0, 3, 7, 11, 14, 18, 21, 25, 28, 32], [0, 3, 7, 10, 13, 16, 20, 23, 26, 30], - [0, 3, 6, 9, 12, 15, 18, 21, 24, 28], [0, 3, 6, 9, 11, 14, 17, 20, 23, 26], - [0, 3, 5, 8, 11, 14, 16, 19, 22, 24], [0, 3, 5, 8, 10, 13, 15, 18, 20, 23], - [0, 2, 5, 7, 9, 12, 14, 16, 19, 21], [0, 2, 4, 7, 9, 11, 13, 16, 18, 20], - [0, 2, 4, 6, 8, 11, 13, 15, 17, 19], [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], - [0, 2, 4, 6, 8, 10, 12, 14, 15, 17], [0, 2, 4, 6, 7, 9, 11, 13, 15, 17], - [0, 2, 4, 5, 7, 9, 11, 12, 14, 16], [0, 2, 3, 5, 7, 9, 10, 12, 14, 15], - [0, 2, 3, 5, 7, 8, 10, 11, 13, 15], [0, 2, 3, 5, 6, 8, 9, 11, 13, 14], - [0, 2, 3, 5, 6, 8, 9, 11, 12, 14], [0, 1, 3, 4, 6, 7, 9, 10, 12, 13], - [0, 1, 3, 4, 6, 7, 9, 10, 11, 13], [0, 1, 3, 4, 6, 7, 8, 10, 11, 12], - [0, 1, 3, 4, 5, 7, 8, 9, 11, 12], [0, 1, 3, 4, 5, 6, 8, 9, 10, 12], - [0, 1, 3, 4, 5, 6, 8, 9, 10, 11], [0, 1, 2, 4, 5, 6, 7, 9, 10, 11], - [0, 1, 2, 4, 5, 6, 7, 8, 10, 11], [0, 1, 2, 3, 5, 6, 7, 8, 9, 10], - [0, 1, 2, 3, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 7, 8, 9, 10], - [0, 1, 2, 3, 4, 5, 6, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 7, 8], [0, 1, 2, 3, 4, 5, 5, 6, 7, 8], - [0, 1, 2, 3, 4, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 4, 5, 6, 7, 8], - [0, 1, 2, 3, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 3, 4, 5, 6, 7, 8], - [0, 1, 2, 2, 3, 4, 5, 6, 7, 7], [0, 1, 2, 2, 3, 4, 5, 6, 6, 7], - [0, 1, 2, 2, 3, 4, 5, 6, 6, 7], [0, 1, 2, 2, 3, 4, 5, 5, 6, 7], - [0, 1, 2, 2, 3, 4, 5, 5, 6, 7], [0, 1, 2, 2, 3, 4, 5, 5, 6, 7], - [0, 1, 1, 2, 3, 4, 4, 5, 6, 7], [0, 1, 1, 2, 3, 4, 4, 5, 6, 7], - [0, 1, 1, 2, 3, 4, 4, 5, 6, 6], [0, 1, 1, 2, 3, 4, 4, 5, 6, 6], - [0, 1, 1, 2, 3, 3, 4, 5, 6, 6], [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], - [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], - [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], - [0, 1, 1, 2, 3, 3, 4, 4, 5, 6], [0, 1, 1, 2, 2, 3, 4, 4, 5, 6], - [0, 1, 1, 2, 2, 3, 4, 4, 5, 6], [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], - [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], - [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], [0, 1, 1, 2, 2, 3, 3, 4, 5, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 5, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 3, 4], - ] - } - - #[rustfmt::skip] - fn solidity_log_table_small_alt() -> [[u8; 10]; 10] { - [ - [0, 4, 8, 12, 16, 20, 24, 28, 32, 37], - [0, 4, 7, 11, 15, 19, 22, 26, 30, 33], - [0, 3, 7, 10, 14, 17, 20, 24, 27, 31], - [0, 3, 7, 10, 12, 16, 19, 22, 25, 29], - [0, 3, 6, 9, 12, 15, 17, 20, 23, 26], - [0, 3, 5, 8, 11, 14, 16, 19, 22, 25], - [0, 3, 5, 8, 10, 13, 15, 18, 21, 23], - [0, 2, 5, 7, 10, 12, 15, 17, 19, 22], - [0, 2, 5, 7, 9, 11, 14, 16, 18, 21], - [0, 2, 4, 6, 8, 11, 13, 15, 17, 19], - ] - } - - #[rustfmt::skip] - fn solidity_antilog_table() -> [[u16; 10]; 100] { - [ - [1000, 1002, 1005, 1007, 1009, 1012, 1014, 1016, 1019, 1021], - [1023, 1026, 1028, 1030, 1033, 1035, 1038, 1040, 1042, 1045], - [1047, 1050, 1052, 1054, 1057, 1059, 1062, 1064, 1067, 1069], - [1072, 1074, 1076, 1079, 1081, 1084, 1086, 1089, 1091, 1094], - [1096, 1099, 1102, 1104, 1107, 1109, 1112, 1114, 1117, 1119], - [1122, 1125, 1127, 1130, 1132, 1135, 1138, 1140, 1143, 1146], - [1148, 1151, 1153, 1156, 1159, 1161, 1164, 1167, 1169, 1172], - [1175, 1178, 1180, 1183, 1186, 1189, 1191, 1194, 1197, 1199], - [1202, 1205, 1208, 1211, 1213, 1216, 1219, 1222, 1225, 1227], - [1230, 1233, 1236, 1239, 1242, 1245, 1247, 1250, 1253, 1256], - [1259, 1262, 1265, 1268, 1271, 1274, 1276, 1279, 1282, 1285], - [1288, 1291, 1294, 1297, 1300, 1303, 1306, 1309, 1312, 1315], - [1318, 1321, 1324, 1327, 1330, 1334, 1337, 1340, 1343, 1346], - [1349, 1352, 1355, 1358, 1361, 1365, 1368, 1371, 1374, 1377], - [1380, 1384, 1387, 1390, 1393, 1396, 1400, 1403, 1406, 1409], - [1413, 1416, 1419, 1422, 1426, 1429, 1432, 1435, 1439, 1442], - [1445, 1449, 1452, 1455, 1459, 1462, 1466, 1469, 1472, 1476], - [1479, 1483, 1486, 1489, 1493, 1496, 1500, 1503, 1507, 1510], - [1514, 1517, 1521, 1524, 1528, 1531, 1535, 1538, 1542, 1545], - [1549, 1552, 1556, 1560, 1563, 1567, 1570, 1574, 1578, 1581], - [1585, 1589, 1592, 1596, 1600, 1603, 1607, 1611, 1614, 1618], - [1622, 1626, 1629, 1633, 1637, 1641, 1644, 1648, 1652, 1656], - [1660, 1663, 1667, 1671, 1675, 1679, 1683, 1687, 1690, 1694], - [1698, 1702, 1706, 1710, 1714, 1718, 1722, 1726, 1730, 1734], - [1738, 1742, 1746, 1750, 1754, 1758, 1762, 1766, 1770, 1774], - [1778, 1782, 1786, 1791, 1795, 1799, 1803, 1807, 1811, 1816], - [1820, 1824, 1828, 1832, 1837, 1841, 1845, 1849, 1854, 1858], - [1862, 1866, 1871, 1875, 1879, 1884, 1888, 1892, 1897, 1901], - [1905, 1910, 1914, 1919, 1923, 1928, 1932, 1936, 1941, 1945], - [1950, 1954, 1959, 1963, 1968, 1972, 1977, 1982, 1986, 1991], - [1995, 2000, 2004, 2009, 2014, 2018, 2023, 2028, 2032, 2037], - [2042, 2046, 2051, 2056, 2061, 2065, 2070, 2075, 2080, 2084], - [2089, 2094, 2099, 2104, 2109, 2113, 2118, 2123, 2128, 2133], - [2138, 2143, 2148, 2153, 2158, 2163, 2168, 2173, 2178, 2183], - [2188, 2193, 2198, 2203, 2208, 2213, 2218, 2223, 2228, 2234], - [2239, 2244, 2249, 2254, 2259, 2265, 2270, 2275, 2280, 2286], - [2291, 2296, 2301, 2307, 2312, 2317, 2323, 2328, 2333, 2339], - [2344, 2350, 2355, 2360, 2366, 2371, 2377, 2382, 2388, 2393], - [2399, 2404, 2410, 2415, 2421, 2427, 2432, 2438, 2443, 2449], - [2455, 2460, 2466, 2472, 2477, 2483, 2489, 2495, 2500, 2506], - [2512, 2518, 2523, 2529, 2535, 2541, 2547, 2553, 2559, 2564], - [2570, 2576, 2582, 2588, 2594, 2600, 2606, 2612, 2618, 2624], - [2630, 2636, 2642, 2649, 2655, 2661, 2667, 2673, 2679, 2685], - [2692, 2698, 2704, 2710, 2716, 2723, 2729, 2735, 2742, 2748], - [2754, 2761, 2767, 2773, 2780, 2786, 2793, 2799, 2805, 2812], - [2818, 2825, 2831, 2838, 2844, 2851, 2858, 2864, 2871, 2877], - [2884, 2891, 2897, 2904, 2911, 2917, 2924, 2931, 2938, 2944], - [2951, 2958, 2965, 2972, 2979, 2985, 2992, 2999, 3006, 3013], - [3020, 3027, 3034, 3041, 3048, 3055, 3062, 3069, 3076, 3083], - [3090, 3097, 3105, 3112, 3119, 3126, 3133, 3141, 3148, 3155], - [3162, 3170, 3177, 3184, 3192, 3199, 3206, 3214, 3221, 3228], - [3236, 3243, 3251, 3258, 3266, 3273, 3281, 3289, 3296, 3304], - [3311, 3319, 3327, 3334, 3342, 3350, 3357, 3365, 3373, 3381], - [3388, 3396, 3404, 3412, 3420, 3428, 3436, 3443, 3451, 3459], - [3467, 3475, 3483, 3491, 3499, 3508, 3516, 3524, 3532, 3540], - [3548, 3556, 3565, 3573, 3581, 3589, 3597, 3606, 3614, 3622], - [3631, 3639, 3648, 3656, 3664, 3673, 3681, 3690, 3698, 3707], - [3715, 3724, 3733, 3741, 3750, 3758, 3767, 3776, 3784, 3793], - [3802, 3811, 3819, 3828, 3837, 3846, 3855, 3864, 3873, 3882], - [3890, 3899, 3908, 3917, 3926, 3936, 3945, 3954, 3963, 3972], - [3981, 3990, 3999, 4009, 4018, 4027, 4036, 4046, 4055, 4064], - [4074, 4083, 4093, 4102, 4111, 4121, 4130, 4140, 4150, 4159], - [4169, 4178, 4188, 4198, 4207, 4217, 4227, 4236, 4246, 4256], - [4266, 4276, 4285, 4295, 4305, 4315, 4325, 4335, 4345, 4355], - [4365, 4375, 4385, 4395, 4406, 4416, 4426, 4436, 4446, 4457], - [4467, 4477, 4487, 4498, 4508, 4519, 4529, 4539, 4550, 4560], - [4571, 4581, 4592, 4603, 4613, 4624, 4634, 4645, 4656, 4667], - [4677, 4688, 4699, 4710, 4721, 4732, 4742, 4753, 4764, 4775], - [4786, 4797, 4808, 4819, 4831, 4842, 4853, 4864, 4875, 4887], - [4898, 4909, 4920, 4932, 4943, 4955, 4966, 4977, 4989, 5000], - [5012, 5023, 5035, 5047, 5058, 5070, 5082, 5093, 5105, 5117], - [5129, 5140, 5152, 5164, 5176, 5188, 5200, 5212, 5224, 5236], - [5248, 5260, 5272, 5284, 5297, 5309, 5321, 5333, 5346, 5358], - [5370, 5383, 5395, 5408, 5420, 5433, 5445, 5458, 5470, 5483], - [5495, 5508, 5521, 5534, 5546, 5559, 5572, 5585, 5598, 5610], - [5623, 5636, 5649, 5662, 5675, 5689, 5702, 5715, 5728, 5741], - [5754, 5768, 5781, 5794, 5808, 5821, 5834, 5848, 5861, 5875], - [5888, 5902, 5916, 5929, 5943, 5957, 5970, 5984, 5998, 6012], - [6026, 6039, 6053, 6067, 6081, 6095, 6109, 6124, 6138, 6152], - [6166, 6180, 6194, 6209, 6223, 6237, 6252, 6266, 6281, 6295], - [6310, 6324, 6339, 6353, 6368, 6383, 6397, 6412, 6427, 6442], - [6457, 6471, 6486, 6501, 6516, 6531, 6546, 6561, 6577, 6592], - [6607, 6622, 6637, 6653, 6668, 6683, 6699, 6714, 6730, 6745], - [6761, 6776, 6792, 6808, 6823, 6839, 6855, 6871, 6887, 6902], - [6918, 6934, 6950, 6966, 6982, 6998, 7015, 7031, 7047, 7063], - [7079, 7096, 7112, 7129, 7145, 7161, 7178, 7194, 7211, 7228], - [7244, 7261, 7278, 7295, 7311, 7328, 7345, 7362, 7379, 7396], - [7413, 7430, 7447, 7464, 7482, 7499, 7516, 7534, 7551, 7568], - [7586, 7603, 7621, 7638, 7656, 7674, 7691, 7709, 7727, 7745], - [7762, 7780, 7798, 7816, 7834, 7852, 7870, 7889, 7907, 7925], - [7943, 7962, 7980, 7998, 8017, 8035, 8054, 8072, 8091, 8110], - [8128, 8147, 8166, 8185, 8204, 8222, 8241, 8260, 8279, 8299], - [8318, 8337, 8356, 8375, 8395, 8414, 8433, 8453, 8472, 8492], - [8511, 8531, 8551, 8570, 8590, 8610, 8630, 8650, 8670, 8690], - [8710, 8730, 8750, 8770, 8790, 8810, 8831, 8851, 8872, 8892], - [8913, 8933, 8954, 8974, 8995, 9016, 9036, 9057, 9078, 9099], - [9120, 9141, 9162, 9183, 9204, 9226, 9247, 9268, 9290, 9311], - [9333, 9354, 9376, 9397, 9419, 9441, 9462, 9484, 9506, 9528], - [9550, 9572, 9594, 9616, 9638, 9661, 9683, 9705, 9727, 9750], - [9772, 9795, 9817, 9840, 9863, 9886, 9908, 9931, 9954, 9977], - ] - } - - #[rustfmt::skip] - fn solidity_antilog_table_small() -> [[u8; 10]; 100] { - [ - [0, 0, 0, 1, 1, 1, 1, 2, 2, 2], [0, 0, 0, 1, 1, 1, 1, 2, 2, 2], - [0, 0, 0, 1, 1, 1, 1, 2, 2, 2], [0, 0, 0, 1, 1, 1, 1, 2, 2, 2], - [0, 0, 1, 1, 1, 1, 2, 2, 2, 2], [0, 0, 1, 1, 1, 1, 2, 2, 2, 2], - [0, 0, 1, 1, 1, 1, 2, 2, 2, 2], [0, 0, 1, 1, 1, 1, 2, 2, 2, 2], - [0, 0, 1, 1, 1, 1, 2, 2, 2, 3], [0, 0, 1, 1, 1, 1, 2, 2, 2, 3], - [0, 0, 1, 1, 1, 1, 2, 2, 2, 3], [0, 0, 1, 1, 1, 2, 2, 2, 2, 3], - [0, 0, 1, 1, 1, 2, 2, 2, 2, 3], [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], - [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], - [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], - [0, 0, 1, 1, 1, 2, 2, 2, 3, 3], [0, 0, 1, 1, 1, 2, 2, 3, 3, 3], - [0, 0, 1, 1, 1, 2, 2, 3, 3, 3], [0, 0, 1, 1, 2, 2, 2, 3, 3, 3], - [0, 0, 1, 1, 2, 2, 2, 3, 3, 3], [0, 0, 1, 1, 2, 2, 2, 3, 3, 4], - [0, 0, 1, 1, 2, 2, 2, 3, 3, 4], [0, 0, 1, 1, 2, 2, 2, 3, 3, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 3, 4], [0, 0, 1, 1, 2, 2, 3, 3, 3, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], [0, 0, 1, 1, 2, 2, 3, 3, 4, 4], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], - [0, 1, 1, 2, 2, 3, 3, 4, 4, 5], [0, 1, 1, 2, 2, 3, 3, 4, 5, 5], - [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], [0, 1, 1, 2, 2, 3, 4, 4, 5, 5], - [0, 1, 1, 2, 2, 3, 4, 4, 5, 6], [0, 1, 1, 2, 3, 3, 4, 4, 5, 6], - [0, 1, 1, 2, 3, 3, 4, 4, 5, 6], [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], - [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], [0, 1, 1, 2, 3, 3, 4, 5, 5, 6], - [0, 1, 1, 2, 3, 4, 4, 5, 6, 6], [0, 1, 1, 2, 3, 4, 4, 5, 6, 6], - [0, 1, 1, 2, 3, 4, 4, 5, 6, 7], [0, 1, 2, 2, 3, 4, 5, 5, 6, 7], - [0, 1, 2, 2, 3, 4, 5, 5, 6, 7], [0, 1, 2, 2, 3, 4, 5, 6, 6, 7], - [0, 1, 2, 2, 3, 4, 5, 6, 6, 7], [0, 1, 2, 2, 3, 4, 5, 6, 7, 7], - [0, 1, 2, 3, 3, 4, 5, 6, 7, 8], [0, 1, 2, 3, 3, 4, 5, 6, 7, 8], - [0, 1, 2, 3, 4, 4, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 5, 6, 7, 8], - [0, 1, 2, 3, 4, 5, 6, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - [0, 1, 2, 3, 4, 5, 6, 7, 9, 10], [0, 1, 2, 3, 4, 5, 7, 8, 9, 10], - [0, 1, 2, 3, 4, 6, 7, 8, 9, 10], [0, 1, 2, 3, 5, 6, 7, 8, 9, 10], - [0, 1, 2, 4, 5, 6, 7, 8, 9, 11], - [0, 1, 2, 4, 5, 6, 7, 8, 10, 11], [0, 1, 2, 4, 5, 6, 7, 9, 10, 11], - [0, 1, 3, 4, 5, 6, 8, 9, 10, 11], [0, 1, 3, 4, 5, 6, 8, 9, 10, 12], - [0, 1, 3, 4, 5, 7, 8, 9, 10, 12], [0, 1, 3, 4, 5, 7, 8, 9, 11, 12], - [0, 1, 3, 4, 5, 7, 8, 10, 11, 12], [0, 1, 3, 4, 6, 7, 8, 10, 11, 13], - [0, 1, 3, 4, 6, 7, 9, 10, 11, 13], [0, 1, 3, 4, 6, 7, 9, 10, 12, 13], - [0, 2, 3, 5, 6, 8, 9, 11, 12, 14], [0, 2, 3, 5, 6, 8, 9, 11, 12, 14], - [0, 2, 3, 5, 6, 8, 9, 11, 13, 14], [0, 2, 3, 5, 6, 8, 10, 11, 13, 15], - [0, 2, 3, 5, 7, 8, 10, 12, 13, 15], [0, 2, 3, 5, 7, 8, 10, 12, 13, 15], - [0, 2, 3, 5, 7, 9, 10, 12, 14, 16], [0, 2, 4, 5, 7, 9, 11, 12, 14, 16], - [0, 2, 4, 5, 7, 9, 11, 13, 14, 16], [0, 2, 4, 6, 7, 9, 11, 13, 15, 17], - [0, 2, 4, 6, 8, 9, 11, 13, 15, 17], [0, 2, 4, 6, 8, 10, 12, 14, 15, 17], - [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], [0, 2, 4, 6, 8, 10, 12, 14, 16, 18], - [0, 2, 4, 6, 8, 10, 12, 15, 17, 19], [0, 2, 4, 6, 8, 11, 13, 15, 17, 19], - [0, 2, 4, 7, 9, 11, 13, 15, 17, 20], [0, 2, 4, 7, 9, 11, 13, 16, 18, 20], - [0, 2, 5, 7, 9, 11, 14, 16, 18, 20], - ] - } -} diff --git a/flake.nix b/flake.nix index 45e0af3f..8119d573 100644 --- a/flake.nix +++ b/flake.nix @@ -18,32 +18,10 @@ pkgs = rainix.pkgs.${system}; in rec { - packages = rainix.packages.${system} // { - test-wasm-build = rainix.mkTask.${system} { - name = "test-wasm-build"; - body = '' - set -euxo pipefail - cargo build -r --target wasm32-unknown-unknown --lib --workspace - ''; - }; - - test-js-bindings = rainix.mkTask.${system} { - name = "test-js-bindings"; - body = '' - set -euxo pipefail - npm install --no-check - npm run build - npm test - ''; - }; - }; + packages = rainix.packages.${system}; devShells.default = pkgs.mkShell { inherit (rainix.devShells.${system}.default) shellHook; - packages = [ - packages.test-wasm-build - packages.test-js-bindings - ]; inputsFrom = [ rainix.devShells.${system}.default ]; }; } diff --git a/foundry.toml b/foundry.toml index a7ab63c6..b5f76bb1 100644 --- a/foundry.toml +++ b/foundry.toml @@ -27,14 +27,6 @@ evm_version = "cancun" bytecode_hash = "none" cbor_metadata = false -ffi = true - -fs_permissions = [ - { access = "read-write", path = "./src/generated" }, - { access = "read", path = "./out" }, - { access = "read-write", path = "./crates/float/abi" }, -] - [fuzz] runs = 5096 @@ -44,22 +36,6 @@ forge-std = "1.16.1" "rain-solmem" = "0.1.3" "rain-string" = "0.2.0" "rain-datacontract" = "0.1.0" -"rain-deploy" = "0.1.3" -"rain-sol-codegen" = "0.1.0" [soldeer] recursive_deps = false - -[rpc_endpoints] -arbitrum = "${ARBITRUM_RPC_URL}" -base = "${BASE_RPC_URL}" -base_sepolia = "${BASE_SEPOLIA_RPC_URL}" -flare = "${FLARE_RPC_URL}" -polygon = "${POLYGON_RPC_URL}" - -[etherscan] -arbitrum = { key = "${CI_DEPLOY_ARBITRUM_ETHERSCAN_API_KEY}" } -base = { key = "${CI_DEPLOY_BASE_ETHERSCAN_API_KEY}" } -base_sepolia = { key = "${CI_DEPLOY_BASE_SEPOLIA_ETHERSCAN_API_KEY}" } -flare = { key = "${CI_DEPLOY_FLARE_ETHERSCAN_API_KEY}" } -polygon = { key = "${CI_DEPLOY_POLYGON_ETHERSCAN_API_KEY}" } diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 976ee09f..00000000 --- a/package-lock.json +++ /dev/null @@ -1,2357 +0,0 @@ -{ - "name": "@rainlanguage/float", - "version": "0.0.13", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@rainlanguage/float", - "version": "0.0.13", - "license": "LicenseRef-DCL-1.0", - "dependencies": { - "buffer": "6.0.3" - }, - "devDependencies": { - "rimraf": "6.0.1", - "typedoc": "^0.28.7", - "vitest": "^3.1.4" - }, - "engines": { - "node": ">=22" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.6.tgz", - "integrity": "sha512-ShbM/3XxwuxjFiuVBHA+d3j5dyac0aEVVq1oluIDf71hUw0aRF59dV/efUsIwFnR6m8JNM2FjZOzmaZ8yG61kw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.6.tgz", - "integrity": "sha512-S8ToEOVfg++AU/bHwdksHNnyLyVM+eMVAOf6yRKFitnwnbwwPNqKr3srzFRe7nzV69RQKb5DgchIX5pt3L53xg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.6.tgz", - "integrity": "sha512-hd5zdUarsK6strW+3Wxi5qWws+rJhCCbMiC9QZyzoxfk5uHRIE8T287giQxzVpEvCwuJ9Qjg6bEjcRJcgfLqoA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.6.tgz", - "integrity": "sha512-0Z7KpHSr3VBIO9A/1wcT3NTy7EB4oNC4upJ5ye3R7taCc2GUdeynSLArnon5G8scPwaU866d3H4BCrE5xLW25A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.6.tgz", - "integrity": "sha512-FFCssz3XBavjxcFxKsGy2DYK5VSvJqa6y5HXljKzhRZ87LvEi13brPrf/wdyl/BbpbMKJNOr1Sd0jtW4Ge1pAA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.6.tgz", - "integrity": "sha512-GfXs5kry/TkGM2vKqK2oyiLFygJRqKVhawu3+DOCk7OxLy/6jYkWXhlHwOoTb0WqGnWGAS7sooxbZowy+pK9Yg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.6.tgz", - "integrity": "sha512-aoLF2c3OvDn2XDTRvn8hN6DRzVVpDlj2B/F66clWd/FHLiHaG3aVZjxQX2DYphA5y/evbdGvC6Us13tvyt4pWg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.6.tgz", - "integrity": "sha512-2SkqTjTSo2dYi/jzFbU9Plt1vk0+nNg8YC8rOXXea+iA3hfNJWebKYPs3xnOUf9+ZWhKAaxnQNUf2X9LOpeiMQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.6.tgz", - "integrity": "sha512-SZHQlzvqv4Du5PrKE2faN0qlbsaW/3QQfUUc6yO2EjFcA83xnwm91UbEEVx4ApZ9Z5oG8Bxz4qPE+HFwtVcfyw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.6.tgz", - "integrity": "sha512-b967hU0gqKd9Drsh/UuAm21Khpoh6mPBSgz8mKRq4P5mVK8bpA+hQzmm/ZwGVULSNBzKdZPQBRT3+WuVavcWsQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.6.tgz", - "integrity": "sha512-aHWdQ2AAltRkLPOsKdi3xv0mZ8fUGPdlKEjIEhxCPm5yKEThcUjHpWB1idN74lfXGnZ5SULQSgtr5Qos5B0bPw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.6.tgz", - "integrity": "sha512-VgKCsHdXRSQ7E1+QXGdRPlQ/e08bN6WMQb27/TMfV+vPjjTImuT9PmLXupRlC90S1JeNNW5lzkAEO/McKeJ2yg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.6.tgz", - "integrity": "sha512-WViNlpivRKT9/py3kCmkHnn44GkGXVdXfdc4drNmRl15zVQ2+D2uFwdlGh6IuK5AAnGTo2qPB1Djppj+t78rzw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.6.tgz", - "integrity": "sha512-wyYKZ9NTdmAMb5730I38lBqVu6cKl4ZfYXIs31Baf8aoOtB4xSGi3THmDYt4BTFHk7/EcVixkOV2uZfwU3Q2Jw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.6.tgz", - "integrity": "sha512-KZh7bAGGcrinEj4qzilJ4hqTY3Dg2U82c8bv+e1xqNqZCrCyc+TL9AUEn5WGKDzm3CfC5RODE/qc96OcbIe33w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.6.tgz", - "integrity": "sha512-9N1LsTwAuE9oj6lHMyyAM+ucxGiVnEqUdp4v7IaMmrwb06ZTEVCIs3oPPplVsnjPfyjmxwHxHMF8b6vzUVAUGw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.6.tgz", - "integrity": "sha512-A6bJB41b4lKFWRKNrWoP2LHsjVzNiaurf7wyj/XtFNTsnPuxwEBWHLty+ZE0dWBKuSK1fvKgrKaNjBS7qbFKig==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.6.tgz", - "integrity": "sha512-IjA+DcwoVpjEvyxZddDqBY+uJ2Snc6duLpjmkXm/v4xuS3H+3FkLZlDm9ZsAbF9rsfP3zeA0/ArNDORZgrxR/Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.6.tgz", - "integrity": "sha512-dUXuZr5WenIDlMHdMkvDc1FAu4xdWixTCRgP7RQLBOkkGgwuuzaGSYcOpW4jFxzpzL1ejb8yF620UxAqnBrR9g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.6.tgz", - "integrity": "sha512-l8ZCvXP0tbTJ3iaqdNf3pjaOSd5ex/e6/omLIQCVBLmHTlfXW3zAxQ4fnDmPLOB1x9xrcSi/xtCWFwCZRIaEwg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.6.tgz", - "integrity": "sha512-hKrmDa0aOFOr71KQ/19JC7az1P0GWtCN1t2ahYAf4O007DHZt/dW8ym5+CUdJhQ/qkZmI1HAF8KkJbEFtCL7gw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.6.tgz", - "integrity": "sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.6.tgz", - "integrity": "sha512-dyCGxv1/Br7MiSC42qinGL8KkG4kX0pEsdb0+TKhmJZgCUDBGmyo1/ArCjNGiOLiIAgdbWgmWgib4HoCi5t7kA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.6.tgz", - "integrity": "sha512-42QOgcZeZOvXfsCBJF5Afw73t4veOId//XD3i+/9gSkhSV6Gk3VPlWncctI+JcOyERv85FUo7RxuxGy+z8A43Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.6.tgz", - "integrity": "sha512-4AWhgXmDuYN7rJI6ORB+uU9DHLq/erBbuMoAuB4VWJTu5KtCgcKYPynF0YI1VkBNuEfjNlLrFr9KZPJzrtLkrQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.6.tgz", - "integrity": "sha512-NgJPHHbEpLQgDH2MjQu90pzW/5vvXIZ7KOnPyNBm92A6WgZ/7b6fJyUBjoumLqeOQQGqY2QjQxRo97ah4Sj0cA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@gerrit0/mini-shiki": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.8.0.tgz", - "integrity": "sha512-tloLVqvvoyv636PilYZwNhCmZ+xxgRicysMvpKdZ4Y6+9IH6v4lp7GodbDDncApNQjflwTSnXuYQoe3el5C59w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/engine-oniguruma": "^3.8.0", - "@shikijs/langs": "^3.8.0", - "@shikijs/themes": "^3.8.0", - "@shikijs/types": "^3.8.0", - "@shikijs/vscode-textmate": "^10.0.2" - } - }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", - "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.45.1.tgz", - "integrity": "sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.45.1.tgz", - "integrity": "sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.45.1.tgz", - "integrity": "sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.45.1.tgz", - "integrity": "sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.45.1.tgz", - "integrity": "sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.45.1.tgz", - "integrity": "sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.45.1.tgz", - "integrity": "sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.45.1.tgz", - "integrity": "sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.45.1.tgz", - "integrity": "sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.45.1.tgz", - "integrity": "sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.45.1.tgz", - "integrity": "sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.45.1.tgz", - "integrity": "sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.45.1.tgz", - "integrity": "sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.45.1.tgz", - "integrity": "sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.45.1.tgz", - "integrity": "sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.45.1.tgz", - "integrity": "sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.45.1.tgz", - "integrity": "sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.45.1.tgz", - "integrity": "sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.45.1.tgz", - "integrity": "sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.45.1.tgz", - "integrity": "sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@shikijs/engine-oniguruma": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.8.0.tgz", - "integrity": "sha512-Tx7kR0oFzqa+rY7t80LjN8ZVtHO3a4+33EUnBVx2qYP3fGxoI9H0bvnln5ySelz9SIUTsS0/Qn+9dg5zcUMsUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "3.8.0", - "@shikijs/vscode-textmate": "^10.0.2" - } - }, - "node_modules/@shikijs/langs": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.8.0.tgz", - "integrity": "sha512-mfGYuUgjQ5GgXinB5spjGlBVhG2crKRpKkfADlp8r9k/XvZhtNXxyOToSnCEnF0QNiZnJjlt5MmU9PmhRdwAbg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "3.8.0" - } - }, - "node_modules/@shikijs/themes": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.8.0.tgz", - "integrity": "sha512-yaZiLuyO23sXe16JFU76KyUMTZCJi4EMQKIrdQt7okoTzI4yAaJhVXT2Uy4k8yBIEFRiia5dtD7gC1t8m6y3oQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/types": "3.8.0" - } - }, - "node_modules/@shikijs/types": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.8.0.tgz", - "integrity": "sha512-I/b/aNg0rP+kznVDo7s3UK8jMcqEGTtoPDdQ+JlQ2bcJIyu/e2iRvl42GLIDMK03/W1YOHOuhlhQ7aM+XbKUeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@shikijs/vscode-textmate": "^10.0.2", - "@types/hast": "^3.0.4" - } - }, - "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", - "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/chai": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz", - "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/deep-eql": "*" - } - }, - "node_modules/@types/deep-eql": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/hast": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", - "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/expect": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", - "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", - "chai": "^5.2.0", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/mocker": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", - "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "3.2.4", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.17" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/pretty-format": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", - "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", - "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "3.2.4", - "pathe": "^2.0.3", - "strip-literal": "^3.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", - "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.4", - "magic-string": "^0.30.17", - "pathe": "^2.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", - "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyspy": "^4.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", - "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.4", - "loupe": "^3.1.4", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/chai": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.1.tgz", - "integrity": "sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esbuild": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz", - "integrity": "sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.6", - "@esbuild/android-arm": "0.25.6", - "@esbuild/android-arm64": "0.25.6", - "@esbuild/android-x64": "0.25.6", - "@esbuild/darwin-arm64": "0.25.6", - "@esbuild/darwin-x64": "0.25.6", - "@esbuild/freebsd-arm64": "0.25.6", - "@esbuild/freebsd-x64": "0.25.6", - "@esbuild/linux-arm": "0.25.6", - "@esbuild/linux-arm64": "0.25.6", - "@esbuild/linux-ia32": "0.25.6", - "@esbuild/linux-loong64": "0.25.6", - "@esbuild/linux-mips64el": "0.25.6", - "@esbuild/linux-ppc64": "0.25.6", - "@esbuild/linux-riscv64": "0.25.6", - "@esbuild/linux-s390x": "0.25.6", - "@esbuild/linux-x64": "0.25.6", - "@esbuild/netbsd-arm64": "0.25.6", - "@esbuild/netbsd-x64": "0.25.6", - "@esbuild/openbsd-arm64": "0.25.6", - "@esbuild/openbsd-x64": "0.25.6", - "@esbuild/openharmony-arm64": "0.25.6", - "@esbuild/sunos-x64": "0.25.6", - "@esbuild/win32-arm64": "0.25.6", - "@esbuild/win32-ia32": "0.25.6", - "@esbuild/win32-x64": "0.25.6" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/expect-type": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", - "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/fdir": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", - "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/glob": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", - "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.3.1", - "jackspeak": "^4.1.1", - "minimatch": "^10.0.3", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/jackspeak": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", - "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "uc.micro": "^2.0.0" - } - }, - "node_modules/loupe": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.4.tgz", - "integrity": "sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==", - "dev": true, - "license": "MIT" - }, - "node_modules/lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true, - "license": "MIT" - }, - "node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, - "node_modules/markdown-it": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - }, - "bin": { - "markdown-it": "bin/markdown-it.mjs" - } - }, - "node_modules/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "dev": true, - "license": "MIT" - }, - "node_modules/minimatch": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", - "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", - "dev": true, - "license": "ISC", - "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, - "license": "BlueOak-1.0.0" - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathval": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rollup": { - "version": "4.45.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.45.1.tgz", - "integrity": "sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.45.1", - "@rollup/rollup-android-arm64": "4.45.1", - "@rollup/rollup-darwin-arm64": "4.45.1", - "@rollup/rollup-darwin-x64": "4.45.1", - "@rollup/rollup-freebsd-arm64": "4.45.1", - "@rollup/rollup-freebsd-x64": "4.45.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.45.1", - "@rollup/rollup-linux-arm-musleabihf": "4.45.1", - "@rollup/rollup-linux-arm64-gnu": "4.45.1", - "@rollup/rollup-linux-arm64-musl": "4.45.1", - "@rollup/rollup-linux-loongarch64-gnu": "4.45.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.45.1", - "@rollup/rollup-linux-riscv64-gnu": "4.45.1", - "@rollup/rollup-linux-riscv64-musl": "4.45.1", - "@rollup/rollup-linux-s390x-gnu": "4.45.1", - "@rollup/rollup-linux-x64-gnu": "4.45.1", - "@rollup/rollup-linux-x64-musl": "4.45.1", - "@rollup/rollup-win32-arm64-msvc": "4.45.1", - "@rollup/rollup-win32-ia32-msvc": "4.45.1", - "@rollup/rollup-win32-x64-msvc": "4.45.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", - "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-literal": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.0.0.tgz", - "integrity": "sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==", - "dev": true, - "license": "MIT", - "dependencies": { - "js-tokens": "^9.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/tinyrainbow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", - "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz", - "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/typedoc": { - "version": "0.28.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.7.tgz", - "integrity": "sha512-lpz0Oxl6aidFkmS90VQDQjk/Qf2iw0IUvFqirdONBdj7jPSN9mGXhy66BcGNDxx5ZMyKKiBVAREvPEzT6Uxipw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@gerrit0/mini-shiki": "^3.7.0", - "lunr": "^2.3.9", - "markdown-it": "^14.1.0", - "minimatch": "^9.0.5", - "yaml": "^2.8.0" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 18", - "pnpm": ">= 10" - }, - "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.0.4.tgz", - "integrity": "sha512-SkaSguuS7nnmV7mfJ8l81JGBFV7Gvzp8IzgE8A8t23+AxuNX61Q5H1Tpz5efduSN7NHC8nQXD3sKQKZAu5mNEA==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.4.6", - "picomatch": "^4.0.2", - "postcss": "^8.5.6", - "rollup": "^4.40.0", - "tinyglobby": "^0.2.14" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "lightningcss": "^1.21.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", - "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.4.1", - "es-module-lexer": "^1.7.0", - "pathe": "^2.0.3", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitest": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", - "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/expect": "3.2.4", - "@vitest/mocker": "3.2.4", - "@vitest/pretty-format": "^3.2.4", - "@vitest/runner": "3.2.4", - "@vitest/snapshot": "3.2.4", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", - "chai": "^5.2.0", - "debug": "^4.4.1", - "expect-type": "^1.2.1", - "magic-string": "^0.30.17", - "pathe": "^2.0.3", - "picomatch": "^4.0.2", - "std-env": "^3.9.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.14", - "tinypool": "^1.1.1", - "tinyrainbow": "^2.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", - "vite-node": "3.2.4", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/debug": "^4.1.12", - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.2.4", - "@vitest/ui": "3.2.4", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/debug": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yaml": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", - "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 6378073c..00000000 --- a/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@rainlanguage/float", - "description": "Rainlanguage rust Float library in JS/TS through wasm bindgen", - "version": "0.0.13", - "license": "LicenseRef-DCL-1.0", - "author": "Rain Open Source Software Ltd", - "repository": { - "type": "git", - "url": "https://github.com/rainlanguage/rain.math.float.git" - }, - "keywords": [], - "bugs": { - "url": "https://github.com/rainlanguage/rain.math.float/issues" - }, - "homepage": "https://github.com/rainlanguage/rain.math.float#readme", - "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.js", - "browser": { - "./dist/cjs/index.js": "./dist/cjs/index.js", - "./dist/esm/index.js": "./dist/esm/index.js" - }, - "engines": { - "node": ">=22" - }, - "files": [ - "./dist" - ], - "scripts": { - "prepublish": "node ./scripts/prepublish", - "build": "npm run rm-dist && npm run rm-temp && node ./scripts/build", - "build-wasm": "cargo build --target wasm32-unknown-unknown --lib -r --workspace", - "rm-dist": "rimraf ./dist", - "rm-temp": "rimraf ./temp", - "test": "npm run check && vitest run --dir test_js", - "check": "tsc ./dist/**/*.{ts,js} --noEmit --allowJs --lib ES2022" - }, - "devDependencies": { - "rimraf": "6.0.1", - "typedoc": "^0.28.7", - "vitest": "^3.1.4" - }, - "dependencies": { - "buffer": "6.0.3" - } -} diff --git a/remappings.txt b/remappings.txt index f9761a04..912daac3 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,8 +1,5 @@ @openzeppelin-contracts-5.6.1/=dependencies/@openzeppelin-contracts-5.6.1/ forge-std-1.16.1/=dependencies/forge-std-1.16.1/ rain-datacontract-0.1.0/=dependencies/rain-datacontract-0.1.0/ -rain-deploy-0.1.2/=dependencies/rain-deploy-0.1.2/ -rain-deploy-0.1.3/=dependencies/rain-deploy-0.1.3/ -rain-sol-codegen-0.1.0/=dependencies/rain-sol-codegen-0.1.0/ rain-solmem-0.1.3/=dependencies/rain-solmem-0.1.3/ rain-string-0.2.0/=dependencies/rain-string-0.2.0/ diff --git a/script/BuildPointers.sol b/script/BuildPointers.sol deleted file mode 100644 index 3e0d9339..00000000 --- a/script/BuildPointers.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Script} from "forge-std-1.16.1/src/Script.sol"; -import {LibCodeGen} from "rain-sol-codegen-0.1.0/src/lib/LibCodeGen.sol"; -import {LibFs} from "rain-sol-codegen-0.1.0/src/lib/LibFs.sol"; -import {LibLogTable} from "../src/lib/table/LibLogTable.sol"; - -contract BuildPointers is Script { - function run() external { - LibFs.buildFileForContract( - vm, - address(0), - "LogTables", - string.concat( - LibCodeGen.bytesConstantString( - vm, "/// @dev Log tables.", "LOG_TABLES", LibLogTable.toBytes(LibLogTable.logTableDec()) - ), - LibCodeGen.bytesConstantString( - vm, - "/// @dev Log tables small.", - "LOG_TABLES_SMALL", - LibLogTable.toBytes(LibLogTable.logTableDecSmall()) - ), - LibCodeGen.bytesConstantString( - vm, - "/// @dev Log tables small alt.", - "LOG_TABLES_SMALL_ALT", - LibLogTable.toBytes(LibLogTable.logTableDecSmallAlt()) - ), - LibCodeGen.bytesConstantString( - vm, - "/// @dev Anti log tables.", - "ANTI_LOG_TABLES", - LibLogTable.toBytes(LibLogTable.antiLogTableDec()) - ), - LibCodeGen.bytesConstantString( - vm, - "/// @dev Anti log tables small.", - "ANTI_LOG_TABLES_SMALL", - LibLogTable.toBytes(LibLogTable.antiLogTableDecSmall()) - ) - ) - ); - } -} diff --git a/script/CopyArtifacts.sol b/script/CopyArtifacts.sol deleted file mode 100644 index b55ead67..00000000 --- a/script/CopyArtifacts.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Script} from "forge-std-1.16.1/src/Script.sol"; -import {LibCopyArtifacts} from "./lib/LibCopyArtifacts.sol"; - -contract CopyArtifacts is Script { - function run() external { - string[] memory names = LibCopyArtifacts.contracts(); - for (uint256 i = 0; i < names.length; i++) { - _copyAbi(names[i]); - } - } - - function _copyAbi(string memory contractName) internal { - bytes memory artifact = LibCopyArtifacts.extractStable(vm, contractName); - string memory dst = LibCopyArtifacts.committedPath(contractName); - if (vm.exists(dst)) { - //forge-lint: disable-next-line(unsafe-cheatcode) - vm.removeFile(dst); - } - //forge-lint: disable-next-line(unsafe-cheatcode) - vm.writeFile(dst, string(artifact)); - } -} diff --git a/script/Deploy.sol b/script/Deploy.sol deleted file mode 100644 index 1f1aef85..00000000 --- a/script/Deploy.sol +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Script} from "forge-std-1.16.1/src/Script.sol"; -import {LibDataContract} from "rain-datacontract-0.1.0/src/lib/LibDataContract.sol"; -import {LibDecimalFloatDeploy} from "../src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LibRainDeploy} from "rain-deploy-0.1.3/src/lib/LibRainDeploy.sol"; -import {DecimalFloat} from "../src/concrete/DecimalFloat.sol"; -import {LibEtchLogTables} from "./lib/LibEtchLogTables.sol"; - -/// @dev Hash of the "log-tables" deployment suite string. When the -/// `DEPLOYMENT_SUITE` env var is set to "log-tables", the script deploys the -/// log/antilog lookup tables as a data contract. -bytes32 constant DEPLOYMENT_SUITE_TABLES = keccak256("log-tables"); - -/// @dev Hash of the "decimal-float" deployment suite string. When the -/// `DEPLOYMENT_SUITE` env var is set to "decimal-float" (or omitted, as it is -/// the default), the script deploys the DecimalFloat contract. -bytes32 constant DEPLOYMENT_SUITE_CONTRACT = keccak256("decimal-float"); - -contract Deploy is Script { - mapping(string => mapping(address => bytes32)) internal sDepCodeHashes; - - function run() external { - uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY"); - - bytes32 suite = keccak256(bytes(vm.envOr("DEPLOYMENT_SUITE", string("decimal-float")))); - if (suite == DEPLOYMENT_SUITE_TABLES) { - LibRainDeploy.deployAndBroadcast( - vm, - LibRainDeploy.supportedNetworks(), - deployerPrivateKey, - LibDataContract.contractCreationCode(LibDecimalFloatDeploy.combinedTables()), - "", - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - new address[](0), - sDepCodeHashes - ); - } else if (suite == DEPLOYMENT_SUITE_CONTRACT) { - // DecimalFloat's constructor calls - // LibDecimalFloatDeploy.checkLogTablesDeployed(), which reads - // extcodesize/codehash at ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS. - // The simulation pass runs before the broadcast pass, so if - // log-tables hasn't actually been deployed yet on this chain - // the simulation reverts. Plant the runtime bytecode locally - // so simulation matches the post-broadcast on-chain state. - if (LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.code.length == 0) { - LibEtchLogTables.etchLogTables(vm); - } - - address[] memory decimalFloatDependencies = new address[](1); - decimalFloatDependencies[0] = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS; - LibRainDeploy.deployAndBroadcast( - vm, - LibRainDeploy.supportedNetworks(), - deployerPrivateKey, - type(DecimalFloat).creationCode, - "src/concrete/DecimalFloat.sol:DecimalFloat", - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS, - LibDecimalFloatDeploy.DECIMAL_FLOAT_CONTRACT_HASH, - decimalFloatDependencies, - sDepCodeHashes - ); - } else { - revert( - "Invalid deployment suite specified. Please set the DEPLOYMENT_SUITE environment variable to either 'log-tables' or 'decimal-float'." - ); - } - } -} diff --git a/script/check-published-deploy-constants.sh b/script/check-published-deploy-constants.sh deleted file mode 100644 index e2680648..00000000 --- a/script/check-published-deploy-constants.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: LicenseRef-DCL-1.0 -# SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -# -# Prints "OK" iff every version published to the soldeer registry for -# `rain-math-float` has a full suite of pinned deploy constants in -# LibDecimalFloatDeploy.sol: a log-tables address + codehash and a DecimalFloat -# address + codehash, each suffixed with the version. -# -# Consumed by LibDecimalFloatDeployTaggedConstants.t.sol via FFI. Output is one -# of: -# OK - every published version has its full constant suite -# MISSING: - one or more expected constants are absent -# SKIP: - the registry could not be reached (nothing verified) -# -# Always exits 0 so the test sees the message rather than an ffi failure. - -lib="src/lib/deploy/LibDecimalFloatDeploy.sol" - -versions=$( - curl -fsS --connect-timeout 5 --max-time 20 --retry 2 --retry-delay 1 \ - "https://api.soldeer.xyz/api/v1/revision?project_name=rain-math-float" 2>/dev/null \ - | grep -oE '"version":"[0-9][0-9.]*"' | cut -d'"' -f4 | sort -u -) - -if [ -z "$versions" ]; then - printf 'SKIP: could not fetch published soldeer versions' - exit 0 -fi - -# The deploy constants that must be pinned for every published version, suffixed -# with the version (dots replaced by underscores). -bases="ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS \ -LOG_TABLES_DATA_CONTRACT_HASH \ -ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS \ -DECIMAL_FLOAT_CONTRACT_HASH" - -missing="" -for v in $versions; do - suffix=$(printf '%s' "$v" | tr . _) - for b in $bases; do - name="${b}_${suffix}" - grep -qE "constant ${name} =" "$lib" || missing="${missing} ${name}" - done -done - -if [ -n "$missing" ]; then - printf 'MISSING:%s' "$missing" -else - printf 'OK' -fi diff --git a/script/lib/LibCopyArtifacts.sol b/script/lib/LibCopyArtifacts.sol deleted file mode 100644 index 9c7b7aed..00000000 --- a/script/lib/LibCopyArtifacts.sol +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity ^0.8.25; - -import {Vm} from "forge-std-1.16.1/src/Vm.sol"; - -/// @notice Shared logic between `script/CopyArtifacts.sol` (writes the -/// committed ABI) and `test/script/CopyArtifacts.t.sol` (asserts the -/// committed ABI is fresh). -library LibCopyArtifacts { - /// @notice Contract artifacts that the rust crate consumes via - /// alloy::sol!. Adding a new contract here also requires the rust - /// crate to reference it. - function contracts() internal pure returns (string[] memory) { - string[] memory names = new string[](2); - names[0] = "DecimalFloat"; - names[1] = "TestDecimalFloat"; - return names; - } - - /// @notice Path of the live forge build artifact for a contract. - function livePath(string memory contractName) internal pure returns (string memory) { - return string.concat("out/", contractName, ".sol/", contractName, ".json"); - } - - /// @notice Path of the committed ABI copy that the rust crate reads - /// at compile time. - function committedPath(string memory contractName) internal pure returns (string memory) { - return string.concat("crates/float/abi/", contractName, ".json"); - } - - /// @notice Extracts the deterministic subset of the live forge - /// artifact via `jq` over `vm.ffi`. The full forge JSON is - /// non-deterministic across machines (solc source unit IDs in - /// `metadata.sources`, `sourceMap` and friends shift with filesystem - /// enumeration order). The kept keys — `abi`, `bytecode.object`, - /// `deployedBytecode.object` — are pure functions of the input source - /// and compiler settings. alloy::sol! reads `abi` for type - /// generation and the bytecode fields are consumed by the rust EVM - /// setup in `crates/float/src/evm.rs`. - function extractStable(Vm vm, string memory contractName) internal returns (bytes memory) { - string[] memory cmd = new string[](3); - cmd[0] = "jq"; - cmd[1] = "{abi, bytecode: {object: .bytecode.object}, deployedBytecode: {object: .deployedBytecode.object}}"; - cmd[2] = livePath(contractName); - return vm.ffi(cmd); - } -} diff --git a/script/lib/LibEtchLogTables.sol b/script/lib/LibEtchLogTables.sol deleted file mode 100644 index 540b5876..00000000 --- a/script/lib/LibEtchLogTables.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity ^0.8.25; - -import {Vm} from "forge-std-1.16.1/src/Vm.sol"; -import {LibDataContract} from "rain-datacontract-0.1.0/src/lib/LibDataContract.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; - -/// @notice Shared logic for planting the log-tables data contract at its -/// Zoltu-deterministic address inside a forge VM. Used by `script/Deploy.sol` -/// (so the decimal-float simulation pass can pass the constructor's codehash -/// check before log-tables exists on-chain) and by tests that need -/// `DecimalFloat` operations to work without a real on-chain deploy. -library LibEtchLogTables { - /// @notice Deploys the log-tables data contract to a temporary address, - /// copies its runtime code, and etches that runtime at - /// `LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS` so the - /// codehash matches `LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH`. - function etchLogTables(Vm vm) internal { - bytes memory tables = LibDecimalFloatDeploy.combinedTables(); - bytes memory creationCode = LibDataContract.contractCreationCode(tables); - address temp; - assembly ("memory-safe") { - temp := create(0, add(creationCode, 0x20), mload(creationCode)) - } - require(temp != address(0), "log tables etch deploy failed"); - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, temp.code); - } -} diff --git a/scripts/build.js b/scripts/build.js deleted file mode 100644 index dda4a857..00000000 --- a/scripts/build.js +++ /dev/null @@ -1,84 +0,0 @@ -const fs = require("fs"); -const { execSync } = require("child_process"); - -// create dist dir -fs.mkdirSync("./dist/cjs", { recursive: true }); -fs.mkdirSync("./dist/esm", { recursive: true }); - -// build for wasm32 target -execSync("npm run build-wasm"); - -// generate node/web bindgens -execSync( - `wasm-bindgen --target nodejs ./target/wasm32-unknown-unknown/release/rain_math_float_wasm.wasm --out-dir ./temp/node --out-name float`, -); -execSync( - `wasm-bindgen --target web ./target/wasm32-unknown-unknown/release/rain_math_float_wasm.wasm --out-dir ./temp/web --out-name float`, -); - -// encode wasm as base64 into a json for cjs and esm that can be natively imported -// in js modules in order to avoid using fetch or fs operations -const wasmCjsBytes = fs.readFileSync(`./temp/node/float_bg.wasm`); -fs.writeFileSync( - `./dist/cjs/float_wbg.json`, - JSON.stringify({ - wasm: Buffer.from(wasmCjsBytes, "binary").toString("base64"), - }), -); -const wasmEsmBytes = fs.readFileSync(`./temp/web/float_bg.wasm`); -fs.writeFileSync( - `./dist/esm/float_wbg.json`, - JSON.stringify({ - wasm: Buffer.from(wasmEsmBytes, "binary").toString("base64"), - }), -); - -// prepare the dts -let dts = fs.readFileSync(`./temp/node/float.d.ts`, { - encoding: "utf-8", -}); -dts = dts.replace( - `/* tslint:disable */ -/* eslint-disable */`, - "", -); -dts = "/* this file is auto-generated, do not modify */\n" + dts; -fs.writeFileSync(`./dist/cjs/index.d.ts`, dts); -fs.writeFileSync(`./dist/esm/index.d.ts`, dts); - -// prepare cjs -let cjs = fs.readFileSync(`./temp/node/float.js`, { - encoding: "utf-8", -}); -cjs = cjs.replace( - `const path = require('path').join(__dirname, 'float_bg.wasm'); -const bytes = require('fs').readFileSync(path);`, - ` -const { Buffer } = require('buffer'); -const wasmB64 = require('./float_wbg.json'); -const bytes = Buffer.from(wasmB64.wasm, 'base64');`, -); -cjs = cjs.replace("const { TextEncoder, TextDecoder } = require(`util`);", ""); -cjs = "/* this file is auto-generated, do not modify */\n" + cjs; -fs.writeFileSync(`./dist/cjs/index.js`, cjs); - -// prepare esm -let esm = fs.readFileSync(`./temp/web/float.js`, { - encoding: "utf-8", -}); -esm = esm.replace( - `export { initSync }; -export default __wbg_init;`, - `import { Buffer } from 'buffer'; -import wasmB64 from './float_wbg.json'; -const bytes = Buffer.from(wasmB64.wasm, 'base64'); -initSync(bytes);`, -); -esm = "/* this file is auto-generated, do not modify */\n" + esm; -fs.writeFileSync(`./dist/esm/index.js`, esm); - -// rm temp folder -execSync("npm run rm-temp"); - -// check bindings for possible errors -execSync("npm run check"); diff --git a/scripts/prepublish.js b/scripts/prepublish.js deleted file mode 100644 index 65b34741..00000000 --- a/scripts/prepublish.js +++ /dev/null @@ -1,10 +0,0 @@ -const fs = require("fs"); -const { execSync } = require("child_process"); - -// exit early if already built -// for npm install from an already built and packed package -if (fs.existsSync("./dist")) return; - -execSync("npm run rm-temp"); -execSync("npm run rm-dist"); -execSync("nix develop -c node scripts/build"); diff --git a/soldeer.lock b/soldeer.lock index 8a7a55ca..c2bc8238 100644 --- a/soldeer.lock +++ b/soldeer.lock @@ -19,20 +19,6 @@ url = "https://soldeer-revisions.s3.amazonaws.com/rain-datacontract/0_1_0_09-05- checksum = "81f6369a5e57da280d4598f0e909a66a432a1a8468c2f06b68dfdc2fe36745bd" integrity = "f2e43fcbe27e7251ff981285271eec0a5ad49e1425dd02213f8a03df404f6670" -[[dependencies]] -name = "rain-deploy" -version = "0.1.3" -url = "https://soldeer-revisions.s3.amazonaws.com/rain-deploy/0_1_3_20-05-2026_13:02:35_rain.zip" -checksum = "6e9a7a1562ee2766a1cc3a4a077b853ec628a3070b282e6e9102a252f2a6a5b5" -integrity = "10bff708d9e5d8b77655b8a8fc0c755cef8e3fc876cc3ff100425d27b08294a0" - -[[dependencies]] -name = "rain-sol-codegen" -version = "0.1.0" -url = "https://soldeer-revisions.s3.amazonaws.com/rain-sol-codegen/0_1_0_09-05-2026_20:30:25_rain.sol.zip" -checksum = "6b5abd394c5db86ac64214262b7a5115158f480b2fbd74442672dfe52bb67310" -integrity = "e22748ce2ba7eca3ce71e23b2271d1c0f370b989507e784b0a4850a7a9e52157" - [[dependencies]] name = "rain-solmem" version = "0.1.3" diff --git a/src/concrete/DecimalFloat.sol b/src/concrete/DecimalFloat.sol deleted file mode 100644 index 516762e5..00000000 --- a/src/concrete/DecimalFloat.sol +++ /dev/null @@ -1,328 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "../lib/LibDecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "../lib/deploy/LibDecimalFloatDeploy.sol"; -import {LibFormatDecimalFloat} from "../lib/format/LibFormatDecimalFloat.sol"; -import {LibParseDecimalFloat} from "../lib/parse/LibParseDecimalFloat.sol"; -import {ScientificMinNotLessThanMax} from "../error/ErrDecimalFloat.sol"; - -contract DecimalFloat { - using LibDecimalFloat for Float; - - /// The default minimum value for scientific formatting. 1e-4 - // slither-disable-next-line too-many-digits - Float public constant FORMAT_DEFAULT_SCIENTIFIC_MIN = - Float.wrap(0xfffffffc00000000000000000000000000000000000000000000000000000001); - - /// The default maximum value for scientific formatting. 1e9 - // slither-disable-next-line too-many-digits - Float public constant FORMAT_DEFAULT_SCIENTIFIC_MAX = - Float.wrap(0x0000000900000000000000000000000000000000000000000000000000000001); - - constructor() { - LibDecimalFloatDeploy.checkLogTablesDeployed(); - } - - /// Exposes `LibDecimalFloat.FLOAT_MAX_POSITIVE_VALUE` for offchain use. - /// @return The maximum positive value of a Float. - function maxPositiveValue() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MAX_POSITIVE_VALUE; - } - - /// Exposes `LibDecimalFloat.FLOAT_MIN_POSITIVE_VALUE` for offchain use. - /// @return The minimum positive value of a Float. - function minPositiveValue() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MIN_POSITIVE_VALUE; - } - - /// Exposes `LibDecimalFloat.FLOAT_MAX_NEGATIVE_VALUE` for offchain use. - /// @return The maximum negative value of a Float. - function maxNegativeValue() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MAX_NEGATIVE_VALUE; - } - - /// Exposes `LibDecimalFloat.FLOAT_MIN_NEGATIVE_VALUE` for offchain use. - /// @return The minimum negative value of a Float. - function minNegativeValue() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MIN_NEGATIVE_VALUE; - } - - /// Exposes `LibDecimalFloat.FLOAT_ZERO` for offchain use. - /// @return The zero value of a Float in its maximized representation. - function zero() external pure returns (Float) { - return LibDecimalFloat.FLOAT_ZERO; - } - /// Exposes `LibDecimalFloat.FLOAT_E` for offchain use. - /// @return The constant value of Euler's number as a Float. - - function e() external pure returns (Float) { - return LibDecimalFloat.FLOAT_E; - } - - /// Exposes `LibParseDecimalFloat.parseDecimalFloat` for offchain use. - /// @param str The string to parse. - /// @return errorSelector The selector of the error if parsing failed. `0` - /// if parsing succeeded. - /// @return parsed The parsed float. Caller MUST check `errorSelector` to - /// determine if parsing succeeded. - function parse(string memory str) external pure returns (bytes4, Float) { - (bytes4 errorSelector, Float parsed) = LibParseDecimalFloat.parseDecimalFloat(str); - return (errorSelector, parsed); - } - - /// Exposes `LibFormatDecimalFloat.toDecimalString` for offchain use. - /// @param a The float to format. The absolute value of `a` is used to - /// determine if scientific notation is used, this allows negative numbers to - /// be formatted consistently with their positive counterparts. - /// @param scientificMin The smallest number that won't be formatted in - /// scientific notation. - /// @param scientificMax The largest number that won't be formatted in - /// scientific notation. - /// @return The string representation of the float. - function format(Float a, Float scientificMin, Float scientificMax) public pure returns (string memory) { - if (!scientificMin.lt(scientificMax)) { - revert ScientificMinNotLessThanMax(scientificMin, scientificMax); - } - Float absA = a.abs(); - return LibFormatDecimalFloat.toDecimalString(a, absA.lt(scientificMin) || absA.gt(scientificMax)); - } - - /// Exposes `LibFormatDecimalFloat.toDecimalString` for offchain use. - /// provides raw bool interface for custom scientific formatting. - /// @param a The float to format. - /// @param scientific Whether to format the float in scientific notation. - /// @return The string representation of the float. - function format(Float a, bool scientific) external pure returns (string memory) { - return LibFormatDecimalFloat.toDecimalString(a, scientific); - } - - /// Exposes `format(Float, Float, Float)` for offchain use. - /// Provides default scientific formatting. - /// @param a The float to format. - /// @return The string representation of the float. - function format(Float a) external pure returns (string memory) { - return format(a, FORMAT_DEFAULT_SCIENTIFIC_MIN, FORMAT_DEFAULT_SCIENTIFIC_MAX); - } - - /// Exposes `LibDecimalFloat.add` for offchain use. - /// @param a The first float to add. - /// @param b The second float to add. - /// @return The sum of the two floats. - function add(Float a, Float b) external pure returns (Float) { - return a.add(b); - } - - /// Exposes `LibDecimalFloat.sub` for offchain use. - /// @param a The float to subtract from. - /// @param b The float to subtract. - /// @return The difference of the two floats. - function sub(Float a, Float b) external pure returns (Float) { - return a.sub(b); - } - - /// Exposes `LibDecimalFloat.minus` for offchain use. - /// @param a The float to negate. - /// @return The negated float. - function minus(Float a) external pure returns (Float) { - return a.minus(); - } - - /// Exposes `LibDecimalFloat.abs` for offchain use. - /// @param a The float to get the absolute value of. - /// @return The absolute value of the float. - function abs(Float a) external pure returns (Float) { - return a.abs(); - } - - /// Exposes `LibDecimalFloat.mul` for offchain use. - /// @param a The first float to multiply. - /// @param b The second float to multiply. - /// @return The product of the two floats. - function mul(Float a, Float b) external pure returns (Float) { - return a.mul(b); - } - - /// Exposes `LibDecimalFloat.div` for offchain use. - /// @param a The dividend (numerator). - /// @param b The divisor (denominator). - /// @return The quotient of the two floats. - function div(Float a, Float b) external pure returns (Float) { - return a.div(b); - } - - /// Exposes `LibDecimalFloat.inv` for offchain use. - /// @param a The float to invert. - /// @return The inverted float. - function inv(Float a) external pure returns (Float) { - return a.inv(); - } - - /// Exposes `LibDecimalFloat.eq` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return True if the two floats are equal, false otherwise. - function eq(Float a, Float b) external pure returns (bool) { - return a.eq(b); - } - - /// Exposes `LibDecimalFloat.lt` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return True if the first float is less than the second, false otherwise. - function lt(Float a, Float b) external pure returns (bool) { - return a.lt(b); - } - - /// Exposes `LibDecimalFloat.gt` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return True if the first float is greater than the second, false - /// otherwise. - function gt(Float a, Float b) external pure returns (bool) { - return a.gt(b); - } - - /// Exposes `LibDecimalFloat.lte` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return True if the first float is less than or equal to the second, - /// false otherwise. - function lte(Float a, Float b) external pure returns (bool) { - return a.lte(b); - } - - /// Exposes `LibDecimalFloat.gte` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return True if the first float is greater than or equal to the second, - /// false otherwise. - function gte(Float a, Float b) external pure returns (bool) { - return a.gte(b); - } - - /// Exposes `LibDecimalFloat.integer` for offchain use. - /// @param a The float to get the integer part of. - /// @return The integer part of the float. - function integer(Float a) external pure returns (Float) { - return a.integer(); - } - - /// Exposes `LibDecimalFloat.frac` for offchain use. - /// @param a The float to get the fractional part of. - /// @return The fractional part of the float. - function frac(Float a) external pure returns (Float) { - return a.frac(); - } - - /// Exposes `LibDecimalFloat.floor` for offchain use. - /// @param a The float to get the floor of. - /// @return The floored float. - function floor(Float a) external pure returns (Float) { - return a.floor(); - } - - /// Exposes `LibDecimalFloat.ceil` for offchain use. - /// @param a The float to get the ceiling of. - /// @return The ceiled float. - function ceil(Float a) external pure returns (Float) { - return a.ceil(); - } - - /// Exposes `LibDecimalFloat.pow10` for offchain use. - /// @param a The exponent to raise 10 to. - /// @return The result of 10^a. - function pow10(Float a) external view returns (Float) { - return a.pow10(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - /// Exposes `LibDecimalFloat.log10` for offchain use. - /// @param a The float to take the logarithm of. - /// @return The logarithm of the float. - function log10(Float a) external view returns (Float) { - return a.log10(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - /// Exposes `LibDecimalFloat.pow` for offchain use. - /// @param a The base float. - /// @param b The exponent float. - /// @return The result of raising the base float to the power of the exponent - function pow(Float a, Float b) external view returns (Float) { - return a.pow(b, LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - /// Exposes `LibDecimalFloat.sqrt` for offchain use. - /// @param a The float to take the square root of. - /// @return The square root of the float. - function sqrt(Float a) external view returns (Float) { - return a.sqrt(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - /// Exposes `LibDecimalFloat.min` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return The smaller of the two floats. - function min(Float a, Float b) external pure returns (Float) { - return a.min(b); - } - - /// Exposes `LibDecimalFloat.max` for offchain use. - /// @param a The first float to compare. - /// @param b The second float to compare. - /// @return The larger of the two floats. - function max(Float a, Float b) external pure returns (Float) { - return a.max(b); - } - - /// Exposes `LibDecimalFloat.isZero` for offchain use. - /// @param a The float to check. - /// @return True if the float is zero, false otherwise. - function isZero(Float a) external pure returns (bool) { - return a.isZero(); - } - - /// Exposes `LibDecimalFloat.fromFixedDecimalLosslessPacked` for offchain - /// use. - /// @param value The fixed point decimal value to convert. - /// @param decimals The number of decimals in the fixed point - /// representation. e.g. If 1e18 represents 1 this would be 18 decimals. - /// @return float The Float struct containing the signed coefficient and - /// exponent. - function fromFixedDecimalLossless(uint256 value, uint8 decimals) external pure returns (Float) { - return LibDecimalFloat.fromFixedDecimalLosslessPacked(value, decimals); - } - - /// Exposes `LibDecimalFloat.toFixedDecimalLossless` for offchain use. - /// @param float The Float struct to convert. - /// @param decimals The number of decimals in the fixed point - /// representation. e.g. If 1e18 represents 1 this would be 18 decimals. - /// @return The fixed point decimal value as a uint256. - function toFixedDecimalLossless(Float float, uint8 decimals) external pure returns (uint256) { - return LibDecimalFloat.toFixedDecimalLossless(float, decimals); - } - - /// Exposes `LibDecimalFloat.fromFixedDecimalLossyPacked` for offchain - /// use. - /// @param value The fixed point decimal value to convert. - /// @param decimals The number of decimals in the fixed point - /// representation. e.g. If 1e18 represents 1 this would be 18 decimals. - /// @return float The Float struct containing the signed coefficient and - /// exponent. - /// @return lossless True if the conversion was lossless, false otherwise. - function fromFixedDecimalLossy(uint256 value, uint8 decimals) external pure returns (Float, bool) { - //slither-disable-next-line unused-return - return LibDecimalFloat.fromFixedDecimalLossyPacked(value, decimals); - } - - /// Exposes `LibDecimalFloat.toFixedDecimalLossy` for offchain use. - /// @param float The Float struct to convert. - /// @param decimals The number of decimals in the fixed point - /// representation. e.g. If 1e18 represents 1 this would be 18 decimals. - /// @return value The fixed point decimal value as a uint256. - /// @return lossless True if the conversion was lossless, false otherwise. - function toFixedDecimalLossy(Float float, uint8 decimals) external pure returns (uint256, bool) { - //slither-disable-next-line unused-return - return LibDecimalFloat.toFixedDecimalLossy(float, decimals); - } -} diff --git a/src/generated/LogTables.pointers.sol b/src/generated/LogTables.pointers.sol deleted file mode 100644 index 07b17ef8..00000000 --- a/src/generated/LogTables.pointers.sol +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity ^0.8.25; - -// THIS FILE IS AUTOGENERATED BY ./script/BuildPointers.sol - -// This file is committed to the repository because there is a circular -// dependency between the contract and its pointers file. The contract -// needs the pointers file to exist so that it can compile, and the pointers -// file needs the contract to exist so that it can be compiled. - -/// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0x0000000000000000000000000000000000000000000000000000000000000000); - -/// @dev Log tables. -bytes constant LOG_TABLES = - hex"0000002b0056008000aa80d480fd8126814e8176019e01c501ec02130239825f828582aa82cf82f30318033c0360038303a603c983ec840e843084520473049504b604d704f78517853785578577859605b505d405f306118630864e866c868986a786c406e106fe071a07370753076f878b87a787c387de07f90814082f084a0864887f889988b388cd88e70900091a0933094c0965097e899789b089c889e109f90a110a290a410a588a708a878a9e8ab68acd0ae40afa0b110b280b3e8b548b6b8b818b978bad0bc20bd80bee0c030c180c2e0c430c580c6d0c810c960cab0cbf0cd40ce80cfc0d110d250d390d4c0d600d740d880d9b0dae0dc20dd50de80dfb0e0e0e210e340e470e5a0e6c0e7f0e910ea30eb60ec80eda0eec0efe0f100f220f340f450f570f690f7a0f8b0f9d0fae0fbf0fd00fe10ff2100310141025103610461057106810781088109910a910b910ca10da10ea10fa110a111a1129113911491158116811781187119611a611b511c411d411e311f212011210121f122e123d124b125a126912781286129512a312b212c012ce12dd12eb12f913071316132413321340134e135b136913771385139313a013ae13bb13c913d713e413f113ff140c1419142714341441144e145b146814751482148f149c14a914b614c314d014dc14e914f61502150f151b152815341541154d155915661572157e158a159715a315af15bb15c715d315df15eb15f71603160f161a16261632163e164916551661166c16781683168f169a16a616b116bd16c816d316df16ea16f51700170b17171722172d17381743174e17591764176f177a1785178f179a17a517b017bb17c517d017db17e517f017fa18051810181a1824182f18391844184e18581863186d18771882188c189618a018aa18b518bf18c918d318dd18e718f118fb1905190f19191923192c19361940194a1954195d19671971197a1984198e199719a119ab19b419be19c719d119da19e419ed19f61a001a091a131a1c1a251a2e1a381a411a4a1a531a5d1a661a6f1a781a811a8a1a931a9c1aa51aae1ab71ac01ac91ad21adb1ae41aed1af61aff1b081b101b191b221b2b1b341b3c1b451b4e1b561b5f1b681b701b791b821b8a1b931b9b1ba41bac1bb51bbd1bc61bce1bd61bdf1be71bf01bf81c001c091c111c191c221c2a1c321c3a1c431c4b1c531c5b1c631c6b1c741c7c1c841c8c1c941c9c1ca41cac1cb41cbc1cc41ccc1cd41cdc1ce41cec1cf41cfb1d031d0b1d131d1b1d231d2a1d321d3a1d421d491d511d591d601d681d701d771d7f1d871d8e1d961d9e1da51dad1db41dbc1dc31dcb1dd21dda1de11de91df01df81dff1e061e0e1e151e1d1e241e2b1e331e3a1e411e481e501e571e5e1e661e6d1e741e7b1e821e8a1e911e981e9f1ea61ead1eb41ebc1ec31eca1ed11ed81edf1ee61eed1ef41efb1f021f091f101f171f1e1f251f2c1f331f391f401f471f4e1f551f5c1f631f691f701f771f7e1f851f8b1f921f991fa01fa61fad1fb41fba1fc11fc81fce1fd51fdc1fe21fe91ff01ff61ffd2003200a20112017201e2024202b20312038203e2045204b20522058205f2065206b20722078207f2085208b20922098209f20a520ab20b220b820be20c420cb20d120d720de20e420ea20f020f720fd21032109210f2116211c21222128212e2134213a21412147214d21532159215f2165216b21712177217d21832189218f2195219b21a121a721ad21b321b921bf21c521cb21d121d721dd21e321e921ee21f421fa22002206220c22122217221d22232229222f2234223a22402246224b22512257225d22622268226e22742279227f2285228a22902296229b22a122a722ac22b222b722bd22c322c822ce22d322d922df22e422ea22ef22f522fa23002305230b23102316231b23212326232c23312337233c23412347234c23522357235d23622367236d23722377237d23822388238d23922398239d23a223a823ad23b223b723bd23c223c723cd23d223d723dc23e223e723ec23f123f623fc24012406240b24102416241b24202425242a242f2435243a243f24442449244e24532458245d24632468246d24722477247c24812486248b24902495249a249f24a424a924ae24b324b824bd24c224c724cc24d124d624db24e024e524ea24ef24f424f924fd25022507250c25112516251b252025252529252e25332538253d25422546254b25502555255a255e25632568256d25722576257b258025852589258e25932598259c25a125a625ab25af25b425b925bd25c225c725cb25d025d525d925de25e325e725ec25f125f525fa25ff26032608260d26112616261a261f26232628262d26312636263a263f26432648264d26512656265a265f26632668266c26712675267a267e26832687268c269026952699269e26a226a626ab26af26b426b826bd26c126c626ca26ce26d326d726dc26e026e426e926ed26f126f626fa26ff27032707270c"; - -/// @dev Log tables small. -bytes constant LOG_TABLES_SMALL = - hex"0004090d11151a1e22260004080c0f13171b1f230003070b0e1215191c200003070a0d1014171a1e000306090c0f1215181c000306090b0e1114171a000305080b0e10131618000305080a0d0f12141700020507090c0e10131500020407090b0d10121400020406080b0d0f111300020406080a0c0e101200020406080a0c0e0f110002040607090b0d0f110002040507090b0c0e100002030507090a0c0e0f0002030507080a0b0d0f000203050608090b0d0e000203050608090b0c0e000103040607090a0c0d000103040607090a0b0d000103040607080a0b0c00010304050708090b0c00010304050608090a0c00010304050608090a0b00010204050607090a0b00010204050607080a0b0001020305060708090a0001020305060708090a0001020304050708090a0001020304050608090a0001020304050607080900010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060707080001020304050506070800010203040405060708000102030404050607080001020303040506070800010203030405060708000102020304050607070001020203040506060700010202030405060607000102020304050506070001020203040505060700010202030405050607000101020304040506070001010203040405060700010102030404050606000101020304040506060001010203030405060600010102030304050506000101020303040505060001010203030405050600010102030304050506000101020303040505060001010203030404050600010102020304040506000101020203040405060001010202030404050500010102020304040505000101020203040405050001010202030404050500010102020303040505000101020203030405050001010202030304040500010102020303040405000101020203030404050001010202030304040500010102020303040405000101020203030404050001010202030304040500010102020303040405000101020203030404050001010202030304040500000101020203030404000001010202030304040000010102020303040400000101020203030404000001010202030304040000010102020303040400000101020203030404000001010202030304040000010102020303040400000101020203030404000001010202030304040000010102020303040400000101020203030304"; - -/// @dev Log tables small alt. -bytes constant LOG_TABLES_SMALL_ALT = - hex"0004080c1014181c20250004070b0f13161a1e210003070a0e1114181b1f0003070a0c101316191d000306090c0f1114171a000305080b0e10131619000305080a0d0f121517000205070a0c0f11131600020507090b0e10121500020406080b0d0f1113"; - -/// @dev Anti log tables. -bytes constant ANTI_LOG_TABLES = - hex"03e803ea03ed03ef03f103f403f603f803fb03fd03ff0402040404060409040b040e0410041204150417041a041c041e0421042304260428042b042d04300432043404370439043c043e0441044304460448044b044e0450045304550458045a045d045f046204650467046a046c046f047204740477047a047c047f0481048404870489048c048f049104940497049a049c049f04a204a504a704aa04ad04af04b204b504b804bb04bd04c004c304c604c904cb04ce04d104d404d704da04dd04df04e204e504e804eb04ee04f104f404f704fa04fc04ff050205050508050b050e051105140517051a051d0520052305260529052c052f053205360539053c053f054205450548054b054e055105550558055b055e056105640568056b056e057105740578057b057e058105850588058b058e059205950598059b059f05a205a505a905ac05af05b305b605ba05bd05c005c405c705cb05ce05d105d505d805dc05df05e305e605ea05ed05f105f405f805fb05ff060206060609060d061006140618061b061f06220626062a062d063106350638063c064006430647064b064e06520656065a065d066106650669066c067006740678067c067f06830687068b068f06930697069a069e06a206a606aa06ae06b206b606ba06be06c206c606ca06ce06d206d606da06de06e206e606ea06ee06f206f606fa06ff07030707070b070f07130718071c072007240728072d073107350739073e07420746074a074f07530757075c076007640769076d07710776077a077f07830788078c079007950799079e07a207a707ab07b007b407b907be07c207c707cb07d007d407d907de07e207e707ec07f007f507fa07fe08030808080d08110816081b082008240829082e08330838083d08410846084b08500855085a085f08640869086e08730878087d08820887088c08910896089b08a008a508aa08af08b408ba08bf08c408c908ce08d308d908de08e308e808ee08f308f808fd09030908090d09130918091d09230928092e09330938093e09430949094e09540959095f0964096a096f0975097b09800986098b09910997099c09a209a809ad09b309b909bf09c409ca09d009d609db09e109e709ed09f309f909ff0a040a0a0a100a160a1c0a220a280a2e0a340a3a0a400a460a4c0a520a590a5f0a650a6b0a710a770a7d0a840a8a0a900a960a9c0aa30aa90aaf0ab60abc0ac20ac90acf0ad50adc0ae20ae90aef0af50afc0b020b090b0f0b160b1c0b230b2a0b300b370b3d0b440b4b0b510b580b5f0b650b6c0b730b7a0b800b870b8e0b950b9c0ba30ba90bb00bb70bbe0bc50bcc0bd30bda0be10be80bef0bf60bfd0c040c0b0c120c190c210c280c2f0c360c3d0c450c4c0c530c5a0c620c690c700c780c7f0c860c8e0c950c9c0ca40cab0cb30cba0cc20cc90cd10cd90ce00ce80cef0cf70cff0d060d0e0d160d1d0d250d2d0d350d3c0d440d4c0d540d5c0d640d6c0d730d7b0d830d8b0d930d9b0da30dab0db40dbc0dc40dcc0dd40ddc0de40ded0df50dfd0e050e0d0e160e1e0e260e2f0e370e400e480e500e590e610e6a0e720e7b0e830e8c0e950e9d0ea60eae0eb70ec00ec80ed10eda0ee30eeb0ef40efd0f060f0f0f180f210f2a0f320f3b0f440f4d0f560f600f690f720f7b0f840f8d0f960f9f0fa90fb20fbb0fc40fce0fd70fe00fea0ff30ffd1006100f10191022102c1036103f10491052105c1066106f10791083108c109610a010aa10b410bd10c710d110db10e510ef10f91103110d11171121112b11361140114a1154115e11691173117d11871192119c11a711b111bb11c611d011db11e511f011fb12051210121a12251230123b12451250125b12661271127c12861291129c12a712b212bd12c812d312df12ea12f51300130b13171322132d13381344134f135b13661371137d13881394139f13ab13b713c213ce13da13e513f113fd140914141420142c143814441450145c146814741480148c149814a414b114bd14c914d514e214ee14fa150715131520152c153915451552155e156b157715841591159e15aa15b715c415d115de15ea15f716041611161e162b1639164616531660166d167a1688169516a216b016bd16ca16d816e516f31700170e171c17291737174517521760176e177c178a179717a517b317c117cf17dd17ec17fa18081816182418321841184f185d186c187a1889189718a618b418c318d118e018ef18fd190c191b192a193919471956196519741983199219a119b119c019cf19de19ed19fd1a0c1a1b1a2b1a3a1a4a1a591a691a781a881a981aa71ab71ac71ad71ae71af61b061b161b261b361b461b561b671b771b871b971ba71bb81bc81bd91be91bf91c0a1c1a1c2b1c3c1c4c1c5d1c6e1c7f1c8f1ca01cb11cc21cd31ce41cf51d061d171d281d3a1d4b1d5c1d6e1d7f1d901da21db31dc51dd61de81dfa1e0b1e1d1e2f1e411e521e641e761e881e9a1eac1ebe1ed11ee31ef51f071f1a1f2c1f3e1f511f631f761f881f9b1fae1fc01fd31fe61ff9200c201e203120442057206b207e209120a420b720cb20de20f121052118212c213f21532167217a218e21a221b621ca21de21f22206221a222e22422256226a227f229322a822bc22d122e522fa230e23232338234c23612376238b23a023b523ca23df23f4240a241f2434244a245f2475248a24a024b524cb24e124f6250c25222538254e2564257a259025a625bd25d325e925ff2616262c2643265926702687269e26b426cb26e226f9"; - -/// @dev Anti log tables small. -bytes constant ANTI_LOG_TABLES_SMALL = - hex"0000000101010102020200000001010101020202000000010101010202020000000101010102020200000101010102020202000001010101020202020000010101010202020200000101010102020202000001010101020202030000010101010202020300000101010102020203000001010102020202030000010101020202020300000101010202020303000001010102020203030000010101020202030300000101010202020303000001010102020203030000010101020202030300000101010202030303000001010102020303030000010102020203030300000101020202030303000001010202020303040000010102020203030400000101020202030304000001010202030303040000010102020303030400000101020203030404000001010202030304040000010102020303040400000101020203030404000001010202030304040000010102020303040400010102020303040405000101020203030404050001010202030304040500010102020303040405000101020203030404050001010202030304050500010102020304040505000101020203040405050001010202030404050600010102030304040506000101020303040405060001010203030405050600010102030304050506000101020303040505060001010203040405060600010102030404050606000101020304040506070001020203040505060700010202030405050607000102020304050606070001020203040506060700010202030405060707000102030304050607080001020303040506070800010203040405060708000102030405050607080001020304050606070800010203040506070809000102030405060708090001020304050607080900010203040506070809000102030405060708090001020304050607090a0001020304050708090a0001020304060708090a0001020305060708090a0001020405060708090b00010204050607080a0b00010204050607090a0b00010304050608090a0b00010304050608090a0c00010304050708090a0c00010304050708090b0c000103040507080a0b0c000103040607080a0b0d000103040607090a0b0d000103040607090a0c0d000203050608090b0c0e000203050608090b0c0e000203050608090b0d0e0002030506080a0b0d0f0002030507080a0c0d0f0002030507080a0c0d0f0002030507090a0c0e100002040507090b0c0e100002040507090b0d0e100002040607090b0d0f110002040608090b0d0f1100020406080a0c0e0f1100020406080a0c0e101200020406080a0c0e101200020406080a0c0f111300020406080b0d0f111300020407090b0d0f111400020407090b0d10121400020507090b0e101214"; diff --git a/src/lib/deploy/LibDecimalFloatDeploy.sol b/src/lib/deploy/LibDecimalFloatDeploy.sol deleted file mode 100644 index acd22d0e..00000000 --- a/src/lib/deploy/LibDecimalFloatDeploy.sol +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity ^0.8.25; - -import { - LOG_TABLES, - LOG_TABLES_SMALL, - LOG_TABLES_SMALL_ALT, - ANTI_LOG_TABLES, - ANTI_LOG_TABLES_SMALL -} from "../../generated/LogTables.pointers.sol"; -import {LOG_TABLE_DISAMBIGUATOR} from "../table/LibLogTable.sol"; -import {LogTablesNotDeployed} from "../../error/ErrDecimalFloat.sol"; - -library LibDecimalFloatDeploy { - /// @dev Address of the log tables deployed via Zoltu's deterministic - /// deployment proxy. This address is the same across all EVM-compatible - /// networks. - address constant ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS = address(0xc51a14251b0dcF0ae24A96b7153991378938f5F5); - - /// @dev The expected codehash of the log tables deployed via Zoltu's - /// deterministic deployment proxy. - bytes32 constant LOG_TABLES_DATA_CONTRACT_HASH = 0x2573004ac3a9ee7fc8d73654d76386f1b6b99e34cdf86a689c4691e47143420f; - - /// @dev Address of the DecimalFloat contract deployed via Zoltu's - /// deterministic deployment proxy. - /// This address is the same across all EVM-compatible networks. - address constant ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS = address(0x799632d282178e770C7465cad54aDA1021A913D6); - - /// @dev The expected codehash of the DecimalFloat contract deployed via - /// Zoltu's deterministic deployment proxy. - bytes32 constant DECIMAL_FLOAT_CONTRACT_HASH = 0xdc468883c345d41c0abd98ef2fd933c370bd1682522d37e6f6b729793301f55e; - - /// @dev Deploy constants pinned to each version published to the soldeer - /// registry. These are frozen literals — not aliases of the "current" - /// constants above — so each keeps referencing its own release's deployment - /// after the current constants advance to a newer version. - /// `script/check-published-deploy-constants.sh` (run by - /// `LibDecimalFloatDeployTaggedConstantsTest`) queries the registry and - /// fails if any published version is missing its suite, so publishing a new - /// tag forces pinning that tag's deploy constants here. - - /// @dev Log tables address at the published `0.1.1` soldeer tag. - address constant ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS_0_1_1 = address(0xc51a14251b0dcF0ae24A96b7153991378938f5F5); - - /// @dev Log tables codehash at the published `0.1.1` soldeer tag. - bytes32 constant LOG_TABLES_DATA_CONTRACT_HASH_0_1_1 = - 0x2573004ac3a9ee7fc8d73654d76386f1b6b99e34cdf86a689c4691e47143420f; - - /// @dev DecimalFloat address at the published `0.1.1` soldeer tag. - address constant ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS_0_1_1 = address(0xBee0eEFaffD046c9602109eB30A858Be301CC926); - - /// @dev DecimalFloat codehash at the published `0.1.1` soldeer tag. - bytes32 constant DECIMAL_FLOAT_CONTRACT_HASH_0_1_1 = - 0x7a93d0311f7782b44157ba40e94ec936085ebe001c7893bdd74911c8351d3def; - - /// Combines all log and anti-log tables into a single bytes array for - /// deployment. These are using packed encoding to minimize size and remove - /// the complexity of full ABI encoding. - /// @return The combined tables. - function combinedTables() internal pure returns (bytes memory) { - return abi.encodePacked( - LOG_TABLES, - LOG_TABLES_SMALL, - LOG_TABLES_SMALL_ALT, - ANTI_LOG_TABLES, - ANTI_LOG_TABLES_SMALL, - LOG_TABLE_DISAMBIGUATOR - ); - } - - /// Revert if the log tables data contract is not deployed at the - /// Zoltu-deterministic address with the expected codehash. Call this - /// from the constructor of any contract that integrates with the - /// production `DecimalFloat` (or otherwise reads from - /// `ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS`) so deployment fails loudly on - /// chains where Zoltu has not dropped the tables, instead of silent - /// `extcodecopy`-from-empty corruption at the first transcendental call. - function checkLogTablesDeployed() internal view { - bytes32 actualCodehash = ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash; - if (actualCodehash != LOG_TABLES_DATA_CONTRACT_HASH) { - revert LogTablesNotDeployed( - ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, LOG_TABLES_DATA_CONTRACT_HASH, actualCodehash - ); - } - } -} diff --git a/test/abstract/LogTest.sol b/test/abstract/LogTest.sol index 7798be03..a90152ea 100644 --- a/test/abstract/LogTest.sol +++ b/test/abstract/LogTest.sol @@ -6,41 +6,35 @@ pragma solidity =0.8.25; // forge-lint: disable-next-line(unused-import) import {Test, console2} from "forge-std-1.16.1/src/Test.sol"; import {DataContractMemoryContainer, LibDataContract} from "rain-datacontract-0.1.0/src/lib/LibDataContract.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LibEtchLogTables} from "script/lib/LibEtchLogTables.sol"; +import {LibLogTable, LOG_TABLE_DISAMBIGUATOR} from "src/lib/table/LibLogTable.sol"; abstract contract LogTest is Test { using LibDataContract for DataContractMemoryContainer; address sTables; - /// Etch the log tables runtime at the Zoltu-deterministic deployment - /// address used by the production `DecimalFloat` contract. Without this, - /// the deployed tests below would `extcodecopy` from an empty address - /// while the external helper does the same, both agreeing on garbage. - function setUp() public virtual { - LibEtchLogTables.etchLogTables(vm); - assertEq( - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - "etched tables codehash mismatch" - ); - } - + /// Deploy the combined log/anti-log tables data contract at a `create` + /// address and return it, rebuilding the table bytes purely from + /// `LibLogTable` source. The transcendental library functions take the + /// tables-contract address as a parameter, so this self-contained helper is + /// all the pure-math suite needs: no Zoltu-deterministic deploy pin, no + /// frozen `src/generated` snapshot. function logTables() internal returns (address) { if (sTables == address(0)) { - bytes memory tables = LibDecimalFloatDeploy.combinedTables(); + bytes memory tables = abi.encodePacked( + LibLogTable.toBytes(LibLogTable.logTableDec()), + LibLogTable.toBytes(LibLogTable.logTableDecSmall()), + LibLogTable.toBytes(LibLogTable.logTableDecSmallAlt()), + LibLogTable.toBytes(LibLogTable.antiLogTableDec()), + LibLogTable.toBytes(LibLogTable.antiLogTableDecSmall()), + LOG_TABLE_DISAMBIGUATOR + ); bytes memory creationCode = LibDataContract.contractCreationCode(tables); address tablesAddress; assembly ("memory-safe") { tablesAddress := create(0, add(creationCode, 0x20), mload(creationCode)) } assertTrue(tablesAddress != address(0), "Failed to deploy tables"); - assertEq( - tablesAddress.codehash, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - "Deployed tables codehash does not match expected value" - ); sTables = tablesAddress; } return sTables; diff --git a/test/concrete/DecimalFloat.packLossless.t.sol b/test/concrete/DecimalFloat.packLossless.t.sol deleted file mode 100644 index 1e56ba46..00000000 --- a/test/concrete/DecimalFloat.packLossless.t.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {TestDecimalFloat} from "./TestDecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract DecimalFloatPackLosslessTest is Test { - function packLosslessExternal(int224 signedCoefficient, int32 exponent) external pure returns (Float) { - return LibDecimalFloat.packLossless(signedCoefficient, exponent); - } - - function testPackDeployed(int224 signedCoefficient, int32 exponent) external { - TestDecimalFloat deployed = new TestDecimalFloat(); - - try this.packLosslessExternal(signedCoefficient, exponent) returns (Float packed) { - Float deployedPacked = deployed.packLossless(signedCoefficient, exponent); - - assertEq(Float.unwrap(packed), Float.unwrap(deployedPacked)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.packLossless(signedCoefficient, exponent); - } - } -} diff --git a/test/concrete/TestDecimalFloat.sol b/test/concrete/TestDecimalFloat.sol deleted file mode 100644 index e10a4bab..00000000 --- a/test/concrete/TestDecimalFloat.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -/// Additional exposed functions for testing the internals of floats -/// from downstream environments, e.g. rust. -contract TestDecimalFloat { - using LibDecimalFloat for Float; - - /// Exposes `LibDecimalFloat.packLossless` for offchain use. - /// @param coefficient The coefficient to pack. - /// @param exponent The exponent to pack. - /// @return The packed float. - function packLossless(int224 coefficient, int32 exponent) external pure returns (Float) { - return LibDecimalFloat.packLossless(coefficient, exponent); - } - - /// Exposes `LibDecimalFloat.unpack` for offchain use. - /// @param float The float to unpack. - /// @return coefficient The coefficient of the float. - /// @return exponent The exponent of the float. - function unpack(Float float) external pure returns (int256, int256) { - return LibDecimalFloat.unpack(float); - } -} diff --git a/test/concrete/TestDecimalFloat.unpack.t.sol b/test/concrete/TestDecimalFloat.unpack.t.sol deleted file mode 100644 index 6ce44b6b..00000000 --- a/test/concrete/TestDecimalFloat.unpack.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {TestDecimalFloat} from "./TestDecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract TestDecimalFloatUnpackTest is Test { - using LibDecimalFloat for Float; - - function unpackExternal(Float packed) external pure returns (int256 signedCoefficient, int256 exponent) { - return LibDecimalFloat.unpack(packed); - } - - function testUnpackDeployed(Float packed) external { - TestDecimalFloat deployed = new TestDecimalFloat(); - - try this.unpackExternal(packed) returns (int256 signedCoefficient, int256 exponent) { - (int256 deployedSignedCoefficient, int256 deployedExponent) = deployed.unpack(packed); - - assertEq(signedCoefficient, deployedSignedCoefficient); - assertEq(exponent, deployedExponent); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.unpack(packed); - } - } -} diff --git a/test/script/CopyArtifacts.t.sol b/test/script/CopyArtifacts.t.sol deleted file mode 100644 index f566a653..00000000 --- a/test/script/CopyArtifacts.t.sol +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {LibCopyArtifacts} from "script/lib/LibCopyArtifacts.sol"; - -contract CopyArtifactsTest is Test { - function _assertCommittedMatches(string memory contractName) internal { - bytes memory liveAbi = LibCopyArtifacts.extractStable(vm, contractName); - bytes memory committed = bytes(vm.readFile(LibCopyArtifacts.committedPath(contractName))); - assertEq( - keccak256(liveAbi), - keccak256(committed), - string.concat( - contractName, ": run `forge script script/CopyArtifacts.sol` to update the committed artifact" - ) - ); - } - - function testArtifactsCommitted() external { - string[] memory names = LibCopyArtifacts.contracts(); - for (uint256 i = 0; i < names.length; i++) { - _assertCommittedMatches(names[i]); - } - } -} diff --git a/test/src/concrete/DecimalFloat.abs.t.sol b/test/src/concrete/DecimalFloat.abs.t.sol deleted file mode 100644 index 3216ab5c..00000000 --- a/test/src/concrete/DecimalFloat.abs.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatAbsTest is LogTest { - using LibDecimalFloat for Float; - - function absExternal(Float a) external pure returns (Float) { - return a.abs(); - } - - function testAbsDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.absExternal(a) returns (Float b) { - Float deployedB = deployed.abs(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.abs(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.add.t.sol b/test/src/concrete/DecimalFloat.add.t.sol deleted file mode 100644 index 0a1225dd..00000000 --- a/test/src/concrete/DecimalFloat.add.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatAddTest is LogTest { - using LibDecimalFloat for Float; - - function addExternal(Float a, Float b) external pure returns (Float) { - return a.add(b); - } - - function testAddDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.addExternal(a, b) returns (Float c) { - Float deployedC = deployed.add(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.add(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.ceil.t.sol b/test/src/concrete/DecimalFloat.ceil.t.sol deleted file mode 100644 index 86263017..00000000 --- a/test/src/concrete/DecimalFloat.ceil.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatCeilTest is LogTest { - using LibDecimalFloat for Float; - - function ceilExternal(Float a) external pure returns (Float) { - return a.ceil(); - } - - function testCeilDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.ceilExternal(a) returns (Float b) { - Float deployedB = deployed.ceil(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.ceil(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.constants.t.sol b/test/src/concrete/DecimalFloat.constants.t.sol deleted file mode 100644 index 4f8027d1..00000000 --- a/test/src/concrete/DecimalFloat.constants.t.sol +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatConstantsTest is LogTest { - using LibDecimalFloat for Float; - - function maxPositiveValueExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MAX_POSITIVE_VALUE; - } - - function testMaxPositiveValueDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.maxPositiveValueExternal() returns (Float maxValue) { - Float deployedMaxPositiveValue = deployed.maxPositiveValue(); - - assertEq(Float.unwrap(maxValue), Float.unwrap(deployedMaxPositiveValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.maxPositiveValue(); - } - } - - function minPositiveValueExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MIN_POSITIVE_VALUE; - } - - function testMinPositiveValueDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.minPositiveValueExternal() returns (Float minValue) { - Float deployedMinPositiveValue = deployed.minPositiveValue(); - - assertEq(Float.unwrap(minValue), Float.unwrap(deployedMinPositiveValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.minPositiveValue(); - } - } - - function maxNegativeValueExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MAX_NEGATIVE_VALUE; - } - - function testMaxNegativeValueDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.maxNegativeValueExternal() returns (Float maxNegativeValue) { - Float deployedMaxNegativeValue = deployed.maxNegativeValue(); - - assertEq(Float.unwrap(maxNegativeValue), Float.unwrap(deployedMaxNegativeValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.maxNegativeValue(); - } - } - - function minNegativeValueExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_MIN_NEGATIVE_VALUE; - } - - function testMinNegativeValueDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.minNegativeValueExternal() returns (Float minNegativeValue) { - Float deployedMinNegativeValue = deployed.minNegativeValue(); - - assertEq(Float.unwrap(minNegativeValue), Float.unwrap(deployedMinNegativeValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.minNegativeValue(); - } - } - - function eExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_E; - } - - function testEDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.eExternal() returns (Float eValue) { - Float deployedEValue = deployed.e(); - - assertEq(Float.unwrap(eValue), Float.unwrap(deployedEValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.e(); - } - } - - function zeroExternal() external pure returns (Float) { - return LibDecimalFloat.FLOAT_ZERO; - } - - function testZeroDeployed() external { - DecimalFloat deployed = new DecimalFloat(); - - try this.zeroExternal() returns (Float zeroValue) { - Float deployedZeroValue = deployed.zero(); - - assertEq(Float.unwrap(zeroValue), Float.unwrap(deployedZeroValue)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.zero(); - } - } -} diff --git a/test/src/concrete/DecimalFloat.constructor.t.sol b/test/src/concrete/DecimalFloat.constructor.t.sol deleted file mode 100644 index e11d42fc..00000000 --- a/test/src/concrete/DecimalFloat.constructor.t.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LogTablesNotDeployed} from "src/error/ErrDecimalFloat.sol"; -import {LibEtchLogTables} from "script/lib/LibEtchLogTables.sol"; - -/// Direct tests for the `DecimalFloat` constructor's log-tables guard. These -/// tests deliberately do NOT inherit `LogTest` so the table address is empty -/// at the start, letting the test choose what (if anything) to deploy there. -contract DecimalFloatConstructorTest is Test { - /// Without log tables at the expected address, the constructor reverts. - function testConstructorRevertsWhenLogTablesMissing() external { - bytes32 actualCodehash = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash; - vm.expectRevert( - abi.encodeWithSelector( - LogTablesNotDeployed.selector, - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - actualCodehash - ) - ); - new DecimalFloat(); - } - - /// With unrelated bytecode at the expected address, the codehash mismatch - /// trips the guard. - function testConstructorRevertsOnWrongCodehash() external { - // Etch arbitrary bytes so the codehash differs from the expected. - bytes memory junk = hex"deadbeef"; - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, junk); - bytes32 actualCodehash = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash; - assertTrue(actualCodehash != LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH); - vm.expectRevert( - abi.encodeWithSelector( - LogTablesNotDeployed.selector, - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - actualCodehash - ) - ); - new DecimalFloat(); - } - - /// With the correct log tables runtime etched at the expected address, - /// the constructor succeeds. - function testConstructorSucceedsWhenLogTablesPresent() external { - LibEtchLogTables.etchLogTables(vm); - // Should NOT revert. - DecimalFloat decimalFloat = new DecimalFloat(); - assertTrue(address(decimalFloat) != address(0)); - } - - /// Mutation guard: confirm the constructor's revert is detecting the - /// wrong-codehash path, not just any contract-creation issue. With - /// matching codehash but the right runtime, construction succeeds; with - /// mismatched bytes, construction reverts. The two outcomes diverge only - /// on the codehash check. - function testConstructorMutation() external { - // First half: correct etch — must succeed. - LibEtchLogTables.etchLogTables(vm); - new DecimalFloat(); - - // Mutation: replace the tables runtime with the same length of zero - // bytes. The codehash now mismatches LOG_TABLES_DATA_CONTRACT_HASH. - bytes memory zeros = new bytes(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.code.length); - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, zeros); - bytes32 zeroBytesCodehash = keccak256(zeros); - vm.expectRevert( - abi.encodeWithSelector( - LogTablesNotDeployed.selector, - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - zeroBytesCodehash - ) - ); - new DecimalFloat(); - } -} diff --git a/test/src/concrete/DecimalFloat.div.t.sol b/test/src/concrete/DecimalFloat.div.t.sol deleted file mode 100644 index 0f382f02..00000000 --- a/test/src/concrete/DecimalFloat.div.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatDivTest is LogTest { - using LibDecimalFloat for Float; - - function divExternal(Float a, Float b) external pure returns (Float) { - return a.div(b); - } - - function testDivDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.divExternal(a, b) returns (Float c) { - Float deployedC = deployed.div(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.div(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.eq.t.sol b/test/src/concrete/DecimalFloat.eq.t.sol deleted file mode 100644 index bab15048..00000000 --- a/test/src/concrete/DecimalFloat.eq.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatEqTest is LogTest { - using LibDecimalFloat for Float; - - function eqExternal(Float a, Float b) external pure returns (bool) { - return a.eq(b); - } - - function testEqDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.eqExternal(a, b) returns (bool c) { - bool deployedC = deployed.eq(a, b); - - assertEq(c, deployedC); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.eq(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.floor.t.sol b/test/src/concrete/DecimalFloat.floor.t.sol deleted file mode 100644 index 946c7c3f..00000000 --- a/test/src/concrete/DecimalFloat.floor.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatFloorTest is LogTest { - using LibDecimalFloat for Float; - - function floorExternal(Float a) external pure returns (Float) { - return a.floor(); - } - - function testFloorDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.floorExternal(a) returns (Float b) { - Float deployedB = deployed.floor(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.floor(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.format.t.sol b/test/src/concrete/DecimalFloat.format.t.sol deleted file mode 100644 index ada64233..00000000 --- a/test/src/concrete/DecimalFloat.format.t.sol +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibFormatDecimalFloat} from "src/lib/format/LibFormatDecimalFloat.sol"; -import {ScientificMinNotLessThanMax} from "src/error/ErrDecimalFloat.sol"; - -contract DecimalFloatFormatTest is LogTest { - using LibDecimalFloat for Float; - - function formatExternal(Float a, Float scientificMin, Float scientificMax) external pure returns (string memory) { - Float absA = a.abs(); - return LibFormatDecimalFloat.toDecimalString(a, absA.lt(scientificMin) || absA.gt(scientificMax)); - } - - function testFormatDeployed(Float a, Float scientificMin, Float scientificMax) external { - vm.assume(scientificMin.lt(scientificMax)); - - DecimalFloat deployed = new DecimalFloat(); - - try this.formatExternal(a, scientificMin, scientificMax) returns (string memory str) { - string memory deployedStr = deployed.format(a, scientificMin, scientificMax); - - assertEq(str, deployedStr); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.format(a, scientificMin, scientificMax); - } - } - - function formatBoolExternal(Float a, bool scientific) external pure returns (string memory) { - return LibFormatDecimalFloat.toDecimalString(a, scientific); - } - - function testFormatBoolDeployed(Float a, bool scientific) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.formatBoolExternal(a, scientific) returns (string memory str) { - string memory deployedStr = deployed.format(a, scientific); - - assertEq(str, deployedStr); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.format(a, scientific); - } - } - - function testFormatDefaultDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.formatExternal( - a, deployed.FORMAT_DEFAULT_SCIENTIFIC_MIN(), deployed.FORMAT_DEFAULT_SCIENTIFIC_MAX() - ) returns ( - string memory str - ) { - string memory deployedStr = deployed.format(a); - - assertEq(str, deployedStr); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.format(a); - } - } - - function testFormatScientificMinNotLessThanMaxReverts(Float a, Float scientificMin, Float scientificMax) external { - vm.assume(!scientificMin.lt(scientificMax)); - - DecimalFloat deployed = new DecimalFloat(); - - vm.expectRevert(abi.encodeWithSelector(ScientificMinNotLessThanMax.selector, scientificMin, scientificMax)); - deployed.format(a, scientificMin, scientificMax); - } - - function testFormatConstants() external { - DecimalFloat deployed = new DecimalFloat(); - - assertEq( - Float.unwrap(deployed.FORMAT_DEFAULT_SCIENTIFIC_MIN()), Float.unwrap(LibDecimalFloat.packLossless(1, -4)) - ); - assertEq( - Float.unwrap(deployed.FORMAT_DEFAULT_SCIENTIFIC_MAX()), Float.unwrap(LibDecimalFloat.packLossless(1, 9)) - ); - } -} diff --git a/test/src/concrete/DecimalFloat.frac.t.sol b/test/src/concrete/DecimalFloat.frac.t.sol deleted file mode 100644 index 2b8f37c6..00000000 --- a/test/src/concrete/DecimalFloat.frac.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatFracTest is LogTest { - using LibDecimalFloat for Float; - - function fracExternal(Float a) external pure returns (Float) { - return a.frac(); - } - - function testFracDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.fracExternal(a) returns (Float b) { - Float deployedB = deployed.frac(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.frac(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.fromFixedDecimalLossless.t.sol b/test/src/concrete/DecimalFloat.fromFixedDecimalLossless.t.sol deleted file mode 100644 index e5335022..00000000 --- a/test/src/concrete/DecimalFloat.fromFixedDecimalLossless.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract DecimalFloatFromFixedDecimalLosslessTest is LogTest { - using LibDecimalFloat for Float; - - function fromFixedDecimalLosslessExternal(uint256 fixedDecimal, uint8 decimals) external pure returns (Float) { - return LibDecimalFloat.fromFixedDecimalLosslessPacked(fixedDecimal, decimals); - } - - function testFromFixedDecimalLosslessDeployed(uint256 fixedDecimal, uint8 decimals) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.fromFixedDecimalLosslessExternal(fixedDecimal, decimals) returns (Float packed) { - Float deployedPacked = deployed.fromFixedDecimalLossless(fixedDecimal, decimals); - - assertEq(Float.unwrap(packed), Float.unwrap(deployedPacked)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.fromFixedDecimalLossless(fixedDecimal, decimals); - } - } -} diff --git a/test/src/concrete/DecimalFloat.fromFixedDecimalLossy.t.sol b/test/src/concrete/DecimalFloat.fromFixedDecimalLossy.t.sol deleted file mode 100644 index 6cea8ac2..00000000 --- a/test/src/concrete/DecimalFloat.fromFixedDecimalLossy.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract DecimalFloatFromFixedDecimalLossyTest is LogTest { - using LibDecimalFloat for Float; - - function fromFixedDecimalLossyExternal(uint256 fixedDecimal, uint8 decimals) external pure returns (Float, bool) { - return LibDecimalFloat.fromFixedDecimalLossyPacked(fixedDecimal, decimals); - } - - function testFromFixedDecimalLossyDeployed(uint256 fixedDecimal, uint8 decimals) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.fromFixedDecimalLossyExternal(fixedDecimal, decimals) returns (Float packed, bool lossless) { - (Float deployedPacked, bool deployedLossless) = deployed.fromFixedDecimalLossy(fixedDecimal, decimals); - - assertEq(Float.unwrap(packed), Float.unwrap(deployedPacked)); - assertEq(lossless, deployedLossless); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.fromFixedDecimalLossy(fixedDecimal, decimals); - } - } -} diff --git a/test/src/concrete/DecimalFloat.gt.t.sol b/test/src/concrete/DecimalFloat.gt.t.sol deleted file mode 100644 index 7b263730..00000000 --- a/test/src/concrete/DecimalFloat.gt.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatGtTest is LogTest { - using LibDecimalFloat for Float; - - function gtExternal(Float a, Float b) external pure returns (bool) { - return a.gt(b); - } - - function testGtDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.gtExternal(a, b) returns (bool c) { - bool deployedC = deployed.gt(a, b); - - assertEq(c, deployedC); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.gt(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.gte.t.sol b/test/src/concrete/DecimalFloat.gte.t.sol deleted file mode 100644 index 9d16a213..00000000 --- a/test/src/concrete/DecimalFloat.gte.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatGteTest is LogTest { - using LibDecimalFloat for Float; - - function gteExternal(Float a, Float b) external pure returns (bool) { - return a.gte(b); - } - - function testGteDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.gteExternal(a, b) returns (bool c) { - bool deployedC = deployed.gte(a, b); - - assertEq(c, deployedC); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.gte(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.integer.t.sol b/test/src/concrete/DecimalFloat.integer.t.sol deleted file mode 100644 index 3e304b8f..00000000 --- a/test/src/concrete/DecimalFloat.integer.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatIntegerTest is LogTest { - using LibDecimalFloat for Float; - - function integerExternal(Float a) external pure returns (Float) { - return a.integer(); - } - - function testIntegerDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.integerExternal(a) returns (Float b) { - Float deployedB = deployed.integer(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.integer(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.inv.t.sol b/test/src/concrete/DecimalFloat.inv.t.sol deleted file mode 100644 index 66dd4732..00000000 --- a/test/src/concrete/DecimalFloat.inv.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatInvTest is LogTest { - using LibDecimalFloat for Float; - - function invExternal(Float a) external pure returns (Float) { - return a.inv(); - } - - function testInvDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.invExternal(a) returns (Float b) { - Float deployedB = deployed.inv(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.inv(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.isZero.t.sol b/test/src/concrete/DecimalFloat.isZero.t.sol deleted file mode 100644 index 9355584b..00000000 --- a/test/src/concrete/DecimalFloat.isZero.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatIsZeroTest is LogTest { - using LibDecimalFloat for Float; - - function isZeroExternal(Float a) external pure returns (bool) { - return a.isZero(); - } - - function testIsZeroDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.isZeroExternal(a) returns (bool b) { - bool deployedB = deployed.isZero(a); - - assertEq(b, deployedB); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.isZero(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.log10.t.sol b/test/src/concrete/DecimalFloat.log10.t.sol deleted file mode 100644 index 53852046..00000000 --- a/test/src/concrete/DecimalFloat.log10.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatLog10Test is LogTest { - using LibDecimalFloat for Float; - - function log10External(Float a) external view returns (Float) { - return a.log10(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - function testLog10Deployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.log10External(a) returns (Float b) { - Float deployedB = deployed.log10(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.log10(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.lt.t.sol b/test/src/concrete/DecimalFloat.lt.t.sol deleted file mode 100644 index 377d88b7..00000000 --- a/test/src/concrete/DecimalFloat.lt.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatLtTest is LogTest { - using LibDecimalFloat for Float; - - function ltExternal(Float a, Float b) external pure returns (bool) { - return a.lt(b); - } - - function testLtDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.ltExternal(a, b) returns (bool c) { - bool deployedC = deployed.lt(a, b); - - assertEq(c, deployedC); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.lt(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.lte.t.sol b/test/src/concrete/DecimalFloat.lte.t.sol deleted file mode 100644 index 38572345..00000000 --- a/test/src/concrete/DecimalFloat.lte.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatLteTest is LogTest { - using LibDecimalFloat for Float; - - function lteExternal(Float a, Float b) external pure returns (bool) { - return a.lte(b); - } - - function testLteDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.lteExternal(a, b) returns (bool c) { - bool deployedC = deployed.lte(a, b); - - assertEq(c, deployedC); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.lte(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.max.t.sol b/test/src/concrete/DecimalFloat.max.t.sol deleted file mode 100644 index 020fcadd..00000000 --- a/test/src/concrete/DecimalFloat.max.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatMaxTest is LogTest { - using LibDecimalFloat for Float; - - function maxExternal(Float a, Float b) external pure returns (Float) { - return a.max(b); - } - - function testMaxDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.maxExternal(a, b) returns (Float c) { - Float deployedC = deployed.max(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.max(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.min.t.sol b/test/src/concrete/DecimalFloat.min.t.sol deleted file mode 100644 index 776cb09b..00000000 --- a/test/src/concrete/DecimalFloat.min.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; - -contract DecimalFloatMinTest is LogTest { - using LibDecimalFloat for Float; - - function minExternal(Float a, Float b) external pure returns (Float) { - return a.min(b); - } - - function testMinDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.minExternal(a, b) returns (Float c) { - Float deployedC = deployed.min(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.min(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.minus.t.sol b/test/src/concrete/DecimalFloat.minus.t.sol deleted file mode 100644 index 769c0f3b..00000000 --- a/test/src/concrete/DecimalFloat.minus.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatMinusTest is LogTest { - using LibDecimalFloat for Float; - - function minusExternal(Float a) external pure returns (Float) { - return a.minus(); - } - - function testMinusDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.minusExternal(a) returns (Float b) { - Float deployedB = deployed.minus(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.minus(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.mul.t.sol b/test/src/concrete/DecimalFloat.mul.t.sol deleted file mode 100644 index 28bfafb3..00000000 --- a/test/src/concrete/DecimalFloat.mul.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract DecimalFloatMulTest is LogTest { - using LibDecimalFloat for Float; - - function mulExternal(Float a, Float b) external pure returns (Float) { - return a.mul(b); - } - - function testMulDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.mulExternal(a, b) returns (Float c) { - Float deployedC = deployed.mul(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.mul(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.parse.t.sol b/test/src/concrete/DecimalFloat.parse.t.sol deleted file mode 100644 index 30d8059c..00000000 --- a/test/src/concrete/DecimalFloat.parse.t.sol +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LibParseDecimalFloat} from "src/lib/parse/LibParseDecimalFloat.sol"; - -contract DecimalFloatParseTest is LogTest { - using LibDecimalFloat for Float; - - function parseExternal(string memory str) external pure returns (bytes4, Float) { - return LibParseDecimalFloat.parseDecimalFloat(str); - } - - function testParseDeployed(string memory str) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.parseExternal(str) returns (bytes4 errorSelector, Float parsed) { - (bytes4 deployedErrorSelector, Float deployedParsed) = deployed.parse(str); - - assertEq(errorSelector, deployedErrorSelector); - assertEq(Float.unwrap(parsed), Float.unwrap(deployedParsed)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.parse(str); - } - } -} diff --git a/test/src/concrete/DecimalFloat.pow.t.sol b/test/src/concrete/DecimalFloat.pow.t.sol deleted file mode 100644 index fe95a8be..00000000 --- a/test/src/concrete/DecimalFloat.pow.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatPowTest is LogTest { - using LibDecimalFloat for Float; - - function powExternal(Float a, Float b) external view returns (Float) { - return a.pow(b, LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - function testPowDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.powExternal(a, b) returns (Float c) { - Float deployedC = deployed.pow(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.pow(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.pow10.t.sol b/test/src/concrete/DecimalFloat.pow10.t.sol deleted file mode 100644 index 658b1290..00000000 --- a/test/src/concrete/DecimalFloat.pow10.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatPow10Test is LogTest { - using LibDecimalFloat for Float; - - function pow10External(Float a) external view returns (Float) { - return a.pow10(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - function testPow10Deployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.pow10External(a) returns (Float b) { - Float deployedB = deployed.pow10(a); - - assertEq(Float.unwrap(b), Float.unwrap(deployedB)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.pow10(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.sqrt.t.sol b/test/src/concrete/DecimalFloat.sqrt.t.sol deleted file mode 100644 index ef020e5a..00000000 --- a/test/src/concrete/DecimalFloat.sqrt.t.sol +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatSqrtTest is LogTest { - using LibDecimalFloat for Float; - - function sqrtExternal(Float a) external view returns (Float) { - return a.sqrt(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - } - - function testSqrtDeployed(Float a) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.sqrtExternal(a) returns (Float c) { - Float deployedC = deployed.sqrt(a); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.sqrt(a); - } - } -} diff --git a/test/src/concrete/DecimalFloat.sub.t.sol b/test/src/concrete/DecimalFloat.sub.t.sol deleted file mode 100644 index 4794c972..00000000 --- a/test/src/concrete/DecimalFloat.sub.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; - -contract DecimalFloatSubTest is LogTest { - using LibDecimalFloat for Float; - - function subExternal(Float a, Float b) external pure returns (Float) { - return a.sub(b); - } - - function testSubDeployed(Float a, Float b) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.subExternal(a, b) returns (Float c) { - Float deployedC = deployed.sub(a, b); - - assertEq(Float.unwrap(c), Float.unwrap(deployedC)); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.sub(a, b); - } - } -} diff --git a/test/src/concrete/DecimalFloat.toFixedDecimalLossless.t.sol b/test/src/concrete/DecimalFloat.toFixedDecimalLossless.t.sol deleted file mode 100644 index 9d03e98d..00000000 --- a/test/src/concrete/DecimalFloat.toFixedDecimalLossless.t.sol +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; - -contract DecimalFloatToFixedDecimalLosslessTest is LogTest { - using LibDecimalFloat for Float; - - function toFixedDecimalLosslessExternal(Float packed, uint8 decimals) external pure returns (uint256) { - return LibDecimalFloat.toFixedDecimalLossless(packed, decimals); - } - - function testToFixedDecimalLosslessDeployed(Float packed, uint8 decimals) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.toFixedDecimalLosslessExternal(packed, decimals) returns (uint256 fixedDecimal) { - uint256 deployedFixedDecimal = deployed.toFixedDecimalLossless(packed, decimals); - - assertEq(fixedDecimal, deployedFixedDecimal); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.toFixedDecimalLossless(packed, decimals); - } - } -} diff --git a/test/src/concrete/DecimalFloat.toFixedDecimalLossy.t.sol b/test/src/concrete/DecimalFloat.toFixedDecimalLossy.t.sol deleted file mode 100644 index 8b0f52e7..00000000 --- a/test/src/concrete/DecimalFloat.toFixedDecimalLossy.t.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {LogTest} from "test/abstract/LogTest.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDecimalFloat, Float} from "src/lib/LibDecimalFloat.sol"; -import {FixedDecimalOverflow} from "src/error/ErrDecimalFloat.sol"; - -contract DecimalFloatToFixedDecimalLossyTest is LogTest { - using LibDecimalFloat for Float; - - function toFixedDecimalLossyExternal(Float packed, uint8 decimals) external pure returns (uint256, bool) { - return LibDecimalFloat.toFixedDecimalLossy(packed, decimals); - } - - /// `toFixedDecimalLossy` reverts with `FixedDecimalOverflow` instead of - /// `Panic(0x11)` when the positive-exponent scaling would overflow - /// uint256. Two distinct overflow paths: `10 ** finalExponent` itself - /// (exponent > 77) and `coefficient * scale` (coefficient too large for - /// the chosen scale). Reverting rather than returning a silent zero - /// avoids decapitating the high bits of a real value. - function testToFixedDecimalLossyPositiveExponentScaleOverflow() external { - Float aboveScaleLimit = LibDecimalFloat.packLossless(1, 78); - vm.expectRevert(abi.encodeWithSelector(FixedDecimalOverflow.selector, int256(1), int256(78), uint8(0))); - this.toFixedDecimalLossyExternal(aboveScaleLimit, 0); - } - - function testToFixedDecimalLossyPositiveExponentMulOverflow() external { - Float coefficientOverflowsScale = LibDecimalFloat.packLossless(type(int224).max, 50); - vm.expectRevert( - abi.encodeWithSelector(FixedDecimalOverflow.selector, int256(type(int224).max), int256(50), uint8(0)) - ); - this.toFixedDecimalLossyExternal(coefficientOverflowsScale, 0); - } - - function testToFixedDecimalLossyDeployed(Float packed, uint8 decimals) external { - DecimalFloat deployed = new DecimalFloat(); - - try this.toFixedDecimalLossyExternal(packed, decimals) returns (uint256 fixedDecimal, bool lossless) { - (uint256 deployedFixedDecimal, bool deployedLossless) = deployed.toFixedDecimalLossy(packed, decimals); - - assertEq(fixedDecimal, deployedFixedDecimal); - assertEq(lossless, deployedLossless); - } catch (bytes memory err) { - vm.expectRevert(err); - deployed.toFixedDecimalLossy(packed, decimals); - } - } -} diff --git a/test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol b/test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol deleted file mode 100644 index a94afeb4..00000000 --- a/test/src/lib/deploy/LibDecimalFloatDeploy.checkLogTablesDeployed.t.sol +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LibDataContract} from "rain-datacontract-0.1.0/src/lib/LibDataContract.sol"; -import {LogTablesNotDeployed} from "src/error/ErrDecimalFloat.sol"; - -/// Direct tests for `LibDecimalFloatDeploy.checkLogTablesDeployed`. These -/// deliberately do NOT inherit `LogTest` so the table address starts empty. -contract LibDecimalFloatDeployCheckLogTablesDeployedTest is Test { - /// Empty address → revert with the expected error and arguments. - function testCheckLogTablesDeployedRevertsWhenMissing() external { - bytes32 actualCodehash = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash; - vm.expectRevert( - abi.encodeWithSelector( - LogTablesNotDeployed.selector, - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - actualCodehash - ) - ); - this.callCheckLogTablesDeployed(); - } - - /// Wrong bytecode at the address → codehash mismatch → revert. - function testCheckLogTablesDeployedRevertsOnWrongCodehash() external { - bytes memory junk = hex"deadbeef"; - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, junk); - bytes32 actualCodehash = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS.codehash; - assertTrue(actualCodehash != LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH); - vm.expectRevert( - abi.encodeWithSelector( - LogTablesNotDeployed.selector, - LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - actualCodehash - ) - ); - this.callCheckLogTablesDeployed(); - } - - /// Correct table runtime at the expected address → no revert. - function testCheckLogTablesDeployedSucceedsWhenPresent() external { - bytes memory tables = LibDecimalFloatDeploy.combinedTables(); - bytes memory creationCode = LibDataContract.contractCreationCode(tables); - address temp; - assembly ("memory-safe") { - temp := create(0, add(creationCode, 0x20), mload(creationCode)) - } - require(temp != address(0), "log tables deploy failed in test setup"); - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, temp.code); - // Should not revert. - this.callCheckLogTablesDeployed(); - } - - /// Mutation: with correct etch the call succeeds; replacing the runtime - /// with same-length zeroes flips the codehash and the call reverts. - /// Confirms the test is keyed on the codehash check, not anything else. - function testCheckLogTablesDeployedMutation() external { - bytes memory tables = LibDecimalFloatDeploy.combinedTables(); - bytes memory creationCode = LibDataContract.contractCreationCode(tables); - address temp; - assembly ("memory-safe") { - temp := create(0, add(creationCode, 0x20), mload(creationCode)) - } - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, temp.code); - this.callCheckLogTablesDeployed(); - - bytes memory zeros = new bytes(temp.code.length); - vm.etch(LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS, zeros); - vm.expectRevert(); - this.callCheckLogTablesDeployed(); - } - - /// `vm.expectRevert` only catches reverts in external calls, so wrap the - /// internal lib call. - function callCheckLogTablesDeployed() external view { - LibDecimalFloatDeploy.checkLogTablesDeployed(); - } -} diff --git a/test/src/lib/deploy/LibDecimalFloatDeploy.t.sol b/test/src/lib/deploy/LibDecimalFloatDeploy.t.sol deleted file mode 100644 index 06dd52aa..00000000 --- a/test/src/lib/deploy/LibDecimalFloatDeploy.t.sol +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {LibRainDeploy} from "rain-deploy-0.1.3/src/lib/LibRainDeploy.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {DecimalFloat} from "src/concrete/DecimalFloat.sol"; -import {LibDataContract} from "rain-datacontract-0.1.0/src/lib/LibDataContract.sol"; - -contract LibDecimalFloatDeployTest is Test { - /// `LibRainDeploy.etchZoltuFactory` puts the factory bytecode at the - /// deterministic factory address using `vm.etch`. No fork required — - /// the test runs entirely in-memory, which avoids RPC-flake and the - /// "address already has code" collision when a deploy target is - /// already populated on the chosen prod chain. - function setUp() public { - LibRainDeploy.etchZoltuFactory(vm); - } - - function testDeployAddress() external { - // The `DecimalFloat` constructor checks the log tables are at the - // expected address with the expected codehash. Deploy them first. - bytes memory logTables = LibDataContract.contractCreationCode(LibDecimalFloatDeploy.combinedTables()); - LibRainDeploy.deployZoltu(logTables); - - address deployedAddress = LibRainDeploy.deployZoltu(type(DecimalFloat).creationCode); - - assertEq(deployedAddress, LibDecimalFloatDeploy.ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS); - assertTrue(address(deployedAddress).code.length > 0, "Deployed address has no code"); - - assertEq(address(deployedAddress).codehash, LibDecimalFloatDeploy.DECIMAL_FLOAT_CONTRACT_HASH); - } - - function testExpectedCodeHashDecimalFloat() external { - // `new DecimalFloat()` triggers the constructor's log-tables guard; - // deploy them via Zoltu first. - bytes memory logTables = LibDataContract.contractCreationCode(LibDecimalFloatDeploy.combinedTables()); - LibRainDeploy.deployZoltu(logTables); - - DecimalFloat decimalFloat = new DecimalFloat(); - - assertEq(address(decimalFloat).codehash, LibDecimalFloatDeploy.DECIMAL_FLOAT_CONTRACT_HASH); - } - - function testDeployAddressLogTables() external { - bytes memory logTables = LibDataContract.contractCreationCode(LibDecimalFloatDeploy.combinedTables()); - address deployedAddress = LibRainDeploy.deployZoltu(logTables); - - assertEq(deployedAddress, LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS); - assertEq(address(deployedAddress).codehash, LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH); - } - - function testExpectedCodeHashLogTables() external { - bytes memory logTables = LibDataContract.contractCreationCode(LibDecimalFloatDeploy.combinedTables()); - - address deployedAddress; - assembly ("memory-safe") { - deployedAddress := create(0, add(logTables, 0x20), mload(logTables)) - } - - assertEq(deployedAddress.codehash, LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH); - assertTrue(address(deployedAddress).code.length > 0, "Deployed address has no code"); - } -} diff --git a/test/src/lib/deploy/LibDecimalFloatDeployProd.t.sol b/test/src/lib/deploy/LibDecimalFloatDeployProd.t.sol deleted file mode 100644 index 04403360..00000000 --- a/test/src/lib/deploy/LibDecimalFloatDeployProd.t.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {LibDecimalFloatDeploy} from "src/lib/deploy/LibDecimalFloatDeploy.sol"; -import {LibRainDeploy} from "rain-deploy-0.1.3/src/lib/LibRainDeploy.sol"; - -/// @title LibDecimalFloatDeployProdTest -/// @notice Verifies that both the log tables data contract and the DecimalFloat -/// contract are deployed on every supported production network with the expected -/// addresses and code hashes. -contract LibDecimalFloatDeployProdTest is Test { - function checkProdDeployment(string memory network) internal { - vm.createSelectFork(network); - - address logTables = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_LOG_TABLES_ADDRESS; - assertTrue(logTables.code.length > 0, string.concat(network, ": log tables not deployed")); - assertEq( - logTables.codehash, - LibDecimalFloatDeploy.LOG_TABLES_DATA_CONTRACT_HASH, - string.concat(network, ": log tables code hash mismatch") - ); - - address decimalFloat = LibDecimalFloatDeploy.ZOLTU_DEPLOYED_DECIMAL_FLOAT_ADDRESS; - assertTrue(decimalFloat.code.length > 0, string.concat(network, ": DecimalFloat not deployed")); - assertEq( - decimalFloat.codehash, - LibDecimalFloatDeploy.DECIMAL_FLOAT_CONTRACT_HASH, - string.concat(network, ": DecimalFloat code hash mismatch") - ); - } - - function testProdDeploymentArbitrum() external { - checkProdDeployment("arbitrum"); - } - - function testProdDeploymentBase() external { - checkProdDeployment("base"); - } - - function testProdDeploymentBaseSepolia() external { - checkProdDeployment("base_sepolia"); - } - - function testProdDeploymentFlare() external { - checkProdDeployment("flare"); - } - - function testProdDeploymentPolygon() external { - checkProdDeployment("polygon"); - } -} diff --git a/test/src/lib/deploy/LibDecimalFloatDeployTaggedConstants.t.sol b/test/src/lib/deploy/LibDecimalFloatDeployTaggedConstants.t.sol deleted file mode 100644 index f1b24877..00000000 --- a/test/src/lib/deploy/LibDecimalFloatDeployTaggedConstants.t.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; - -/// @title LibDecimalFloatDeployTaggedConstantsTest -/// @notice Every version published to the soldeer registry for `rain-math-float` -/// must have a full suite of pinned deploy constants in `LibDecimalFloatDeploy`: -/// a log-tables address + codehash and a DecimalFloat address + codehash for -/// each published version. `script/check-published-deploy-constants.sh` queries -/// the live registry (via FFI) and lists any missing constants, so publishing a -/// new tag without pinning its constants fails this test. Skips if the registry -/// is unreachable rather than failing on network flakiness. -contract LibDecimalFloatDeployTaggedConstantsTest is Test { - function testAllPublishedSoldeerTagsHaveAFullConstantSuite() external { - string[] memory cmd = new string[](2); - cmd[0] = "bash"; - cmd[1] = "script/check-published-deploy-constants.sh"; - bytes memory out = vm.ffi(cmd); - - // The registry could not be reached; there is nothing to verify. - if (_startsWith(out, bytes("SKIP"))) { - vm.skip(true); - return; - } - - // On failure the actual value lists the missing `*_` constants. - assertEq(string(out), "OK", "a published soldeer tag is missing pinned deploy constants"); - } - - function _startsWith(bytes memory s, bytes memory prefix) private pure returns (bool) { - if (s.length < prefix.length) { - return false; - } - for (uint256 i = 0; i < prefix.length; i++) { - if (s[i] != prefix[i]) { - return false; - } - } - return true; - } -} diff --git a/test/src/lib/table/LibLogTable.bytes.t.sol b/test/src/lib/table/LibLogTable.bytes.t.sol deleted file mode 100644 index 4ac9e6ff..00000000 --- a/test/src/lib/table/LibLogTable.bytes.t.sol +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: LicenseRef-DCL-1.0 -// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd -pragma solidity =0.8.25; - -import {Test} from "forge-std-1.16.1/src/Test.sol"; -import {LibLogTable} from "src/lib/table/LibLogTable.sol"; -import { - LOG_TABLES, - LOG_TABLES_SMALL, - LOG_TABLES_SMALL_ALT, - ANTI_LOG_TABLES, - ANTI_LOG_TABLES_SMALL -} from "src/generated/LogTables.pointers.sol"; - -/// @title LibLogTableBytesTest -/// @notice Verifies that toBytes encoding of each table matches the -/// AOT-compiled constants in LogTables.pointers.sol. -contract LibLogTableBytesTest is Test { - /// toBytes(logTableDec()) matches the generated LOG_TABLES constant. - function testToBytesLogTableDec() external pure { - bytes memory result = LibLogTable.toBytes(LibLogTable.logTableDec()); - assertEq(result, LOG_TABLES, "log table encoding mismatch"); - } - - /// toBytes(antiLogTableDec()) matches the generated ANTI_LOG_TABLES constant. - function testToBytesAntiLogTableDec() external pure { - bytes memory result = LibLogTable.toBytes(LibLogTable.antiLogTableDec()); - assertEq(result, ANTI_LOG_TABLES, "antilog table encoding mismatch"); - } - - /// toBytes(logTableDecSmall()) matches the generated LOG_TABLES_SMALL constant. - function testToBytesLogTableDecSmall() external pure { - bytes memory result = LibLogTable.toBytes(LibLogTable.logTableDecSmall()); - assertEq(result, LOG_TABLES_SMALL, "log small table encoding mismatch"); - } - - /// toBytes(logTableDecSmallAlt()) matches the generated LOG_TABLES_SMALL_ALT constant. - function testToBytesLogTableDecSmallAlt() external pure { - bytes memory result = LibLogTable.toBytes(LibLogTable.logTableDecSmallAlt()); - assertEq(result, LOG_TABLES_SMALL_ALT, "log small alt table encoding mismatch"); - } - - /// toBytes(antiLogTableDecSmall()) matches the generated ANTI_LOG_TABLES_SMALL constant. - function testToBytesAntiLogTableDecSmall() external pure { - bytes memory result = LibLogTable.toBytes(LibLogTable.antiLogTableDecSmall()); - assertEq(result, ANTI_LOG_TABLES_SMALL, "antilog small table encoding mismatch"); - } -} diff --git a/test_js/float.test.ts b/test_js/float.test.ts deleted file mode 100644 index ca30a2c7..00000000 --- a/test_js/float.test.ts +++ /dev/null @@ -1,314 +0,0 @@ -import { describe, it, expect, assert } from "vitest"; - -describe("Test Float Bindings", () => { - describe("CJS", async () => { - await runTests("cjs"); - }); - - describe("ESM", async () => { - await runTests("esm"); - }); - - async function runTests(mod: "cjs" | "esm") { - // load the Float class from the appropriate module - const { Float } = await (mod === "cjs" - ? import("../dist/cjs") - : import("../dist/esm")); - - it("should test parse", () => { - const float = Float.parse("3.14")?.value!; - expect(float.asHex()).toBe( - "0xfffffffe0000000000000000000000000000000000000000000000000000013a", - ); - }); - - it("should test format", () => { - const float = Float.fromHex( - "0xfffffffe0000000000000000000000000000000000000000000000000000013a", - )?.value!; - expect(float.format()?.value!).toBe("3.14"); - }); - - it("should test format and fromFixedDecimal", () => { - const float = Float.fromFixedDecimal(12345n, 2)?.value!; - expect(float.format()?.value!).toBe("123.45"); - }); - - it("should test toFixedDecimal", () => { - const float = Float.parse("123.45")?.value!; - expect(float.toFixedDecimal(2)?.value!).toBe(12345n); - }); - - it("should test toFixedDecimal roundtrip", () => { - const originalValue = 9876543210n; - const decimals = 8; - const float = Float.fromFixedDecimal(originalValue, decimals)?.value!; - const result = float.toFixedDecimal(decimals)?.value!; - expect(result).toBe(originalValue); - }); - - it("should test fromFixedDecimalLossy with lossless conversion", () => { - const result = Float.fromFixedDecimalLossy(12345n, 2); - expect(result.float.format()?.value!).toBe("123.45"); - expect(result.lossless).toBe(true); - }); - - it("should test toFixedDecimalLossy with lossy conversion", () => { - const float = Float.fromFixedDecimal(12345n, 3)?.value!; - const result = float.toFixedDecimalLossy(2); - expect(result.error).toBeUndefined(); - expect(result.value!.value).toBe("1234"); - expect(result.value!.lossless).toBe(false); - }); - - it("should test toFixedDecimalLossy with lossless conversion", () => { - const float = Float.fromFixedDecimal(12340n, 3)?.value!; - const result = float.toFixedDecimalLossy(2); - expect(result.error).toBeUndefined(); - expect(result.value!.value).toBe("1234"); - expect(result.value!.lossless).toBe(true); - }); - - it("should try from bigint", () => { - const result = Float.tryFromBigint(5n); - assert.ok( - result.error === undefined, - `Expected no error, but got: ${result.error?.readableMsg}`, - ); - - const expected = Float.fromHex( - "0x0000000000000000000000000000000000000000000000000000000000000005", - )?.value!; - expect(result.value.eq(expected)).toBeTruthy(); - }); - - it("should convert from bigint", () => { - const result = Float.fromBigint(18n); - const expected = Float.fromHex( - "0x0000000000000000000000000000000000000000000000000000000000000012", - )?.value!; - expect(result.eq(expected)).toBeTruthy(); - }); - - it("should try to bigint", () => { - const float = Float.fromHex( - "0x0000000000000000000000000000000000000000000000000000000000000008", - )?.value!; - const result = float.tryToBigint(); - assert.ok( - result.error === undefined, - `Expected no error, but got: ${result.error?.readableMsg}`, - ); - - expect(result.value).toBe(8n); - }); - - it("should convert to bigint", () => { - const float = Float.fromHex( - "0x0000000000000000000000000000000000000000000000000000000000001234", - )?.value!; - const result = float.toBigint(); - - expect(result).toBe(BigInt("0x1234")); - }); - - it("should test logic ops", () => { - const a = Float.fromBigint(1n); - const b = Float.fromBigint(2n); - const c = Float.fromBigint(1n); - const zero = Float.fromBigint(0n); - const neg = Float.parse("-1")?.value!; - - expect(a.lt(b)?.value!).toBe(true); - expect(a.lte(b)?.value!).toBe(true); - expect(a.lte(c)?.value!).toBe(true); - - expect(b.gt(a)?.value!).toBe(true); - expect(b.gte(a)?.value!).toBe(true); - expect(c.gte(a)?.value!).toBe(true); - - expect(a.eq(c)?.value!).toBe(true); - expect(zero.isZero()?.value!).toBe(true); - expect(neg.neg()?.value!.eq(a)?.value!).toBe(true); - - expect(a.max(b)?.value!.eq(b)?.value!).toBe(true); - expect(a.min(b)?.value!.eq(a)?.value!).toBe(true); - }); - - it("should test math ops", () => { - const a = Float.parse("3.14")?.value!; - const b = Float.parse("-3.14")?.value!; - const c = Float.parse("2.0")?.value!; - - expect(a.floor()?.value!.format()?.value!).toBe("3"); - expect(a.frac()?.value!.format()?.value!).toBe("0.14"); - expect(c.inv()?.value!.format()?.value!).toBe("0.5"); - expect(b.abs()?.value!.format()?.value!).toBe("3.14"); - expect(a.sub(b)?.value!.format()?.value!).toBe("6.28"); - expect(a.mul(c)?.value!.format()?.value!).toBe("6.28"); - expect(a.div(c)?.value!.format()?.value!).toBe("1.57"); - expect(a.div(b)?.value!.format()?.value!).toBe("-1"); - expect(a.add(b)?.value!.format()?.value!).toBe("0"); - }); - - it("should test zero constant", () => { - // Test the zero function - const zeroResult = Float.zero(); - expect(zeroResult.error).toBeUndefined(); - - const zero = zeroResult.value!; - - // Test that zero is actually zero - expect(zero.isZero()?.value!).toBe(true); - expect(zero.format()?.value!).toBe("0"); - - // Test that zero equals parsed zero - const parsedZero = Float.parse("0")?.value!; - expect(zero.eq(parsedZero)?.value!).toBe(true); - - // Test that zero equals bigint zero - const bigintZero = Float.fromBigint(0n); - expect(zero.eq(bigintZero)?.value!).toBe(true); - }); - - it("should test float constants", () => { - // Test that all constant methods return valid floats - const maxPosResult = Float.maxPositiveValue(); - const minPosResult = Float.minPositiveValue(); - const maxNegResult = Float.maxNegativeValue(); - const minNegResult = Float.minNegativeValue(); - - // Verify no errors occurred - expect(maxPosResult.error).toBeUndefined(); - expect(minPosResult.error).toBeUndefined(); - expect(maxNegResult.error).toBeUndefined(); - expect(minNegResult.error).toBeUndefined(); - - const maxPos = maxPosResult.value!; - const minPos = minPosResult.value!; - const maxNeg = maxNegResult.value!; - const minNeg = minNegResult.value!; - - const zero = Float.fromBigint(0n); - const one = Float.parse("1")?.value!; - const negOne = Float.parse("-1")?.value!; - - // Test mathematical properties without exposing binary representation - - // All constants should be distinct - expect(maxPos.eq(minPos)?.value!).toBe(false); - expect(maxNeg.eq(minNeg)?.value!).toBe(false); - expect(maxPos.eq(maxNeg)?.value!).toBe(false); - expect(minPos.eq(minNeg)?.value!).toBe(false); - - // Test sign properties - expect(minPos.gt(zero)?.value!).toBe(true); // min positive > 0 - expect(maxPos.gt(zero)?.value!).toBe(true); // max positive > 0 - expect(maxNeg.lt(zero)?.value!).toBe(true); // max negative < 0 - expect(minNeg.lt(zero)?.value!).toBe(true); // min negative < 0 - - // Test ordering relationships - expect(minPos.lt(maxPos)?.value!).toBe(true); // min positive < max positive - expect(minNeg.lt(maxNeg)?.value!).toBe(true); // min negative < max negative - - // Test boundary properties - expect(maxPos.gt(one)?.value!).toBe(true); // max positive > 1 - expect(minPos.lt(one)?.value!).toBe(true); // min positive < 1 - expect(maxNeg.gt(negOne)?.value!).toBe(true); // max negative > -1 - expect(minNeg.lt(negOne)?.value!).toBe(true); // min negative < -1 - }); - - it("should test format default scientific notation constants", () => { - const minResult = Float.formatDefaultScientificMin(); - const maxResult = Float.formatDefaultScientificMax(); - - expect(minResult.error).toBeUndefined(); - expect(maxResult.error).toBeUndefined(); - - const min = minResult.value!; - const max = maxResult.value!; - - // Verify the values - expect(min.format()?.value!).toBe("0.0001"); // 1e-4 - expect(max.format()?.value!).toBe("1000000000"); // 1e9 - }); - - it("should test default formatting behavior", () => { - // Values within default range (1e-4 to 1e9) should use decimal notation - const small = Float.parse("0.0001")?.value!; - expect(small.format()?.value!).toBe("0.0001"); - - const normal = Float.parse("123.456")?.value!; - expect(normal.format()?.value!).toBe("123.456"); - - const large = Float.parse("1000000000")?.value!; - expect(large.format()?.value!).toBe("1000000000"); - - // Values outside default range should use scientific notation - const tooSmall = Float.parse("0.00001")?.value!; - expect(tooSmall.format()?.value!).toBe("1e-5"); - - const tooLarge = Float.parse("10000000000")?.value!; - expect(tooLarge.format()?.value!).toBe("1e10"); - }); - - it("should test formatWithScientific boolean control", () => { - const float = Float.parse("123.456")?.value!; - - // Explicit decimal notation - const decimal = float.formatWithScientific(false); - expect(decimal.error).toBeUndefined(); - expect(decimal.value!).toBe("123.456"); - - // Explicit scientific notation - const scientific = float.formatWithScientific(true); - expect(scientific.error).toBeUndefined(); - expect(scientific.value!).toBe("1.23456e2"); - - // Test with very small number - const small = Float.parse("0.00001")?.value!; - const smallDecimal = small.formatWithScientific(false); - expect(smallDecimal.value!).toBe("0.00001"); - - const smallScientific = small.formatWithScientific(true); - expect(smallScientific.value!).toBe("1e-5"); - }); - - it("should test formatWithRange custom ranges", () => { - const float = Float.parse("0.5")?.value!; - const min = Float.parse("1")?.value!; - const max = Float.parse("100")?.value!; - - // 0.5 is smaller than min (1), so should use scientific notation - const result = float.formatWithRange(min, max); - expect(result.error).toBeUndefined(); - expect(result.value!).toBe("5e-1"); - - // Value within custom range - const inRange = Float.parse("50")?.value!; - const inRangeResult = inRange.formatWithRange(min, max); - expect(inRangeResult.value!).toBe("50"); - - // Value outside custom range (too large) - const outOfRange = Float.parse("1000")?.value!; - const outOfRangeResult = outOfRange.formatWithRange(min, max); - expect(outOfRangeResult.value!).toBe("1e3"); - }); - - it("should test formatting round-trip with new methods", () => { - const original = Float.parse("0.0001")?.value!; - - // Format and parse back - const formatted = original.format()?.value!; - const parsed = Float.parse(formatted)?.value!; - - expect(original.eq(parsed)?.value!).toBe(true); - - // Test with scientific notation - const scientific = original.formatWithScientific(true)?.value!; - const parsedSci = Float.parse(scientific)?.value!; - - expect(original.eq(parsedSci)?.value!).toBe(true); - }); - } -}); diff --git a/test_js/tsconfig.json b/test_js/tsconfig.json deleted file mode 100644 index 3693cb18..00000000 --- a/test_js/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "include": ["./**/*.ts"], - "exclude": ["node_modules"], - "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022"], - "esModuleInterop": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "noUnusedLocals": true, - "strict": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "skipLibCheck": true, - "allowJs": true, - "outDir": "./dist", - "module": "ES2022" - } -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index c795c8c0..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ES2022", - "moduleResolution": "node", - "lib": ["ES2022"], - "declaration": true, - "outDir": "./dist", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true - }, - "include": ["./dist/**/*.d.ts"], - "exclude": ["node_modules", "test_js"] -}