> For the complete documentation index, see [llms.txt](https://dev.abracadabra.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.abracadabra.money/token-related/omnichain-mim/lzindirectoftv2.md).

# LzIndirectOFTV2

The `LzIndirectOFTV2.sol` contract acts as an Omnichain Fungible Token (OFT) in the LayerZero bridging system. This contract operates on sidechains and enables the transfer of MIM tokens from the Ethereum mainnet to the sidechain.

Here is a detailed overview of the contract:

### Contract Inheritance

The `LzIndirectOFTV2.sol` contract inherits from `LzBaseOFTV2.sol`, which provides the basic structure and functions for an OFT.

### Imported Libraries and Interfaces

* `IMintableBurnable.sol`: The interface for the `ElevatedMinterBurner` contract

### State Variables

* `minterBurner`: An immutable instance of `IMintableBurnable` that represents the `ElevatedMinterBurner` contract. This contract is authorized to mint and burn MIM tokens on the sidechain.
* `innerToken`: An instance of `IERC20` that represents the MIM token on the sidechain.
* `ld2sdRate`: An immutable uint that represents the conversion rate from the token's native decimal places to the shared decimal places used in the LayerZero system. LayerZero using 8 decimals.

### Constructor

The constructor for this contract takes four arguments: `_token`, `_minterBurner`, `_sharedDecimals`, and `_lzEndpoint`. These arguments are used to set the initial state of the contract.

### Public Functions

* `circulatingSupply()`: Returns the total supply of the `innerToken`.
* `token()`: Returns the address of the `innerToken`.

### Internal Functions

* `_debitFrom()`: Burns the specified amount of `innerToken` from the `_from` address. This function calls the minterBurner.burn()
* `_creditTo()`: Mints the specified amount of `innerToken` to the `_toAddress`. This function calls the minterBurner.mint()
* `_ld2sdRate()`: Returns the conversion rate from the token's native decimal places to the shared decimal places used in the LayerZero system.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dev.abracadabra.money/token-related/omnichain-mim/lzindirectoftv2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
