Omnichain MIM
How MIM moves between chains
Abracadabra's Cross-Chain Token Beaming System utilizes the Omnichain Fungible Token (OFT) standard by LayerZero, a decentralized and highly scalable protocol for cross-chain transactions. This system replaces the previous Multichain router for web3 that facilitated arbitrary cross-chain interactions. The system comprises three components:
- The LzProxyOFTV2 contract used on the Ethereum mainnet 
- The LzIndirectOFTV2 contract used on sidechains 
- The ElevatedMinterBurner contract that authorizes the minting and burning of MIM tokens on sidechains, allowing compatibility with already deployed MIM contract on sidechain 
Beaming flow:
Mainnet to Sidechain:
This process involves transferring native MIM from the Ethereum mainnet to a sidechain.
- The user initiates the process by interacting with the - LzProxyOFTV2contract on the Ethereum mainnet, which transfers MIM from the user's address to the contract's own address.
- Once the transfer to the - LzProxyOFTV2mainnet contract is complete, it communicates the transaction details, or "beaming" information, to the- LzIndirectOFTV2contract on the sidechain through LayerZero
- The - LzIndirectOFTV2contract on the sidechain then interacts with the- ElevatedMinterBurnercontract, which mints an equivalent amount of MIM tokens on sidechain, credited to the user's account.

Sidechain A to sidechain B
This process involves burning MIM tokens on sidechain A and minting them on sidechain B.
- The user first interacts with the - LzIndirectOFTV2contract on sidechain A which then calls upon the- ElevatedMinterBurnercontract on the same sidechain, burning the user's MIM tokens.
- Once the tokens are burnt, the - LzIndirectOFTV2contract on sidechain A communicates "beaming" information to the- LzIndirectOFTV2contract on sidechain B through LayerZero.
- Upon receiving the beaming information, the - LzIndirectOFTV2contract on sidechain B interacts with its- ElevatedMinterBurner, which mints an equivalent amount of MIM tokens on sidechain B, assigned to the user's account.

Sidechain to Mainnet
This process involves burning MIM tokens on a sidechain and transferring an equivalent amount from the proxy to the user on the Ethereum mainnet.
- The user interacts with the - LzIndirectOFTV2contract on the sidechain, which engages its- ElevatedMinterBurnercontract, burning the user's MIM tokens.
- Once the tokens are burnt, the - LzIndirectOFTV2contract communicates the "beaming" information to the- LzProxyOFTV2contract on the Ethereym mainnet through LayerZero.
- The - LzProxyOFTV2contract on mainnet transfers an equivalent amount of MIM tokens from itself to the user's account.

Note that while these examples use a generic "user" term, Omnichain MIM can be beamed from one user to another or to oneself, with the sender specifying the recipient.
Last updated
