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
Functions
constructor keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
balanceOf for the sender's address + tokenValue
must be greater than
balanceOf for the sender's address
Source Code
function () payable public {
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.
Requirements help
balanceOf for the sender's address + tokenValue
must be greater than
balanceOf for the sender's address
Source Code
function mintMAN() payable public {
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));
}
transfer keyboard_arrow_up
Requirements help
balanceOf for the sender's address + tokenValue
must be greater than
balanceOf for the sender's address
Source Code
function transfer(address _to, uint256 _value) public {
require(!isInLockStage);
_transfer(msg.sender, _to, _value);
}
transferFrom keyboard_arrow_up
Requirements help
balanceOf for the sender's address + tokenValue
must be greater than
balanceOf for the sender's address
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;
}
approve keyboard_arrow_up
approveAndCall keyboard_arrow_up
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
Requirements help
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
Requirements help
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;
}