ConstProdUtils tests migration checklist (Crane root)
This file maps legacy snippets/.../Test_ConstProdUtils_*.sol tests to the migrated per-DEX .t.sol tests under Crane's test/foundry/spec/utils/math/constProdUtils.
Legend: [x] migrated/present, [ ] missing / needs migration or parity work.
-
Test_ConstProdUtils_withdrawSwapQuote.sol
- ConstProdUtils_withdrawSwapQuote_Uniswap.t.sol
- ConstProdUtils_withdrawSwapQuote_Camelot.t.sol
-
Test_ConstProdUtils_withdrawTargetQuote.sol
- ConstProdUtils_withdrawTargetQuote_Uniswap.t.sol
- ConstProdUtils_withdrawTargetQuote_Camelot.t.sol
-
Test_ConstProdUtils_withdrawSwapTargetQuote.sol
- ConstProdUtils_withdrawSwapTargetQuote_Uniswap.t.sol
- ConstProdUtils_withdrawSwapTargetQuote_Camelot.t.sol
This compact checklist lists only the legacy snippets/indexedex/old/spec/crane/utils/math/ tests that still need migration or parity work into Crane's per‑DEX test suite (test/foundry/spec/utils/math/constProdUtils).
Legend: • not migrated / missing
Files still needing migration or parity checks:
(migrated as ConstProdUtils_quoteZapOutLP_* files)
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateVaultFee.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateFeePortionForPosition.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_saleQuote.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateFeePortionForPosition_struct.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_sortReserves.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateZapOutLP.sol
(migrated as
ConstProdUtils_quoteZapOutLP_*files) - snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_minZapInAmount.sol (migrated as
ConstProdUtils_minZapInAmount_*)
Notes on quick findings (updated):
Test_ConstProdUtils_swapDepositSaleAmt.sol— already migrated to:- test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_swapDepositSaleAmt_Uniswap.t.sol
- test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_swapDepositSaleAmt_Camelot.t.sol
Test_ConstProdUtils_calculateZapOutLP.sol— migrated underConstProdUtils_quoteZapOutLP_*(Uniswap + Camelot)Test_ConstProdUtils_swapDeposit.sol— migrated asConstProdUtils_swapDepositQuote_*andConstProdUtils_swapDepositSaleAmt_*Test_ConstProdUtils_saleQuote.sol— analogous tests exist (seeConstProdUtils_swapQuote_*and related files)
Remaining items (need migration/parity verification):
Test_ConstProdUtils_quoteZapOutAmount.sol(Uniswap & Camelot migrated)Test_ConstProdUtils_calculateYieldForOwnedLP.sol(Uniswap & Camelot migrated)Test_ConstProdUtils_calculateVaultFee.solTest_ConstProdUtils_calculateFeePortionForPosition.solTest_ConstProdUtils_calculateFeePortionForPosition_struct.solTest_ConstProdUtils_sortReserves.solTest_ConstProdUtils_calculateZapOutLPPrecise.solTest_ConstProdUtils_k.solTest_ConstProdUtils_calculateProtocolFee.sol
Partial/missing DEX counterparts to add:
- Camelot variant missing for: snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_quoteZapOutToTargetWithFee.sol (Uniswap present; add Camelot parity)
Notes:
- This file intentionally lists only the items that still require migration or verification. All other legacy tests were already migrated into per‑DEX
.t.solfiles. - For each item, create a per‑DEX
.t.soltest (Uniswap and/or Camelot as applicable) following theTestBase_ConstProdUtils_*patterns and verify with focusedforge testruns.
Recommended next commands:
# run full migrated spec locally (focused)
forge test --match-path "test/foundry/spec/utils/math/constProdUtils/**" -vvv
# run a single migrated file for quick verification (example)
forge test --match-path test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_quoteWithdrawSwapWithFee_Uniswap.t.sol -vvvUpdated: 2025-12-16
Planned next migration: Test_ConstProdUtils_quoteZapOutAmount.sol — recommended
Rationale: quoteZapOutAmount exercises ZapOut/burn-to-output math and will surface rounding and fee-mint edgecases across DEXes; migrating it next helps validate current quoteZapOut* implementations early.
-Remaining items (need migration/parity verification):
Test_ConstProdUtils_calculateYieldForOwnedLP.solTest_ConstProdUtils_purchaseQuote.solTest_ConstProdUtils_calculateVaultFee.solTest_ConstProdUtils_calculateFeePortionForPosition.solTest_ConstProdUtils_calculateFeePortionForPosition_struct.solTest_ConstProdUtils_sortReserves.solTest_ConstProdUtils_k.solConstProdUtils tests migration checklist (Crane root)
This file maps legacy snippets/.../Test_ConstProdUtils_*.sol tests to the migrated per-DEX .t.sol tests under Crane's test/foundry/spec/utils/math/constProdUtils.
Legend: [x] migrated/present, [ ] missing / needs migration or parity work.
-
Test_ConstProdUtils_withdrawSwapQuote.sol
- ConstProdUtils_withdrawSwapQuote_Uniswap.t.sol
- ConstProdUtils_withdrawSwapQuote_Camelot.t.sol
-
Test_ConstProdUtils_withdrawTargetQuote.sol
- ConstProdUtils_withdrawTargetQuote_Uniswap.t.sol
- ConstProdUtils_withdrawTargetQuote_Camelot.t.sol
-
Test_ConstProdUtils_withdrawSwapTargetQuote.sol
- ConstProdUtils_withdrawSwapTargetQuote_Uniswap.t.sol
- ConstProdUtils_withdrawSwapTargetQuote_Camelot.t.sol
This compact checklist lists only the legacy snippets/indexedex/old/spec/crane/utils/math/ tests that still need migration or parity work into Crane's per‑DEX test suite (test/foundry/spec/utils/math/constProdUtils).
Legend: • not migrated / missing
Files still needing migration or parity checks:
(migrated as ConstProdUtils_quoteZapOutLP_* files)
-- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateYieldForOwnedLP.sol -- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_purchaseQuote.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateVaultFee.sol
- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateFeePortionForPosition.sol
-- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_saleQuote.sol
-- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateFeePortionForPosition_struct.sol
-- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_sortReserves.sol
-- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_calculateZapOutLP.sol
(migrated as
ConstProdUtils_quoteZapOutLP_*files) -- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_minZapInAmount.sol (migrated asConstProdUtils_minZapInAmount_*) - snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_quoteZapOutAmount.sol -- snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_saleQuoteMin.sol
Notes on quick findings (updated):
Test_ConstProdUtils_swapDepositSaleAmt.sol— already migrated to:- test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_swapDepositSaleAmt_Uniswap.t.sol
- test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_swapDepositSaleAmt_Camelot.t.sol
Test_ConstProdUtils_calculateZapOutLP.sol— migrated underConstProdUtils_quoteZapOutLP_*(Uniswap + Camelot)Test_ConstProdUtils_swapDeposit.sol— migrated asConstProdUtils_swapDepositQuote_*andConstProdUtils_swapDepositSaleAmt_*Test_ConstProdUtils_saleQuote.sol— analogous tests exist (seeConstProdUtils_swapQuote_*and related files)
-Remaining items (need migration/parity verification):
Test_ConstProdUtils_quoteZapOutAmount.sol(verify if fully covered by existingquoteZapOut*tests)Test_ConstProdUtils_calculateYieldForOwnedLP.solTest_ConstProdUtils_calculateVaultFee.solTest_ConstProdUtils_calculateFeePortionForPosition.solTest_ConstProdUtils_calculateFeePortionForPosition_struct.solTest_ConstProdUtils_sortReserves.solTest_ConstProdUtils_calculateZapOutLPPrecise.solTest_ConstProdUtils_k.solTest_ConstProdUtils_calculateProtocolFee.sol
Partial/missing DEX counterparts to add:
- Camelot variant missing for: snippets/indexedex/old/spec/crane/utils/math/Test_ConstProdUtils_quoteZapOutToTargetWithFee.sol (Uniswap present; add Camelot parity)
Notes:
- This file intentionally lists only the items that still require migration or verification. All other legacy tests were already migrated into per‑DEX
.t.solfiles. - For each item, create a per‑DEX
.t.soltest (Uniswap and/or Camelot as applicable) following theTestBase_ConstProdUtils_*patterns and verify with focusedforge testruns.
Recommended next commands:
# run full migrated spec locally (focused)
forge test --match-path "test/foundry/spec/utils/math/constProdUtils/**" -vvv
# run a single migrated file for quick verification (example)
forge test --match-path test/foundry/spec/utils/math/constProdUtils/ConstProdUtils_quoteWithdrawSwapWithFee_Uniswap.t.sol -vvvUpdated: 2025-12-16
Planned next migration: Test_ConstProdUtils_quoteZapOutAmount.sol — recommended
Rationale: quoteZapOutAmount exercises ZapOut/burn-to-output math and will surface rounding and fee-mint edgecases across DEXes; migrating it next helps validate current quoteZapOut* implementations early.