The ZENO::redeem
and ZENO::redeemAll
functions do not account for the decimal difference between the ZENO token (18 decimals) and USDC (6 decimals). This results in incorrect calculations when transferring USDC, potentially leading to significant overpayment or underpayment during redemption.
Problem description
The redeem
and redeemAll
functions transfer USDC in an amount equivalent to the burned ZENO balance.
The ZENO token uses 18 decimals, while USDC only has 6 decimals.
The functions do not scale the amount properly before transferring USDC, leading to incorrect value transfers.
Users may receive an excessive or insufficient amount of USDC compared to the intended redemption value.
Affected Code in ZENO.sol
Code Reference: https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/zeno/ZENO.sol#L62
Code Reference: https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/zeno/ZENO.sol#L73
Steps to reproduce
A user holds 1 ZENO (1e18 units) and attempts to redeem it.
The function transfers 1 USDC (1e6 units) instead of the correct scaled value (1e18 should convert to 1e6 USDC).
The user receives an unintended overpayment or underpayment.
Incorrect fund distribution: Users may receive an incorrect amount of USDC when redeeming ZENO.
Financial loss: Either the protocol or users may suffer losses due to improper scaling.
Manual Review
**Implement proper decimal scaling before transferring USDC: **Adjust the transferred amount by scaling the ZENO amount down to match USDC’s 6 decimals, ensure consistency in all redemption-related functions.
By implementing these changes, the protocol can prevent incorrect fund distributions and maintain accurate financial calculations.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.