The deposit and withdraw functions incorrectly aggregate the total value of tokens (_totalValue) without considering token decimals or exchange rates. This could lead to inaccurate financial tracking and misrepresentation of the contract’s actual holdings.
The contract tracks _totalValue by summing deposited token amounts directly:
Ignoring Token Decimals: Different ERC-20 tokens have different decimal places (e.g., USDC has 6 decimals while WETH has 18). Summing raw values without standardization results in misleading total value calculations.
Lack of Exchange Rate Consideration: Tokens have varying values in the market. Treating them as equivalent in _totalValue misrepresents the actual asset value.
3, Inaccurate Reporting: The getTotalValue function may provide misleading information, potentially affecting financial decision-making or automated strategies relying on this metric.
Incorrect _totalValue tracking can lead to financial discrepancies and misinformed decision-making.
Manual review
Implement a system to convert token amounts into a common unit of measure (e.g., using Chainlink price feeds for conversion
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.