Blockwell

MATRIX AI Network

ERC20

This contract is an ERC20 token.

Name MATRIX AI Network
Symbol MAN
Decimals 18
Total Supply 250,000,000 MAN

About

Stats

Public Functions 11
Event Types 2
Code Size 8,949 bytes

Events (2) keyboard_arrow_up

Burn Event

Parameters help
from
address help
value
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

weiDECIMALS Constant

uint256 help
18

name Variable

string help

symbol Variable

string help

decimals Variable

uint256 help

startTime Variable

uint256 help

endTime Variable

uint256 help

currentTokenPerETH Variable

uint256 help

totalSupply Variable

uint256 help

availableSupply Variable

uint256 help

currentStage Variable

uint8 help

isInLockStage Variable

bool help

finalised Variable

bool help

balanceOf Variable

mapping(address => uint256) help

DECIMALSFACTOR Variable

uint256 help
Internal Variable

weiFACTOR Variable

uint256 help
Internal Variable

ethFundAddress Variable

address help
Internal Variable

address1 Variable

address help
Internal Variable

address2 Variable

address help
Internal Variable

address3 Variable

address help
Internal Variable

address4 Variable

address help
Internal Variable

address5 Variable

address help
Internal Variable

address6 Variable

address help
Internal Variable

address7 Variable

address help
Internal Variable

address8 Variable

address help
Internal Variable

address9 Variable

address help
Internal Variable

address10 Variable

address help
Internal Variable

lockedDuration Variable

uint256 help
Internal Variable

tokenPerETH Variable

uint256 help
Internal Variable

contractOwner Variable

address help
Internal Variable

ethRaised Variable

uint256 help
Internal Variable

tokenDistributed Variable

uint256 help
Internal Variable

donationCount Variable

uint256 help
Internal Variable

softCap Variable

uint256 help
Internal Variable

reservedAmountPerAddress Variable

uint256 help
Internal Variable

minimumDonation Variable

uint256 help
Internal Variable

allowance Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

Functions Expand All Collapse All

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function() public payable {
  require(!finalised);

  require(block.timestamp >= startTime);
  require(block.timestamp <= endTime);

  require(availableSupply > 0);

  mintMAN();
}

mintMAN keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function mintMAN() public payable {
  require(msg.value >= minimumDonation);

  uint256 preLockedTime = startTime + lockedDuration;

  if (block.timestamp <= preLockedTime) {
    currentStage = 0;
    isInLockStage = true;
  } else if (block.timestamp > preLockedTime && tokenDistributed <= softCap) {
    currentStage = 1;
    isInLockStage = true;
  } else if (
    block.timestamp > preLockedTime &&
    tokenDistributed <= 35 * (10**6) * DECIMALSFACTOR
  ) {
    currentTokenPerETH = 3430;
    currentStage = 2;
    isInLockStage = false;
  } else if (
    block.timestamp > preLockedTime &&
    tokenDistributed >= 35 * (10**6) * DECIMALSFACTOR
  ) {
    currentTokenPerETH = 3150;
    currentStage = 3;
    isInLockStage = false;
  }

  uint256 tokenValue = (currentTokenPerETH * msg.value) /
    10**(weiDECIMALS - decimals);
  uint256 etherValue = msg.value;

  if (tokenValue > availableSupply) {
    tokenValue = availableSupply;

    etherValue =
      (weiFACTOR * availableSupply) /
      currentTokenPerETH /
      DECIMALSFACTOR;

    require(msg.sender.send(msg.value - etherValue));
  }

  ethRaised += etherValue;
  donationCount += 1;
  availableSupply -= tokenValue;

  _transfer(contractOwner, msg.sender, tokenValue);
  tokenDistributed += tokenValue;

  require(ethFundAddress.send(etherValue));
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address _to, uint256 _value) public {
  require(!isInLockStage);
  _transfer(msg.sender, _to, _value);
}

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 success) {
  require(_value <= allowance[_from][msg.sender]); // Check allowance
  allowance[_from][msg.sender] -= _value;
  _transfer(_from, _to, _value);
  return true;
}

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 success)
{
  allowance[msg.sender][_spender] = _value;
  return true;
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveAndCall(
  address _spender,
  uint256 _value,
  bytes _extraData
) public returns (bool success) {
  tokenRecipient spender = tokenRecipient(_spender);
  if (approve(_spender, _value)) {
    spender.receiveApproval(msg.sender, _value, this, _extraData);
    return true;
  }
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public returns (bool success) {
  require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
  balanceOf[msg.sender] -= _value; // Subtract from the sender
  totalSupply -= _value; // Updates totalSupply
  Burn(msg.sender, _value);
  return true;
}

burnFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burnFrom(address _from, uint256 _value) public returns (bool success) {
  require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
  require(_value <= allowance[_from][msg.sender]); // Check allowance
  balanceOf[_from] -= _value; // Subtract from the targeted balance
  allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
  totalSupply -= _value; // Update totalSupply
  Burn(_from, _value);
  return true;
}

finalise keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function finalise() public {
  require(msg.sender == contractOwner);
  require(!finalised);

  finalised = true;
}

unlockTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unlockTokens() public {
  require(msg.sender == contractOwner);
  isInLockStage = false;
}

tokenHasDistributed keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function tokenHasDistributed() public constant returns (uint256) {
  return tokenDistributed;
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal MANToken._transfer keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address _from,
  address _to,
  uint256 _value
) internal {
  // Prevent transfer to 0x0 address. Use burn() instead
  require(_to != 0x0);
  // Check if the sender has enough
  require(balanceOf[_from] >= _value);
  // Check for overflows
  require(balanceOf[_to] + _value > balanceOf[_to]);
  // Save this for an assertion in the future
  uint256 previousBalances = balanceOf[_from] + balanceOf[_to];
  // Subtract from the sender
  balanceOf[_from] -= _value;
  // Add the same to the recipient
  balanceOf[_to] += _value;
  Transfer(_from, _to, _value);
  // Asserts are used to use static analysis to find bugs in your code. They should never fail
  assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}