<!-- canonical: https://0xsimao.com/reports/tapioca-dao -->

# Tapioca DAO audit contest

Code4rena · Omnichain money market · 5th July 2023 · #6

A public audit contest on Code4rena (omnichain money market), completed on 5th July 2023. 0xSimao placed #6. 10 of his findings are published: 9 high severity and 1 medium.

## What Tapioca DAO is

Tapioca is an omnichain money market built on LayerZero, spread across five repositories with OFTv2 and ONFT721 token contracts carrying assets between chains.

The main repository is tapioca-bar: USDO, a stablecoin, BigBang, the CDP engine that mints and burns it, and Singularity, the isolated lending and borrowing markets.

## Scope

Tapioca-bar and its supporting repositories: USDO, BigBang CDPs, Singularity lending markets and the omnichain token plumbing over LayerZero.

## High severity findings

- [TOFT in (m)TapiocaOft contracts can be stolen by calling removeCollateral() with a malicious removeParams.market](https://0xsimao.com/findings/tapioca-dao-toft-stolen-collateral-params)
- [TOFT `removeCollateral` can be used to steal all the balance](https://0xsimao.com/findings/tapioca-dao-toft-remove-collateral-steal)
- [All assets of (m)TapiocaOFT can be stealed by depositing to strategy cross chain call with 1 amount but maximum shares possible](https://0xsimao.com/findings/tapioca-dao-tapioca-stealed-maximum-shares)
- [Attacker can block LayerZero channel due to missing check of minimum gas passed](https://0xsimao.com/findings/tapioca-dao-layer-zero-channel-gas)
- [TOFT and USDO Modules Can Be Selfdestructed](https://0xsimao.com/findings/tapioca-dao-toft-usdo-modules-selfdestructed)
- [Exercise option cross chain message in the (m)TapiocaOFT will always revert in the destination, losing debited funds in the source chain](https://0xsimao.com/findings/tapioca-dao-exercise-revert-losing-debited)
- [`BaseTOFT.sol`: `retrieveFromStrategy` can be used to manipulate other user's positions due to absent approval check](https://0xsimao.com/findings/tapioca-dao-retrieve-manipulate-absent-approval)
- [triggerSendFrom() will send all the ETH in the destination chain where sendFrom() is called to the refundAddress in the LzCallParams argument](https://0xsimao.com/findings/tapioca-dao-eth-refund-params-argument)
- [A user with a TapiocaOFT allowance >0 could steal all the underlying ERC20 tokens of the owner](https://0xsimao.com/findings/tapioca-dao-allowance-steal-underlying-erc20)

## Medium severity findings

- [mTapiocaOFT can't be rebalanced because the Balancer in tapiocaz-audit calls swapETH() or swap() of the RouterETH but does not forward ether for the message fee](https://0xsimao.com/findings/tapioca-dao-rebalanced-balancer-eth-fee)

## The contest

[View the contest page](https://code4rena.com/audits/2023-07-tapioca-dao)
