# MagnetarMintXChainModule will not work as msg type is not allowed

MagnetarMintXChainModule's cross-chain mint flow reverts because TapiocaOmnichainEngineHelper._sanitizeMsgType rejects MSG_DEPOSIT_LEND_AND_SEND_FOR_LOCK, breaking mint-on-A/deposit-on-B.

- Payout: Contest reward
- Severity: medium
- Program: Tapioca DAO
- Credited: rvierdiiev
- Disclosed: 2024-05-23
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-02-tapioca-findings/issues/59
- Library page: https://bugbountylibrary.com/r/c4%3A2024-02-tapioca%3AM-28
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic

**Target:** MagnetarMintXChainModule / TapiocaOmnichainEngineHelper (Solidity, LayerZero OFT)
**Root cause:** _lzCustomWithdraw always instantiates the base TapiocaOmnichainEngineHelper whose _sanitizeMsgTypeExtended is empty, so message types like MSG_DEPOSIT_LEND_AND_SEND_FOR_LOCK are not whitelisted and revert with InvalidMsgType.
**Steps:**
1. Call MagnetarMintXChainModule.mintBBLendXChainSGL, which mints USDO then calls _withdrawToChain.
2. _withdrawToChain calls _lzCustomWithdraw, which deploys/uses TapiocaOmnichainEngineHelper.
3. Helper builds compose message and calls _sanitizeMsgType(MSG_DEPOSIT_LEND_AND_SEND_FOR_LOCK).
4. _sanitizeMsgType does not match any allowed type and _sanitizeMsgTypeExtended returns false, so it reverts InvalidMsgType.
5. Cross-chain mint/lend flow never initiates; destination UsdoReceiver never receives the message.
**How found:** Traced the full cross-chain message flow from MagnetarMintXChainModule through _lzCustomWithdraw into TapiocaOmnichainEngineHelper, then read _sanitizeMsgType and noticed _sanitizeMsgTypeExtended is empty in the base helper, contradicting the sponsor's claim that the receiver-side handler covers it.
**Insight:** When a base helper has an empty virtual hook meant to be overridden, check whether the caller instantiates the base or the specialized subclass; a mismatch silently blocks whole message types at the source chain before any receiver logic runs.
