Different tokens have different decimals like(USDT = 6 decimals , DAI = 18 decimals). If accepted tokens have 18 decimals it will always leads to costInEuro
value to be ZERO
.
Let's look into the how costInEuros
is determined in distributeAssets()
function.
In the above code we can observe the calculation made to determine the costInEuros
subtracting the asset token decimals with 18
typecast it to 18 decimals and used to further operation.
Take a scenario
If asset tokens have 18 decimals (DAI.) then it leads to zero costInEuros
variable.
If asset tokens have lesser than 18 decimals(USDT = 6 , ) then it leads different output than expected
If asset tokens have more than 18 decimals (YAMv2 = 24) then it leads to underflow errors.
Subtraction of 18 with assets.token decimals leads to various issue while calculating the costInEuros
.
Manual View
Instead of subtraction we can directly utilize the asset.token.dec
to calculation.
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.