Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

Precision Loss in Initial Emission Rate Calculation

Summary

The constructor calculates the initial emission rate using the formula:

emissionRate = INITIAL_RATE / BLOCKS_PER_DAY;

Because Solidity uses integer division, any fractional part is truncated, potentially leading to a loss of precision in the per-block emission rate.

Vulnerability Details

The use of integer division truncates any decimals. For example, if INITIAL_RATE is 1000e18 and BLOCKS_PER_DAY is 7200, the computed emissionRate will lose the fractional remainder.

example :
Using the provided numbers:

INITIAL_RATE = 1000 * 1e18
BLOCKS_PER_DAY = 7200
The intended per-block emission rate would be approximately 138.888888888888888...e15 tokens. However, integer division will result in a truncated value (e.g., 138888888888888888), missing the fractional component. Over 7200 blocks, the cumulative error could amount to several tokens per day, which may be significant over time.

Impact

Over time, small errors in the per-block rate can compound, resulting in a total emission that is lower than intended. This may cause the protocol to distribute fewer tokens than planned, affecting reward expectations for stakeholders.

Recommendations

To mitigate precision loss, consider using a higher-precision arithmetic library or scaling factors. For example, multiply INITIAL_RATE by a precision factor before dividing and then divide out the precision factor later. Alternatively, if acceptable, document the precision loss and adjust INITIAL_RATE accordingly so that the effective emission rate meets the protocol’s requirements.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!