MOR OFT
The contract is the core implementation of the MOR token using LayerZero’s Omnichain Fungible Token (OFT) standard. It extends the traditional ERC20 token with cross-chain messaging capabilities, controlled minting, and token burning. The contract is designed to enable seamless use of the MOR token across multiple blockchains in the MOR ecosystem while maintaining strict control over its supply and minting rights.
Key Features
Omnichain compatibility: built on LayerZero’s OFT (OApp v2) for seamless token transfers across chains.
ERC20 compliant: supports standard ERC20 interface (IERC20), including allowance-based
burnFrom
.Minting control: only approved minters (set by contract owner,
L2MessageReceiver
as default) can mint new MOR tokens.Burnable: users can burn their own tokens or those they’ve been approved to spend.
Interface support: implements
IMOROFT
,IERC20
,IOAppCore
, andIERC165
for interoperability.
Notes
Standard ERC20 and OFT functions are not listed below.
Storage
isMinter
Returns true
when the address has rights to mint tokens. isMinter[<address>]
mapping(address => bool) public isMinter;
Functions with restricted access
updateMinter
Add or remove rights for minter_
to call the mint
function.
function updateMinter(address minter_, bool status_) external onlyOwner;
minter_
The new or existed minter address.
status_
The true, when we want to add new minter, and false when we want tot remove the rights.
mint
Mints new tokens to the specified account. This function can only be called by the _minter_
– L2MessageReceiver
.
function mint(address account_, uint256 amount_) public
account_
The account to which tokens are minted.
amount_
The number of tokens to mint.
Functions
burn
Burns a specified amount of tokens from the caller's account, reducing the total supply.
function burn(uint256 amount_) public
amount_
The number of tokens to be burned (removed) from the total supply and caller's account.
burnFrom
Burns a specified amount of tokens from the specified account, reducing the total supply. The caller must have allowance for at least the specified amount of tokens.
function burnFrom(address account_, uint256 amount_) public
account_
The account from which to burn tokens.
amount_
The number of tokens to be burned (removed) from the total supply.
Read functions
supportsInterface
Used for interface detection (ERC165). Returns true
if the contract supports a specific interfaceId_
. Supports IMOROFT
, IERC165
.
function supportsInterface(bytes4 interfaceId_) external pure returns (bool)
Last updated
Was this helpful?