In the claimThrone()
function, the platform fee is calculated using integer-based division with a percentage denominator:
When the result of (sentAmount * platformFeePercentage)
is not exactly divisible by 100, the remainder is silently discarded, leading to small but systematic rounding errors over time. This could slightly under-allocate platform fees or misrepresent the value added to the pot.
Likelihood: High
It becomes more noticeable at lower transaction values, where small wei amounts represent a larger proportion of the total fee
This will occur on every invocation of claimThrone()
where sentAmount * platformFeePercentage
is not divisible by 100
Impact:
The platform will under-collect fees over time
Accumulated over many players, this could lead to significant financial drift between expected vs actual fee distributions
The pot may receive more than intended, potential affecting the game's economic balance
msg.value = 101 wei
platformFeePercentage = 3
currentPlatformFee = (101 * 3) / 100
A 0.03 wei rounding error occurs and is discarded.
This may seem small, but:
If over 1 million plays: 0.03 * 1,000,000 = 30,000 wei (~0.00003 ETH)
Larger sentAmount
values (e.g. gwei/ether) can amplify this depending on the rate of growth
Increase precision to 10,000 or 1,000,000:
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.