Blockwell

NOIA Token

ERC20

This contract is an ERC20 token.

Name NOIA Token
Symbol NOIA
Decimals 18
Total Supply 1,000,000,000 NOIA

About

Stats

Public Functions 22
Event Types 4
Code Size 32,068 bytes

Library Use

Uses SafeMath for uint256.
Uses Address for address.
Uses ECDSA for bytes32.

Events (4) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

TransferPreSigned Event

Parameters help
from
address help
to
address help
delegate
address help
amount
uint256 help
fee
uint256 help

name Constant

string help
NOIA Token

symbol Constant

string help
NOIA

decimals Constant

uint8 help
UNKNOWN VALUE

tokensToMint Variable

uint256 help

burnAddress Variable

address help

etherlessTransferEnabled Variable

bool help

notify Variable

mapping(address => bool) help

hashedTxs Variable

mapping(bytes32 => bool) help
Internal Variable

_owner Variable

address help
Internal Variable

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowances Variable

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

_totalSupply Variable

uint256 help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
account
address help

Properties

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

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) {
  bool success = super.transfer(to, value);
  if (success) {
    _postTransfer(msg.sender, to, value);
  }
  return success;
}

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 _allowances[owner][spender];
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 value) public returns (bool) {
  _approve(msg.sender, spender, value);
  return true;
}

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public returns (bool) {
  bool success = super.transferFrom(from, to, value);
  if (success) {
    _postTransfer(from, to, value);
  }
  return success;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseAllowance(address spender, uint256 addedValue)
  public
  returns (bool)
{
  _approve(
    msg.sender,
    spender,
    _allowances[msg.sender][spender].add(addedValue)
  );
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  public
  returns (bool)
{
  _approve(
    msg.sender,
    spender,
    _allowances[msg.sender][spender].sub(subtractedValue)
  );
  return true;
}

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function owner() public view returns (address) {
  return _owner;
}

isOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function isOwner() public view returns (bool) {
  return msg.sender == _owner;
}

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function renounceOwnership() public onlyOwner {
  emit OwnershipTransferred(_owner, address(0));
  _owner = address(0);
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  _transferOwnership(newOwner);
}

recoverTokens keyboard_arrow_up

Parameters help

Name Type
token
IERC20 help
to
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function recoverTokens(
  IERC20 token,
  address to,
  uint256 amount
) public onlyOwner {
  uint256 balance = token.balanceOf(address(this));
  require(balance >= amount, "Given amount is larger than current balance");
  token.safeTransfer(to, amount);
}

register keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function register() public {
  notify[msg.sender] = true;
}

unregister keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unregister() public {
  notify[msg.sender] = false;
}

enableEtherlessTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function enableEtherlessTransfer() public onlyOwner {
  etherlessTransferEnabled = true;
}

disableEtherlessTransfer keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
function disableEtherlessTransfer() public onlyOwner {
  etherlessTransferEnabled = false;
}

mint keyboard_arrow_up

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function mint(address to, uint256 value) public onlyOwner returns (bool) {
  require(tokensToMint.sub(value) >= 0, "Not enough tokens left");
  tokensToMint = tokensToMint.sub(value);
  _mint(to, value);
  _postTransfer(address(0), to, value);
  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 {
  require(msg.sender == burnAddress, "Only burnAddress can burn tokens");
  _burn(msg.sender, value);
}

setBurnAddress keyboard_arrow_up

Parameters help

Name Type
_burnAddress
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
function setBurnAddress(address _burnAddress) external onlyOwner {
  require(balanceOf(_burnAddress) == 0, "Burn address must have zero balance!");

  burnAddress = _burnAddress;
}

transferPreSigned keyboard_arrow_up

Parameters help

Name Type
_signature
bytes help
_to
address help
_value
uint256 help
_fee
uint256 help
_nonce
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferPreSigned(
  bytes memory _signature,
  address _to,
  uint256 _value,
  uint256 _fee,
  uint256 _nonce
) public onlyEtherlessTransferEnabled returns (bool) {
  require(_to != address(0), "Transfer to the zero address");

  bytes32 hashedParams = hashForSign(
    msg.sig,
    address(this),
    _to,
    _value,
    _fee,
    _nonce
  );
  address from = hashedParams.toEthSignedMessageHash().recover(_signature);
  require(from != address(0), "Invalid signature");

  bytes32 hashedTx = keccak256(abi.encodePacked(from, hashedParams));
  require(hashedTxs[hashedTx] == false, "Nonce already used");
  hashedTxs[hashedTx] = true;

  if (msg.sender == _to) {
    _transfer(from, _to, _value.add(_fee));
    _postTransfer(from, _to, _value.add(_fee));
  } else {
    _transfer(from, _to, _value);
    _postTransfer(from, _to, _value);
    _transfer(from, msg.sender, _fee);
    _postTransfer(from, msg.sender, _fee);
  }

  emit TransferPreSigned(from, _to, msg.sender, _value, _fee);
  return true;
}

hashForSign keyboard_arrow_up

Parameters help

Name Type
_selector
bytes4 help
_token
address help
_to
address help
_value
uint256 help
_fee
uint256 help
_nonce
uint256 help

Properties

Visibility help public
Mutability help pure
Source Code
function hashForSign(
  bytes4 _selector,
  address _token,
  address _to,
  uint256 _value,
  uint256 _fee,
  uint256 _nonce
) public pure returns (bytes32) {
  return
    keccak256(abi.encodePacked(_selector, _token, _to, _value, _fee, _nonce));
}

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 NOIAToken._postTransfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _postTransfer(
  address from,
  address to,
  uint256 value
) internal {
  if (to.isContract()) {
    if (notify[to] == false) return;

    ITokenReceiver(to).tokensReceived(from, to, value);
  } else {
    if (to == burnAddress) {
      _burn(burnAddress, value);
    }
  }
}

internal NOIAToken._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 value) internal {
  require(tokensToMint == 0, "All tokens must be minted before burning");
  super._burn(account, value);
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _owner = msg.sender;
  emit OwnershipTransferred(address(0), _owner);
}

internal Ownable._transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transferOwnership(address newOwner) internal {
  require(newOwner != address(0), "Ownable: new owner is the zero address");
  emit OwnershipTransferred(_owner, newOwner);
  _owner = newOwner;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address sender,
  address recipient,
  uint256 amount
) internal {
  require(sender != address(0), "ERC20: transfer from the zero address");
  require(recipient != address(0), "ERC20: transfer to the zero address");

  _balances[sender] = _balances[sender].sub(amount);
  _balances[recipient] = _balances[recipient].add(amount);
  emit Transfer(sender, recipient, amount);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 amount) internal {
  require(account != address(0), "ERC20: mint to the zero address");

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);
  emit Transfer(address(0), account, amount);
}

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 value) internal {
  require(account != address(0), "ERC20: burn from the zero address");

  _totalSupply = _totalSupply.sub(value);
  _balances[account] = _balances[account].sub(value);
  emit Transfer(account, address(0), value);
}

internal ERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 value
) internal {
  require(owner != address(0), "ERC20: approve from the zero address");
  require(spender != address(0), "ERC20: approve to the zero address");

  _allowances[owner][spender] = value;
  emit Approval(owner, spender, value);
}

internal ERC20._burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burnFrom(address account, uint256 amount) internal {
  _burn(account, amount);
  _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}