Hunt prep
Before you test Flat Money
What 16 disclosed reports say about Flat Money: 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 | 12 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 0 | – | – | $0 |
| Race condition lesson | 1 | 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.
-
Long traders unable to withdraw their assets
The loss of LP and the gain of the trader should be aligned by capping the trader's profit at the stable collateral total, and the protocol team fixed this issue in a pull request.
Disclosed
-
Trade fees can be avoided in limit orders
The trade fee should be calculated at the execution time of the limit order, using the current position size, and optionally a maximum trade fee parameter can be added at announcement.
Disclosed
-
Incorrect price used when updating the global position data
The protocol team fixed this issue by using the current price instead of the position's last price when updating global position data.
Disclosed
-
A malicious user can bypass limit order trading fees via cross-function re-entrancy
The issue was fixed by moving the NFT minting to after all state changes in executeOpen, or by adding a check that the position size is not zero in announceLimitOrder.
Disclosed
-
Incorrect handling of PnL during liquidation
The profitLossTotal should be excluded from the updateGlobalPositionData function during liquidation, possibly by creating a separate function for liquidation that does not include PnL adjustments.
Disclosed
-
Asymmetry in profit and loss (PnL) calculations
The protocol team fixed this issue in PR/commit https://github.com/dhedge/flatcoin-v1/pull/266.
Disclosed
-
Malicious keepers can manipulate the price when executing an order
The protocol team fixed this issue in a pull request; the recommendation is to ensure keepers must update the Pyth price and to check that priceUpdateData is not empty and matches the collateral's price ID.
Disclosed
-
Long trader's deposited margin can be wiped out
The issue was fixed by the protocol team in a pull request.
Disclosed
-
Losses of some long traders can eat into the margins of others
The protocol team fixed this issue in a pull request, and the lead senior Watson signed off on the fix.
Disclosed
-
Vault Inflation Attack
Mint a minimum number of shares to the zero address during contract deployment to ensure a minimum supply, similar to Uniswap V2.
Disclosed
-
The transfer lock for leveraged position orders can be bypassed
It is recommended to prevent announcing order either through DelayedOrder.announceLeverageClose or LimitOrder.announceLimitOrder if the leveraged position is already locked.
Disclosed
-
In LeverageModule.executeOpen/executeAdjust, vault.checkSkewMax should be called after updating the global position data
The issue was fixed by changing the order so that checkSkewMax is called after updateGlobalPositionData, and collateral is no longer settled in that function.
Disclosed
-
Oracle can return different prices in same transaction
The protocol team fixed this issue by limiting oracle updates to once per block timestamp.
Disclosed