# ElevatedMinterBurner

The `ElevatedMinterBurner.sol` contract is a periphery contract designed to facilitate minting and burning of tokens, and executing arbitrary calls.

It is an authorized minter and burner of MIM on sidechains, which allows Omnichain MIM to be compatible with the already deployed MIM contracts on sidechains.

It will be called by `LzIndirectOFTV2`as part of the beaming flow, which is an operator of `ElevatedMinterBurner`

### Contract Dependencies

The contract imports and builds upon the `Operatable.sol` and `IMintableBurnable.sol` contracts. The `Operatable.sol` mixin provides functionality to restrict certain contract functions to be executed only by an owner or operators. The `IMintableBurnable.sol` is an interface that defines the minting and burning functions that this contract implements.

### State Variables

* `IMintableBurnable public immutable token;` The contract holds a state variable `token` of type `IMintableBurnable`, which is made immutable and public. This variable represents the token for which minting, burning, and other operations can be performed. The token used is the MIM token on each sidechains.

### Constructor

* `constructor(IMintableBurnable token_)` The contract's constructor takes a token of type `IMintableBurnable` as an argument and assigns it to the `token` state variable.\
  The token used is the MIM token on each sidechains.

### Functions

1. `function burn(address from, uint256 amount) external override onlyOperators returns (bool)`: This function allows operators to burn a specific amount of tokens from a given address. It calls the `burn` function from the `IMintableBurnable` token instance. Returns true if the operation is successful.
2. `function mint(address to, uint256 amount) external override onlyOperators returns (bool)`: This function allows operators to mint a specific amount of tokens to a given address. It calls the `mint` function from the `IMintableBurnable` token instance. Returns true if the operation is successful.
3. `function exec(address target, bytes calldata data) external onlyOwner`: This function allows the contract owner to execute arbitrary calls to a target address with provided data. It directly calls the `call` function of the target address. If the call fails, it reverts the transaction and provides the failed call's result as the revert reason.

The `ElevatedMinterBurner.sol` contract is a key part of the bridging mechanism, providing an interface to mint and burn MIM in a controlled manner, while also allowing the contract owner to execute arbitrary calls.


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
