Hunt prep
Before you test Elfi
What 57 disclosed reports say about Elfi: 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 | 50 | 0 | – | – | $0 |
| DoS lesson | 4 | 0 | – | – | $0 |
| Access control lesson | 2 | 0 | – | – | $0 |
| Misconfiguration 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.
-
Future upgrades may be difficult or impossible
The report recommends avoiding direct nesting of structs and instead using mappings with constant keys to allow safe extension of inner structures in future upgrades.
Disclosed
-
The USer will receive less amount than user expected
The slippage check should be performed after deducting the fee.
Disclosed
-
Closing partial positions miscounts the settled fees
The fix was to not divide the settled fees again when calculating the settled margin, as they are already divided by the decrease amount.
Disclosed
-
Position net value is using outdated fees
The protocol should calculate the latest per-token values using the functions that give the actual current values.
Disclosed
-
Long orders always pays lesser in fees while short orders always pays higher due to oracle pricing
The protocol team fixed this issue by using consistent pricing for both long and short positions.
Disclosed
-
Increasing leverage can make the position have "0" `initialMargin`
The protocol team fixed this issue in a pull request.
Disclosed
-
Pool value calculation skips accounting for stable token losses and short uPnL
The protocol team fixed this issue in a pull request.
Disclosed
-
If the stake token is minted from portfolio vault, positions from balances are not decreased
The mint-from-balance flow should loop over the user's positions and update their from-balances, just as the withdraw function does; the protocol team fixed this issue in a pull request.
Disclosed
-
Incorrect settleFee process for cross-margin account
The protocol team fixed this issue by not processing the settle fee twice.
Disclosed
-
If stable tokens depeg, short funding fees will not be accounted properly
The protocol should use the average token price over the accrual period for stable tokens, or acknowledge the risk as intended design.
Disclosed
-
Submitting mint request using user's trading balance and cancelling it will not refund tokens back to trading account
The protocol team fixed this issue in a pull request.
Disclosed
-
LpPool's can become insolvent if shorters are in huge profits
The issue was fixed by adding unrealised losses and profits to the available liquidity calculation, and possibly by liquidating short positions with large profits.
Disclosed
-
Traders may decrease the loss via decrease the position's margin
The protocol team fixed this issue by considering unrealised profit and loss when reducing a position's margin.
Disclosed
-
Lack of oracle setting in autoReducePositions
The protocol team fixed this issue by adding oracle price setting and clearing in autoReducePositions.
Disclosed
-
Improper implementation of the `PositionMarginProcess.updatePositionFromBalanceMargin()` function
The function should be based on the current price of the margin token, and the protocol team fixed this issue in a pull request.
Disclosed