Hunt prep
Before you test Mochi contest
What 28 disclosed reports say about Mochi 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 | 19 | 0 | – | – | $0 |
| Smart contracts lesson | 4 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Access control lesson | 1 | 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.
-
Anyone can extend withdraw wait period by depositing zero collateral
The deposit function should require that the amount is greater than zero, and it may also be worthwhile to restrict deposits to the position owner.
Disclosed
-
treasury is vulnerable to sandwich attack
The function should be restricted to the owner by adding an onlyOwner modifier.
Disclosed
-
Changing NFT contract in the MochiEngine would break the protocol
The function should be removed.
Disclosed
-
Tokens Can Be Stolen By Frontrunning VestedRewardPool.vest() and VestedRewardPool.lock()
Users should not interact directly with these functions; instead, a single externally facing function should call safeTransferFrom(), vest(), and lock() in one transaction.
Disclosed
-
liquidation factor < collateral factor for Sigma type
The max collateral factor for Sigma should be set higher than its liquidation factor to maintain a safety buffer.
Disclosed
-
A malicious user can potentially escape liquidation by creating a dust amount position and trigger the liquidation by themself
The recommendation is to make liquidated positions unable to be used again for depositing and borrowing.
Disclosed
-
Unchecked ERC20 transfer calls
Use the library's cheapTransfer and cheapTransferFrom functions, which check the return value, instead of transfer and transferFrom.
Disclosed
-
Chainlink’s latestRoundData might return stale or incorrect results
Add checks to ensure the returned price is positive, the round is complete, and the price is not stale.
Disclosed
-
Changing engine.nft contract breaks vaults
The NFT address should not be changeable, or the new NFT's IDs should start after the old NFT's IDs to avoid collisions.
Disclosed
-
griefing attack to block withdraws
The deposit function should be updated to allow only the NFT owner to deposit, as confirmed by the project.
Disclosed
-
Improper Validation Of create2 Return Value
The check should be changed from testing the address against zero to testing whether the address has deployed bytecode, and this fix needs to be applied in Mochi's contracts.
Disclosed
-
MochiTreasuryV0.sol Is Unusable In Its Current State
The contract should be updated to use an escrow service that allows contracts as msg.sender, or replace the escrow functionality with an internal contract holding usdm tokens.
Disclosed
-
Liquidation will never work with non-zero discounts
The fix should set the position's debt to zero instead of subtracting the passed-in amount, or remove the discount logic entirely if only the no-discount profile is used.
Disclosed
-
UniswapV2/SushiwapLPAdapter update the wrong token
The function should be fixed by calling `router.update(underlying, _proof)` instead of using the LP token address.
Disclosed
-
Debt accrual is path-dependant and inaccurate
The total debt should be reduced by the discount of all users (or the weighted average discount) instead of only the caller's discount.
Disclosed