The distributeFees
function in the LiquidationPool
contract may result in tokens becoming stuck in the contract due to precision loss. If the calculated amount of EUROs
to be distributed is less than the total tstTotal
, users may not receive the correct proportion of tokens, resulting in some tokens being trapped in the contract indefinitely.
The vulnerability arises from precision loss during the calculation of distributed EUROs
for holders and pending stakes. If the product of _amount
and a user's TST
is less than the total tstTotal
, users may not receive the correct amount of tokens, leading to some tokens being stuck in the contract.
For example, if three users each have 100 tokens and the received amount is 20 tokens, each user will receive 20 * 100 / 300 = 6 tokens. Due to precision loss, 2 tokens will be lost. This issue can escalate with higher values.
Some tokens become stuck in the contract due to users not receiving the correct proportion of tokens during distribution.
Manual review
It is recommended to implement a function to withdraw these tokens from the contract or distribute them in a way that avoids precision loss.
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.