The claimRewardAsMochi function creates a fixed-size array of length two but then writes to a third index, which throws an out-of-bounds exception and reverts the transaction. As a result, referral fees can never be claimed and stay stuck in the contract.
The deposit function in MochiVault.sol allows anyone to deposit zero collateral into any position, which resets the last deposit timestamp and extends the withdrawal wait period. An attacker could repeatedly call this with zero amount to indefinitely lock all users out of withdrawing their collateral.
A permissionless function in the treasury allowed anyone to trigger a large CRV purchase, which an attacker could sandwich with a flash loan to profit at the treasury's expense. The attacker could potentially steal all funds in the treasury.
The MochiEngine contract allows the operator to change the NFT contract address, which would cause all vaults to point to a different NFT contract and break the protocol, making users unable to access their positions.
The fee pool contract has a permissionless function that distributes funds without slippage control, allowing an attacker to sandwich the distribution with a flash loan to steal the funds.
The vest() and lock() functions in VestedRewardPool.sol do not use safeTransferFrom(), allowing an attacker to frontrun a call and steal the recipient's vested tokens.
The liquidation factor for Sigma-type assets was set lower than the collateral factor, so a user could borrow up to 45% of their collateral but be immediately liquidated because the liquidation threshold was only 40%. This could cause users to lose funds right after taking a maximum loan.
A liquidated position can be reused for depositing and borrowing, but if a liquidation auction is already ongoing, triggering a new liquidation fails until the old auction is settled. An attacker can create a tiny position, trigger its liquidation, and then borrow a larger amount, hoping liquidators ignore the dust auction and thus fail to liquidate the real loan.
The DutchAuctionLiquidator contract calls ERC20 transfer without checking the return value, so a token that returns false on failure would be treated as a successful transfer. This could allow a failed transfer to be considered valid, and with USDT the transfer would always revert.
The ChainlinkAdapter contract calls Chainlink's latestRoundData() without checking whether the returned price is stale or invalid. If Chainlink fails to start a new round or reach consensus, the contract may continue using outdated or incorrect price data.
Governance can change the engine.nft address used by vaults, and when minting a new vault the returned ID can overwrite an existing debt position and set its status to Idle. This allows overwriting existing collateralized debt positions.
The vault contract sets a last-deposit timestamp on every deposit, and the wait modifier prevents withdrawals for a delay period after that timestamp. An attacker can repeatedly deposit tiny amounts to keep resetting the timestamp, thereby blocking the NFT owner from ever withdrawing their funds.
The BeaconProxyDeployer.deploy() function checks the address returned by create2 against zero, but create2 never returns zero even on failure, so a failed deployment goes undetected. An attacker could cause a failed proxy deployment to be treated as successful, potentially leaving assets without a working vault.
The withdrawLock() function in MochiTreasuryV0 can be called even when locking has been toggled off, allowing unexpected withdrawals. An attacker could potentially relock tokens maliciously if the behaviour is unintended.
The MochiTreasuryV0 contract attempts to lock tokens in Curve's VotingEscrow contract, but VotingEscrow does not allow contracts to call its lock functions. As a result, any attempt to lock tokens from the treasury contract will fail.
The liquidation function in MochiVault.sol subtracts the passed-in debt amount from the position's stored debt, but the stored debt is discounted while the passed-in amount is not, causing an underflow. As a result, any discount profile that applies a non-zero discount will make all liquidations revert, preventing collateral from being liquidated.
The update function in the UniswapV2/Sushiswap LP adapter incorrectly calls the router's update with the LP token itself instead of the underlying token, causing infinite recursion and gas exhaustion. An attacker could trigger this function to cause a denial of service.
The total debt in the vault is updated by subtracting only the calling user's discounted debt, making the total debt path-dependent on which user triggers the accrual. An attacker could exploit this to cause the total debt to be lower or higher than it should be, potentially leading to incorrect interest calculations and financial discrepancies.
The registerAsset() function in MochiProfileV0.sol allows anyone to reset the asset class of an already registered asset to AssetClass.Sigma, provided sufficient liquidity. This changes several risk parameters and could lead to unintended liquidations.
The global debt variable is increased by the borrowed amount excluding the fee, but decreased by the amount including the fee, making the debt tracking inaccurate. This causes all calculations that rely on this variable to be slightly off.
The claimRewardAsMochi function did not reduce the user's reward balance after a claim, allowing a referrer to repeatedly claim the same reward and drain the fee pool.
The FeePoolV0 contract overwrites treasuryShare when distributeMochi() is called, allowing veCRV holders to repeatedly distribute mochi tokens and eventually receive all tokens intended for the treasury.
The claimRewardAsMochi function in ReferralFeePoolV0 swaps and transfers assets without any slippage limit, so the amount received is not protected. An attacker could sandwich the transaction and take value from the user's reward claim.
The `_shareMochi()` function resets `treasuryShare` to zero even though it only distributes `mochiShare`. An attacker can repeatedly call `distributeMochi()` and `updateReserve()` to consume the treasury share, causing the protocol to lose funds.
The vault contract records a borrower's debt including a 0.5 percent fee but adds only the raw borrowed amount to the contract's total debt counter. This makes the contract's debt figure lower than the sum of user debts, so a repayment can drive the counter to zero and later liquidations revert, leaving bad debt.
The UniswapV2TokenAdapter's supports function only checks UniswapV2 liquidity and returns false if it is below the minimum, without checking Sushiswap liquidity. An attacker could create a UniswapV2 pool with no liquidity for a Sushiswap-only asset, causing the adapter to reject it even though Sushiswap has sufficient liquidity.
The borrow function in MochiVault does not revert when a user tries to borrow more than the maximum collateral factor allows; instead it borrows up to the maximum. This could lead a user to borrow at a dangerous collateral level and receive less than requested.
The vault factory contract lacked permission control, allowing anyone to deploy a vault. This could cause the government's attempt to register the asset to revert, and the protocol would still recognise the unauthorised vault as valid.
MC
Mochi contest
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.