code-423n4 / 2023-08-pooltogether-mitigation-findings

0 stars 0 forks source link

H-03 MitigationConfirmed #29

Open code423n4 opened 1 year ago

code423n4 commented 1 year ago

Lines of code

Vulnerability details

Issue mitigated

About the problem

Before current update, Vault had exchange rate that was stored as separate variable. Vault.liquidate function has _amountOut param, which was used such as exchange rate is always 1. The same value was used as asset amount and as shares amount without any conversion. Because of that liquidate function worked not as expected.

Solution

Now, Vault doesn't have any exchange rate in case if it's collateralized. Vault.liquidate function can be called only when vault is collateralized, which means that in such case exchange rate is 1:1. Because of that, it's now correct to use _amountOut function same for assets and for shares. As result, issue has gone.

c4-judge commented 1 year ago

Picodes marked the issue as satisfactory