Hunt prep
Before you test prePO contest
What 21 disclosed reports say about prePO 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 | 14 | 0 | – | – | $0 |
| Access control lesson | 3 | 0 | – | – | $0 |
| Smart contracts lesson | 3 | 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.
-
Users do not receive owed tokens if TokenSender contract cannot cover their owed amount.
The TokenSender contract should track users whose balance wasn’t covered in a mapping and provide a function for them to manually claim tokens later if the contract is topped up.
Disclosed
-
PrePOMarket.setFinalLongPayout() shouldn’t be called twice.
The function should be changed so it cannot finalise the payout a second time, for example by requiring that the payout is still above the maximum before setting it.
Disclosed
-
Bypass userWithdrawLimitPerPeriod check
The report recommends allowing a user to transfer only the unused portion of their limit, so the used amount follows the balance.
Disclosed
-
A whale user is able to cause freeze of funds of other users by bypassing withdraw limit
The withdraw limit checks should also be applied in the period-reset branches so that the first request cannot exceed the limit.
Disclosed
-
The recipient receives free collateral token if an ERC20 token that deducts a fee on transfer used as baseToken
The contract should measure the actual amount received by comparing the balance before and after the transfer, and use that actual amount for further calculations and external calls.
Disclosed
-
PrePO NFT holders will not be able to redeem collateral
The redeem hook should be updated to allow NFT holders to redeem, for example by adding a check for NFT ownership or by removing the account list restriction when redemptions are allowed.
Disclosed
-
Frontrunning for unallowed minting of Short and Long tokens
The mint hook should be set during deployment in the PrePOMarketFactory, or a default mint hook that always reverts should be used until changed.
Disclosed
-
griefing / blocking / delaying users to withdraw
The contract should track the last reset time per user, for example with a mapping from address to timestamp, so that each user's limit resets independently.
Disclosed
-
Manager can get around min reserves check, draining all funds from Collateral.sol
The reserve check should also be applied in the withdraw function, not only in managerWithdraw.
Disclosed
-
SafeAccessControlEnumerableCaller and SafeOwnableCaller contracts lack access control
The write methods were removed from both caller contracts so inheriting contracts must implement and protect every write method themselves; it was fixed in PR 352.
Disclosed
-
Token transfers do not verify that the tokens were successfully transferred
The contracts should use SafeERC20's safeTransfer and safeTransferFrom, which check the return value and revert on failure.
Disclosed
-
No storage gap for upgradeable contracts
The issue was fixed by adding a storage gap array to the upgradeable abstract contracts.
Disclosed
-
TokenShop: purchase function should add _purchasePrices parameter
The purchase function was fixed by adding a purchasePrices parameter and checking it against the stored price.
Disclosed
-
First depositor can break minting of shares
The fix should include sending the first minimum liquidity shares to the zero address when total supply is zero, requiring that minted shares are non-zero, and optionally using a periphery contract to atomically initialize and deposit.
Disclosed
-
Withdrawal delay can be circumvented
The contract should disable transfers for an account that has an active withdrawal request until the withdrawal window has passed.
Disclosed