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 variabletoken
of typeIMintableBurnable
, 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 typeIMintableBurnable
as an argument and assigns it to thetoken
state variable. The token used is the MIM token on each sidechains.
Functions
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 theburn
function from theIMintableBurnable
token instance. Returns true if the operation is successful.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 themint
function from theIMintableBurnable
token instance. Returns true if the operation is successful.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 thecall
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.
Last updated