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
State Variables (9) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
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;
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
transferFrom keyboard_arrow_up
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;
}
increaseAllowance keyboard_arrow_up
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;
}
decreaseAllowance keyboard_arrow_up
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
isOwner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Source Code
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
recoverTokens keyboard_arrow_up
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
unregister keyboard_arrow_up
enableEtherlessTransfer keyboard_arrow_up
disableEtherlessTransfer keyboard_arrow_up
mint keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
null
Requirements help
UNKNOWN VALUE
must be greater than or equal to
0
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
Requirements help
Source Code
function burn(uint256 value) public {
require(msg.sender == burnAddress, "Only burnAddress can burn tokens");
_burn(msg.sender, value);
}
setBurnAddress keyboard_arrow_up
transferPreSigned keyboard_arrow_up
Parameters help
Modifiers help
onlyEtherlessTransferEnabled checks for the following:
Requirements 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
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
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
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
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
internal Ownable._transferOwnership keyboard_arrow_up
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
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
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
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
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
Requirements help
Source Code
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}