hats-finance / Common--Stableswap-0xd4d9a2772202ce33b24901d3fc94e95a84b37430

Apache License 2.0
0 stars 0 forks source link

`lib.remove_liquidity_by_shares` forgets to charge protocol fee #14

Open hats-bug-reporter[bot] opened 2 months ago

hats-bug-reporter[bot] commented 2 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0xd8502d6f7e803ebbdec93d9e2d376f2ffde15f4503b9bea4e069bc253b5611e2 Severity: medium

Description: Description\ In lib.remove_liquidity_by_amounts, the function calcuates the amount of fee in lib.rs#L721-L728, and mint protocol fee in lib.rs#L739-L745.

But for lib.remove_liquidity_by_shares, the function doesn't calucate and mint protocol fee

Attack Scenario\

JanKuczma commented 2 months ago

Thank you for your submission.

remove_liquidity_by_shares removes liquidity in balanced amounts, thus there's no need to account fee.