Hunt prep
Before you test Polynomial Protocol contest
What 33 disclosed reports say about Polynomial Protocol contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 27 | 0 | – | – | $0 |
| DoS lesson | 6 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Short positions can be burned while holding collateral
The burn condition should also require that collateralAmount is zero.
Disclosed
-
Division by zero error causes KangarooVault to be DoS with funds locked inside
Fix getTokenPrice() to handle the scenario when totalSupply() is zero.
Disclosed
-
Incorrect calculation of usedFunds in LiquidityPool leads to lower than expected token price
Deduct hedgingFees from usedFunds to offset the hedgingFees added in _hedge().
Disclosed
-
Function hedgePositions is incorrect, because it missed the queuedPerpSize in the calculation
The currentPosition should be calculated as _getTotalPerpPosition() plus queuedPerpSize in the hedgePositions function.
Disclosed
-
Users can receive less collateral than expected from liquidations
The liquidation function should accept a minimum collateral amount parameter and revert if the returned collateral is less than that minimum.
Disclosed
-
LiquidityPool._getDelta and LiquidityPool._calculateMargin functions should execute require(!isInvalid && spotPrice > 0) instead of require(!isInvalid || spotPrice > 0)
The functions should be updated to use require(!isInvalid && spotPrice > 0) instead of the OR condition.
Disclosed
-
LiquidityPool can be DoS when a complete withdrawal is performed
Add validation to check and handle the case when totalSupply is zero.
Disclosed
-
Malicious users can exploit deposit and withdrawal queueing in KangarooVault and LiquidityPool contracts to force exorbitant transaction fees
The report recommends letting users process their own deposits and withdrawals without clearing the whole queue, or at least adding a way to cancel queued deposits.
Disclosed
-
Possible spamming attack in opening or closing Long or Short Positions in Exchange.openTrade
The exchange should enforce a sensible minimum short amount, at least greater than zero, when opening a short position.
Disclosed
-
First Depositors will incurr a rebalancing Loss
The reporter suggested adding a deposit or withdrawal fee to offset hedging costs, but the project disputed the issue and no fix was confirmed.
Disclosed
-
Lack of price validity check from Synthetix results in loss of funds while liquidating
The project acknowledged the omission as a miss; the recommended fix is to require that 'isInvalid' is false for both the mark price and the collateral price before liquidating.
Disclosed
-
KangarooVault._resetTrade , LiquidityPool.rebalanceMargin , and LiquidityPool._getTotalMargin functions should check isInvalid , which is returned by external perp market contract’s remainingMargin function, and revert if such isInvalid is true
The functions should check the isInvalid flag returned by remainingMargin and revert when it is true.
Disclosed
-
usedFunds can be greater than totalFunds in contract KangarooVault , which leads to KangarooVault being unable to close its trades and users being unable to withdraw
The contract should check that totalFunds is at least usedFunds when usedFunds is increased or totalFunds is decreased.
Disclosed
-
Short positions with minimum collateral can be liquidated even though canLiquidate() returns false
The check in maxLiquidatableDebt() should use >= instead of > so that positions with safetyRatio equal to 1 are considered safe.
Disclosed
-
Missing totalFunds update in LiquidityPool’s OpenShort() , causing LiquidityPool token holder to lose a portion of their token value
The openShort() function should be updated to add the net fees to totalFunds.
Disclosed