RToken contract's mint function can fail silently when scaling calculations result in zero amounts. This breaks accounting invariants and could lead to lost deposits. The precision loss occurs at the ray division boundary.
When
amountToMintis smaller than index, therayDivoperation can result in zero due to division rounding. The contract correctly reverts in this case, but this creates a minimum deposit threshold that isn't clearly documented.
This precision loss means small deposits below the index value cannot be processed. For example, if the index is 1e27 (RAY), then deposits smaller than that will fail. This could affect users trying to make small deposits, especially as the index grows over time with accrued interest.
The core of RAAC's lending system relies on precise token scaling for accurate representation of user positions. Observe how the RToken.sol contract handles deposit scaling through ray math, this is crucial for maintaining the relationship between user deposits and their corresponding shares in the lending pool.
The issue emerges in the mint() function's scaling calculation
When a user deposits an amount smaller than the current liquidity index, the rayDiv operation silently rounds to zero. This means that while the contract correctly reverts on zero amounts, it creates an invisible minimum deposit threshold that scales with the index.
Think of it like trying to measure millimeters with a ruler that only shows centimeters, you lose the ability to track small movements. In the context of RAAC's lending pool, this precision loss could affect users trying to make small deposits, especially as the index grows over time with accumulated interest.
The impact becomes clear when we consider RAAC's role in real estate tokenization. The protocol aims to bring real estate on-chain with seamless accessibility, but this precision limitation creates friction for smaller position adjustments.
When we observe how the RToken.sol contract handles deposit scaling through ray math, is crucial for maintaining the relationship between user deposits and their corresponding shares in the lending pool.
We need to either:
Make the minimum deposit threshold explicit and tied to the current index
Implement scaled precision handling for small amounts
This maintains RAAC's core mission of capital efficiency while providing clear boundaries for valid operations.
Needs to address the core scaling issue while maintaining the existing state management flow. A more precise solution would be
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.