The deposit
function fails to properly normalize token amounts with different decimal places when updating _totalValue
. This oversight causes inaccurate aggregation of deposits since tokens like USDC (6 decimals) and ETH (18 decimals) are treated equivalently, leading to significant accounting errors.
_totalValue
accumulates raw token amounts without decimal normalization
Example scenario:
1 USDC deposit (1,000,000 units) and 1 ETH deposit (1,000,000,000,000,000,000 units) are treated as equivalent values
Results in severely distorted total value calculations
Consequences include:
Inaccurate financial calculations based on _totalValue
Misrepresented treasury holdings
Inaccurate treasury value accounting
Potential errors in allocation and withdrawal calculations
Compromised reliability of any protocol mechanisms depending on _totalValue
Manual code review
Implement decimal normalization before adding to _totalValue
Utilize IERC20(token).decimals()
or maintain a decimal mapping
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.