The Treasury::deposit
function allows users to deposit any ERC-20 token into the contract, while _totalValue
is updated to track the total deposited amount. The getTotalValue
function then returns _totalValue
. However, _totalValue
is incremented directly with raw token amounts without accounting for differences in token decimals.
Different ERC-20 tokens have varying decimal places (e.g., USDC has 6 decimals, while WETH has 18). Since _totalValue
is simply incremented by the deposited amount without standardizing decimals, its value becomes inconsistent and misleading.
The getTotalValue
function provides misleading data
Manual Review
Convert all token amounts to a standard decimal format (e.g., 18 decimals) before adding to _totalValue
.
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.