The Treasury
contract sums token values directly without normalization, leading to severe inaccuracies. For example:
Depositing 1 USDC (1e6) and 1 WETH (1e18) would result in _totalValue = 1000000000001000000
The actual value should be around $3001 ( assuming 1 WETH = $3000)
The Treasury
contract tracks token balances in _balances
and sums them up in _totalValue
:
The Treasury::getTotalValue()
function returns _totalValue
directly:
Severely inaccurate total value reporting (e.g., 1 WETH deposit would be counted the same as 1 USDC)
Potential mismanagement of protocol funds due to incorrect value tracking
Manual review
Integrate a price oracle (e.g., Chainlink) to get USD values
Normalize all values to a standard decimal (e.g., 18)
Track individual token balances separately (already done) and calculate total value on-demand
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.