Blockwell

MXCToken

ERC20

This contract is an ERC20 token.

Name MXCToken
Symbol MXC
Decimals 18
Total Supply 2,664,965,800 MXC

About link

MXC is a Utility Token, also commonly referred to as an Internet of Things (IoT) Token. MXC is building a global data network to allow wireless devices to connect and communicate more efficiently and over longer distances than currently used WiFi and Bluetooth methods. The MXProtocol and the interoperable Para-Chain network are designed to help cities, companies, and individuals profit/benefit from building an LPWAN network and using it to both transmit and manage data. Via MXC contour payments, MXC developers have devised an integrated IoT payment solution to allow automated machine to machine payments and IoT transactions to occur within a matter of seconds.

Stats

Public Functions 13
Event Types 5
Code Size 15,695 bytes

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

GrantedTokenReturned Event

Parameters help
_from
address help
_to
address help
_amount
uint256 help

NewTokenGrant Event

Parameters help
_from
address help
_to
address help
_amount
uint256 help
_start
uint256 help
_cliff
uint256 help
_vesting
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

VestedTokenRedeemed Event

Parameters help
_to
address help
_amount
uint256 help
_vestedMonths
uint256 help

TimeLock Event

Members
amount
uint256 help
vestedAmount
uint256 help
vestedMonths
uint16 help
start
uint256 help
cliff
uint256 help
vesting
uint256 help
from
address help

Functions Expand All Collapse All

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function totalSupply() public view returns (uint256) {
        return totalSupply_;
    }

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help view
Source Code
    function balanceOf(address _owner) public view returns (uint256) {
        return balances[_owner];
    }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transfer(address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);

        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

allowance keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help view
Source Code
    function allowance(
        address _owner,
        address _spender
   )
        public
        view
        returns (uint256)
    {
        return allowed[_owner][_spender];
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    )
        public
        returns (bool)
    {
        require(_to != address(0));
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        emit Transfer(_from, _to, _value);
        return true;
    }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address _spender, uint256 _value) public returns (bool) {
        allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

increaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function increaseApproval(
        address _spender,
        uint256 _addedValue
    )
        public
        returns (bool)
    {
        allowed[msg.sender][_spender] = (
            allowed[msg.sender][_spender].add(_addedValue));
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

decreaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function decreaseApproval(
        address _spender,
        uint256 _subtractedValue
    )
        public
        returns (bool)
    {
        uint256 oldValue = allowed[msg.sender][_spender];
        if (_subtractedValue > oldValue) {
            allowed[msg.sender][_spender] = 0;
        } else {
            allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
        }
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

vestBalanceOf keyboard_arrow_up

Parameters help

Name Type
who
address help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
    function vestBalanceOf(address who)
        public view
        returns (uint256 amount, uint256 vestedAmount, uint256 start, uint256 cliff, uint256 vesting)
    {
        require(who != address(0));
        amount = timeLocks[who].amount;
        vestedAmount = timeLocks[who].vestedAmount;
        start = timeLocks[who].start;
        cliff = timeLocks[who].cliff;
        vesting = timeLocks[who].vesting;
    }

grantToken keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help
_start
uint256 help
_cliff
uint256 help
_vesting
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function grantToken(
        address _to,
        uint256 _amount,
        uint256 _start,
        uint256 _cliff,
        uint256 _vesting
    )
        public
        returns (bool success)
    {
        require(_to != address(0));
        require(_amount <= balances[msg.sender], "Not enough balance to grant token.");
        require(_amount > 0, "Nothing to transfer.");
        require((timeLocks[_to].amount.sub(timeLocks[_to].vestedAmount) == 0), "The previous vesting should be completed.");
        require(_cliff >= _start, "_cliff must be >= _start");
        require(_vesting > _start, "_vesting must be bigger than _start");
        require(_vesting > _cliff, "_vesting must be bigger than _cliff");

        balances[msg.sender] = balances[msg.sender].sub(_amount);
        timeLocks[_to] = TimeLock(_amount, 0, 0, _start, _cliff, _vesting, msg.sender);

        emit NewTokenGrant(msg.sender, _to, _amount, _start, _cliff, _vesting);
        return true;
    }

grantTokenStartNow keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help
_cliffMonths
uint256 help
_vestingMonths
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must be greater than UNKNOWN VALUE
Source Code
    function grantTokenStartNow(
        address _to,
        uint256 _amount,
        uint256 _cliffMonths,
        uint256 _vestingMonths
    )
        public
        returns (bool success)
    {
        return grantToken(
            _to,
            _amount,
            now,
            now.add(_cliffMonths.mul(MONTH)),
            now.add(_vestingMonths.mul(MONTH))
            );
    }

redeemVestableToken keyboard_arrow_up

Parameters help

Name Type
_to
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function redeemVestableToken(address _to)
        public
        returns (bool success)
    {
        require(_to != address(0));
        require(timeLocks[_to].amount > 0, "Nothing was granted to this address!");
        require(timeLocks[_to].vestedAmount < timeLocks[_to].amount, "All tokens were vested!");

        (uint256 amount, uint256 vestedMonths, uint256 curTime) = calcVestableToken(_to);
        require(amount > 0, "Nothing to redeem now.");

        TimeLock storage t = timeLocks[_to];
        balances[_to] = balances[_to].add(amount);
        t.vestedAmount = t.vestedAmount.add(amount);
        t.vestedMonths = t.vestedMonths + uint16(vestedMonths);
        t.cliff = curTime;

        emit VestedTokenRedeemed(_to, amount, vestedMonths);
        return true;
    }

returnGrantedToken keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function returnGrantedToken(uint256 _amount)
        public
        returns (bool success)
    {
        address to = timeLocks[msg.sender].from;
        require(to != address(0));
        require(_amount > 0, "Nothing to transfer.");
        require(timeLocks[msg.sender].amount > 0, "Nothing to return.");
        require(_amount <= timeLocks[msg.sender].amount.sub(timeLocks[msg.sender].vestedAmount), "Not enough granted token to return.");

        timeLocks[msg.sender].amount = timeLocks[msg.sender].amount.sub(_amount);
        balances[to] = balances[to].add(_amount);

        emit GrantedTokenReturned(msg.sender, to, _amount);
        return true;
    }