Anyone can frontrun LiquidationPoolManager.distributeFees()
and steal profit from the other users which have positions.
The LiquidationPoolManager.distributeFees()
function gives approval to the ``LiquidationPool to access all EUROs tokens in the contract. It then executes LiquidationPool.distributeFees
and subsequently transfers the remaining EUROs to the protocol's treasury account. The process involves LiquidationPool.distributeFees
transferring EUROs from LiquidationPoolManager
. It then iterates through all holders, dividing the EUROs proportionally based on each holder's position in TST, using the formula: (EURO amount * holder's TST position) / tstTotal
. Similarly, EUROs are allocated to pendingStakes
using a related formula. However, the function does not account for the duration for which these pending stakes have existed. This oversight potentially allows anyone to exploit the system by front-running the LiquidationPoolManager.distributeFees()
function. They could receive a portion of the EUROs and then use decreasePosition
to withdraw their deposited TST amount plus the received EUROs.
Please follow the @audit
tags for an explanation of the attack
Loss of funds for the all other users which have already consolidated stakes.
Manual Review
When distributeFees
split the reward only among already consolidated stakes which are created as positions
.
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.