Description
Core arithmetic paths — split calculation, fee deduction, overflow guards — are only covered by hand-written unit tests. A dedicated fuzz test suite using cargo-fuzz should exercise these paths with randomised inputs to surface edge cases that unit tests miss.
Technical Context
Add fuzz targets in the fuzz/fuzz_targets/ directory: fuzz_split_calc.rs, fuzz_fee_deduct.rs, fuzz_ratio_validation.rs. Use libfuzzer_sys::fuzz_target! and import the calculation functions from contracts/split/src/lib.rs (extracted into a calc.rs module for testability). Update fuzz/Cargo.toml to list the new targets.
Acceptance Criteria
Description
Core arithmetic paths — split calculation, fee deduction, overflow guards — are only covered by hand-written unit tests. A dedicated fuzz test suite using
cargo-fuzzshould exercise these paths with randomised inputs to surface edge cases that unit tests miss.Technical Context
Add fuzz targets in the
fuzz/fuzz_targets/directory:fuzz_split_calc.rs,fuzz_fee_deduct.rs,fuzz_ratio_validation.rs. Uselibfuzzer_sys::fuzz_target!and import the calculation functions fromcontracts/split/src/lib.rs(extracted into acalc.rsmodule for testability). Updatefuzz/Cargo.tomlto list the new targets.Acceptance Criteria
cargo fuzz build0,i128::MAX,i128::MIN) are committed tofuzz/corpus/fuzz/Cargo.tomllists all three targets under[[bin]]