totalAssetsMinusVaultDebt
(Vault’s credit capacity) is inaccurate due to incorrect decimal scaling during offset addition.
decimalOffset
is computed as Constants.SYSTEM_DECIMALS - vault.collateral.decimals
(e.g., 12 for a 6-decimal token like USDC).
10 ** decimalOffset
(e.g., 10^12) is added to totalAssetsX18
, treating it as an absolute value without scaling to the system's 18 decimals.
This Introduces a skew in the Vault’s net credit capacity calculation.
Also it Converts a token’s 1-unit offset (intended to avoid division by zero) into an exponentially larger value, corrupting asset/share conversion rates (getIndexTokenSwapRate
, getVaultAssetSwapRate
).
Example:
For a 6-decimal token (e.g., USDC):
decimalOffset
= 18 - 6 = 12.
10^12
in token decimals ↔ 0.000001 USDC.
But adding 10^12
as-is in the system (18-decimal) scale treats it as 1e12 * 1e18, leading to an unintended 1e30 units inflation.
Incorrectly inflates/deflates the Vault's credit capacity. Users receive improper asset amounts during deposits/withdrawals.
Manual Review
Adjust the offset to be added in the token’s decimal scale before converting to the system’s 18 decimals
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.