The Treasury.sol contract does not update its _totalValue variable when receiving direct transfers from FeeCollector.sol. This results in an incorrect representation of treasury holdings, potentially leading to misinformed financial decisions and governance actions.
_totalValue Fails to Reflect Direct TransfersThe _totalValue variable in Treasury.sol is only updated when deposits occur through the deposit() function. However, funds transferred directly from FeeCollector.sol are not accounted for, creating a discrepancy between actual token balances and the reported total value.
FeeCollector.sol transfers tokens directly to Treasury.sol.
The treasury contract’s balance increases, but _totalValue remains unchanged.
Calls to getTotalValue() return a lower-than-actual treasury value, leading to inaccurate reporting.
Incorrect Treasury Valuation: On-chain data consumers receive misleading information regarding available funds.
Risk of Fund Mismanagement: Treasury allocations and withdrawals may be executed based on inaccurate balance data.
Manual Code Review
Update _totalValue Whenever Funds Are Received: Implement a mechanism to detect and account for incoming transfers outside deposit().
Possible solutions include tracking ERC20 transfers to the contract or using an event-triggered balance sync.
Modify getTotalValue() to Reflect Real-Time Balances:
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.