A commission_fee
is charged when depositing assets to CollateralTracker
via deposit()
#416
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2024-04-panoptic/blob/main/contracts/CollateralTracker.sol#L399-L408
https://github.com/code-423n4/2024-04-panoptic/blob/main/contracts/CollateralTracker.sol#L1096-L1126
Vulnerability details
Impact
Each time user go for collateral deposit he subject to pay a
COMMISSION_FEE
. Its get more difficult for user when he try to save himself from liquidation and add collateral, some of its fund moved as acommision fee
Proof of Concept
Here Deposit function as follows
which calls
previewDeposit()
which is implemented as followsBut point is if you goes to
Developer code comment
onCOMMISSION_FEE
which says followingAnd docmentation also clear that
COMMISSION_FEE
only applied when new option created(minted), not when asset deposited. below are linkshttps://panoptic.xyz/docs/panoptic-protocol/specs#commission-fee
https://panoptic.xyz/docs/panoptic-protocol/commission
This also implemented in
_getExchangedAmount()
which returnsexchangedAmount The amount of funds to be exchanged for minting an option (includes commission, swapFee, and intrinsic value).
So problem here is that
protocol
chargingfee
on each deposit, although there is no mention of it.Tools Used
Manual Review
Recommended Mitigation Steps
As per code comments & Documentation, Panoptic should only charge
COMMISSION_FEE
when new position minted not in every collateral deposit.Assessed type
Other
The text was updated successfully, but these errors were encountered: