The _totalValue
variable in the Treasury
contract does not take into account the decimals and value of the tokens. This can lead to incorrect calculations.
Considering that different tokens have different values and different numbers of decimal places, i.e. the value of 1 USD in tokens such as USDC, DAI and WETH will not be the same:
$1 = 1e6 USDC
$1 = 1e18 DAI
$1 = 373e12 WETH
It will lead to situations where the _totalValue
variable will not represent the actual value of the tokens in the contract.
/contracts/core/collectors/Treasury.sol
Since actual value of deposited tokens is not checked, the _totalValue
variable can be manipulated by depositing tokens with different or no value.
Any calculations based on the _totalValue
variable will be incorrect.
Total value calculation need an oracle to be introduced to get the value of the token. This will allow the contract to calculate the total value of the tokens correctly.
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.