contracts icon indicating copy to clipboard operation
contracts copied to clipboard

buy operations would revert due to incorrect fee handling

Open MehdiKarimi81 opened this issue 8 months ago • 1 comments

The _processProtocolFeeViaTransfer function attempts to transfer collateralProtocolFeeAmount to the collateralTreasury. However, since _handleCollateralTokensBeforeBuy transfers all the funds to the project treasury, no collateral remains in the funding manager, causing _buyOrder to revert.

https://github.com/InverterNetwork/contracts/blob/33c7565ad7bf01ab1aea9cf5b9ebe916fe4d6f23/src/modules/fundingManager/bondingCurve/abstracts/BondingCurveBase_v1.sol#L258-L297 https://github.com/InverterNetwork/contracts/blob/33c7565ad7bf01ab1aea9cf5b9ebe916fe4d6f23/src/modules/fundingManager/oracle/FM_PC_Oracle_Redeeming_v1.sol#L1049-L1057

MehdiKarimi81 avatar May 19 '25 17:05 MehdiKarimi81

Great find @MehdiKarimi81, valid find and oversight on our side. Thank you, it has been added to our internal issue tracking system

Zitzak avatar May 20 '25 14:05 Zitzak