# Precision loss in Transmuter::claimRedemption() may result in an arithmetic overflow and failed redemption

Rounding in AlchemistV3::convertYieldTokensToDebt makes debtValue 1 wei below amountTransmuted, so claimRedemption computes amountToRedeem=1 and AlchemistV3::redeem underflows, blocking redemption.

- Payout: Contest reward
- Severity: medium
- Program: Alchemix
- Credited: joicygiore
- Disclosed: 2025-07-15
- Write-up quality: 6/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_alchemix_may2025.pdf#3.2.1
- Library page: https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.1
- Tags: domain:web3 impact:dos kind:contest platform:cantina sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:dos vuln:precision-loss

**Target:** Transmuter/AlchemistV3 redemption flow (Solidity contracts)
**Root cause:** convertYieldTokensToDebt rounds down, so debtValue can be 1 wei less than amountTransmuted; the ternary then yields amountToRedeem=1 instead of 0, and AlchemistV3::redeem subtracts more than _totalLocked, underflowing.
**Steps:**
1. Deploy Alchemist/Transmuter with fakeYieldToken; whale mints supply.
2. yetAnotherExternalUser deposits 200_000e18; 0xbeef deposits 200_000e18 and mints max debt via alchemist.mint.
3. anotherExternalUser calls transmuterLogic.createRedemption(mintAmount) with alToken approval.
4. vm.roll forward 5_256_000 blocks; bump yield token supply by 5.9% via updateMockTokenSupply.
5. externalUser liquidates 0xbeef's position.
6. anotherExternalUser calls transmuterLogic.claimRedemption(1) -> reverts Panic(0x11); logs show amountTransmuted=...180000, debtValue=...179999, amountToRedeem=1.
**How found:** Reviewer read claimRedemption's amountToRedeem ternary and traced convertYieldTokensToDebt's rounding, hypothesizing a 1-wei discrepancy between amountTransmuted and debtValue; confirmed with a Foundry PoC logging the values.
**Exploitation:** Not economically weaponized; griefing/DoS: a redemption of a position whose transmuted amount exceeds debtValue by 1 wei triggers redeem(1) which underflows _totalLocked and reverts, blocking the claim.
**Insight:** When a contract compares a stored amount against a freshly converted value and only redeems the positive difference, a 1-wei rounding gap flips a no-op into a nonzero call; check downstream subtraction invariants (old - totalOut) against that 1-wei path.
