Lucene search

K
code423n4Code4renaCODE423N4:2021-09-SUSHITRIDENT-FINDINGS-ISSUES-171
HistorySep 29, 2021 - 12:00 a.m.

HybridPool's flashSwap gives the total fee to barFeeTo

2021-09-2900:00:00
Code4rena
github.com
6

Handle

0xsanson

Vulnerability details

Impact

In HybridPoolโ€™s flashSwap function thereโ€™s a transfer to barFeeTo

_transfer(tokenIn, fee, barFeeTo, false);

Here fee = (amountIn * swapFee) / MAX_FEE is the total swap fee. However it should transfer out only a fraction of it (barFee/MAX_FEE) otherwise liquidity providers wouldnโ€™t get any reward.

Recommended Mitigation Steps

Calculate the appropriate fee to send to the barFeeTo.


The text was updated successfully, but these errors were encountered:

All reactions