The calculateDustAmount
function exhibits inconsistent scaling methodology when comparing contract balances - using rayDiv
for downscaling contract balance while applying rayMul
for upscaling total real balance. This scaling inconsistency could result in inaccurate dust calculations.
Contract Balance Calculation:
The balance is scaled down using normalized income.
Total Real Balance Calculation:
The total supply is scaled up using the same factor.
Issue:
Opposing scaling directions create a mismatch between the compared values, potentially distorting the dust amount calculation.
Dust Calculation Errors: May produce inaccurate surplus token calculations
Financial Reporting Issues: Could affect token donation and rebalancing decisions
Transparency Concerns: Misrepresented surplus balances may impact stakeholder confidence
Manual code review
Standardize Scaling Operations:
Implement consistent scaling methodology for both balance calculations to ensure accurate comparisons
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.