In the "LiquidationPool" contract, users stake their EUROs and/or TST tokens, and receive a fees every time a "distributeFees" function is called. This happens by increasing the user's position by a certain amount of EUROs, which is calculated in the function depending on the value of the variables _amount, tstTotal and positions[_holder].TST:
The value of the first is controlled by the protocol, the value of the second will never be 0 if there are TST holders. However, the value of the third depends on whether the holder's position has a TST. That is, if the user did not staked TST, then he will not receive any profit from the function, because his positions[_holder].TST will be = 0, as it is not possible to multiply/divide by 0 and the value of positions[_holder].EUROs will not change.
It also refers to pending stakes.
This test shows that if the user did not stake TST, but only EUROs, then he will not receive fees. Add this test to liquidationPool.js:
Holder will not receive a fees, if he has not staked TST.
Manual review, hardhat test.
If the project owners believe that both tokens are equivalent for staking, then it is recommended to duplicate the position growth mechanism for TST. In this case, the holder's position will grow, even if one of the tokens is missing. Also needed to calculate variables like "eurosTotal":
Otherwise, it is recommended to calculate the fees amount based on some constant value if the user should be able to use only EUROs.
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.