CMX

Git Source

Inherits: Diamond

Diamond-based omnichain fungible token using LayerZero OFT standard

Diamond implementation for modular CMX token functionality

Functions

constructor

Initialize CMX diamond

constructor(
    Diamond.InitParams memory initParams,
    address _lzEndpoint,
    address _owner,
    bool _isSourceChain,
    uint256 _initialSupply
) Diamond(initParams);

Parameters

Name
Type
Description

initParams

Diamond.InitParams

Diamond initialization parameters

_lzEndpoint

address

LayerZero endpoint address

_owner

address

Initial owner of the contract

_isSourceChain

bool

Whether this chain is the source chain

_initialSupply

uint256

Initial supply to mint (only on source chain)

name

Get token name

function name() external view returns (string memory);

Returns

Name
Type
Description

<none>

string

The token name

symbol

Get token symbol

function symbol() external view returns (string memory);

Returns

Name
Type
Description

<none>

string

The token symbol

decimals

Get token decimals

function decimals() external view returns (uint8);

Returns

Name
Type
Description

<none>

uint8

The token decimals

totalSupply

Get total supply

function totalSupply() external view returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The total supply

balanceOf

Get balance of account

function balanceOf(address account) external view returns (uint256);

Parameters

Name
Type
Description

account

address

The account to query

Returns

Name
Type
Description

<none>

uint256

The account balance

allowance

Get allowance

function allowance(address tokenOwner, address spender) external view returns (uint256);

Parameters

Name
Type
Description

tokenOwner

address

The owner address

spender

address

The spender address

Returns

Name
Type
Description

<none>

uint256

The allowance amount

endpoint

Get LayerZero endpoint

function endpoint() external view returns (address);

Returns

Name
Type
Description

<none>

address

The LayerZero endpoint address

owner

Get owner

function owner() external view returns (address);

Returns

Name
Type
Description

<none>

address

The owner address

MAX_SUPPLY

Get max supply

function MAX_SUPPLY() external pure returns (uint256);

Returns

Name
Type
Description

<none>

uint256

The maximum supply

isSourceChain

Check if this is the source chain

function isSourceChain() external view returns (bool);

Returns

Name
Type
Description

<none>

bool

True if source chain

initialized

Check if contract is initialized

function initialized() external view returns (bool);

Returns

Name
Type
Description

<none>

bool

True if initialized

oftVersion

Get LayerZero OFT version

function oftVersion() external pure returns (bytes4 interfaceId, uint64 version);

Returns

Name
Type
Description

interfaceId

bytes4

The interface identifier

version

uint64

The version number

receive

receive() external payable;

Last updated

Was this helpful?