Neutrino USD
ERC20
This contract is an ERC20 token.
Name
Neutrino USD
Symbol
USDN
Decimals
18
Total Supply
309,281,087 USDN
About
link
description
Neutrino USD (USDN) is a cryptocurrency and operates on the Ethereum platform. Neutrino USD has a current supply of 397,595,858.8219527 with 397,595,282.279442 in circulation. The last known price of Neutrino USD is 0.99872197 USD and is up 0.19 over the last 24 hours. It is currently trading on 29 active market(s) with $13,231,386.98 traded over the last 24 hours. More information can be found at https://neutrino.at/.
Stats
Public Functions
16
Event Types
4
Code Size
11,580 bytes
Events (4) keyboard_arrow_up
Constants (1) keyboard_arrow_up
State Variables (10) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
_admin
must be equal to
the sender's address
- OR
_owner
must be equal to
the sender's address
Source Code
function transferOwnership(address newOwner) external virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_owner = newOwner;
}
deprecate keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
_admin
must be equal to
the sender's address
- OR
_owner
must be equal to
the sender's address
Source Code
function deprecate() external onlyOwner {
deprecated = true;
emit Deprecate(msg.sender);
}
deposit keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
_admin
must be equal to
the sender's address
- OR
_owner
must be equal to
the sender's address
onlyNotDeprecated checks for the following:
Requirements help
Source Code
function deposit(address account, uint256 amount)
external
virtual
override
onlyOwner
onlyNotDeprecated
returns (bool)
{
require(amount > 0, "amount should be > 0");
require(account != address(0), "deposit to the zero address");
uint256 liquidDeposit = _liquidDeposit;
require(
liquidDeposit + amount >= liquidDeposit,
"addition overflow for deposit"
);
_liquidDeposit = liquidDeposit + amount;
uint256 oldDeposit = _deposits[account];
if (oldDeposit == 0) {
_balances[account] = balanceOf(account);
_rewardIndexForAccount[account] = _percents.length - 1;
_deposits[account] = amount;
} else {
uint256 rewardIndex = _rewardIndexForAccount[account];
if (rewardIndex == _percents.length - 1) {
require(
oldDeposit + amount >= oldDeposit,
"addition overflow for deposit"
);
_deposits[account] = oldDeposit + amount;
} else {
_balances[account] = balanceOf(account);
_rewardIndexForAccount[account] = _percents.length - 1;
_deposits[account] = amount;
}
}
emit Transfer(address(0), account, amount);
return true;
}
stake keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
_admin
must be equal to
the sender's address
- OR
_owner
must be equal to
the sender's address
onlyNotDeprecated checks for the following:
Requirements help
Source Code
function stake(uint256 reward)
external
virtual
override
onlyOwner
onlyNotDeprecated
returns (bool)
{
require(reward > 0, "reward should be > 0");
uint256 liquidTotalSupply = _liquidTotalSupply;
uint256 liquidDeposit = _liquidDeposit;
if (liquidTotalSupply == 0) {
_percents.push(PERCENT_FACTOR);
} else {
uint256 oldPercent = _percents[_percents.length - 1];
uint256 percent = (reward * PERCENT_FACTOR) / liquidTotalSupply;
require(
percent + PERCENT_FACTOR >= percent,
"addition overflow for percent"
);
uint256 newPercent = percent + PERCENT_FACTOR;
_percents.push((newPercent * oldPercent) / PERCENT_FACTOR);
require(
liquidTotalSupply + reward >= liquidTotalSupply,
"addition overflow for total supply + reward"
);
liquidTotalSupply = liquidTotalSupply + reward;
}
require(
liquidTotalSupply + liquidDeposit >= liquidTotalSupply,
"addition overflow for total supply"
);
_liquidTotalSupply = liquidTotalSupply + liquidDeposit;
_liquidDeposit = 0;
emit Reward(_percents.length, reward);
return true;
}
withdraw keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
One or more of the following:
-
_admin
must be equal to
the sender's address
- OR
_owner
must be equal to
the sender's address
onlyNotDeprecated checks for the following:
Source Code
function withdraw(address account)
external
virtual
override
onlyOwner
onlyNotDeprecated
returns (bool)
{
uint256 oldDeposit = _deposits[account];
uint256 rewardIndex = _rewardIndexForAccount[account];
if (rewardIndex == _percents.length - 1) {
uint256 balance = _balances[account];
require(
balance <= _liquidTotalSupply,
"subtraction overflow for total supply"
);
_liquidTotalSupply = _liquidTotalSupply - balance;
require(
oldDeposit <= _liquidDeposit,
"subtraction overflow for liquid deposit"
);
_liquidDeposit = _liquidDeposit - oldDeposit;
require(
balance + oldDeposit >= balance,
"addition overflow for total balance + oldDeposit"
);
emit Transfer(account, address(0), balance + oldDeposit);
} else {
uint256 balance = balanceOf(account);
uint256 liquidTotalSupply = _liquidTotalSupply;
require(
balance <= liquidTotalSupply,
"subtraction overflow for total supply"
);
_liquidTotalSupply = liquidTotalSupply - balance;
emit Transfer(account, address(0), balance);
}
_balances[account] = 0;
_deposits[account] = 0;
return true;
}
totalSupply keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function totalSupply() external view virtual override returns (uint256) {
uint256 liquidTotalSupply = _liquidTotalSupply;
uint256 liquidDeposit = _liquidDeposit;
require(
liquidTotalSupply + liquidDeposit >= liquidTotalSupply,
"addition overflow for total supply"
);
return liquidTotalSupply + liquidDeposit;
}
balanceOf keyboard_arrow_up
Source Code
function balanceOf(address account)
public
view
virtual
override
returns (uint256)
{
uint256 balance = _balances[account];
uint256 oldDeposit = _deposits[account];
if (balance == 0 && oldDeposit == 0) {
return 0;
}
uint256 rewardIndex = _rewardIndexForAccount[account];
if (rewardIndex == _percents.length - 1) {
require(balance + oldDeposit >= balance, "addition overflow for balance");
return balance + oldDeposit;
}
if (oldDeposit == 0) {
uint256 profit = _percents[_percents.length - 1];
return (profit * balance) / _percents[rewardIndex];
} else {
uint256 newBalance = (balance * _percents[_percents.length - 1]) /
_percents[rewardIndex];
uint256 profit = (oldDeposit * _percents[_percents.length - 1]) /
_percents[rewardIndex + 1];
require(profit + newBalance >= newBalance, "addition overflow for balance");
return profit + newBalance;
}
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 amount)
external
virtual
override
returns (bool)
{
_approve(msg.sender, spender, amount);
return true;
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
external
virtual
override
returns (bool)
{
uint256 temp = _allowances[msg.sender][spender];
require(temp + addedValue >= temp, "addition overflow");
_approve(msg.sender, spender, temp + addedValue);
return true;
}
decreaseAllowance keyboard_arrow_up
Requirements help
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
external
virtual
override
returns (bool)
{
uint256 temp = _allowances[msg.sender][spender];
require(subtractedValue <= temp, "ERC20: decreased allowance below zero");
_approve(msg.sender, spender, temp - subtractedValue);
return true;
}
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address recipient, uint256 amount)
external
virtual
override
returns (bool)
{
_transfer(msg.sender, recipient, amount);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address sender,
address recipient,
uint256 amount
) external virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 temp = _allowances[sender][msg.sender];
require(amount <= temp, "ERC20: transfer amount exceeds allowance");
_approve(sender, msg.sender, temp - amount);
return true;
}
name keyboard_arrow_up
symbol keyboard_arrow_up
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 StandartToken._approve keyboard_arrow_up
Modifiers help
onlyNotDeprecated checks for the following:
Requirements help
Source Code
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual onlyNotDeprecated {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
internal StandartToken._transfer keyboard_arrow_up
Modifiers help
onlyNotDeprecated checks for the following:
Requirements help
Source Code
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual onlyNotDeprecated {
require(amount > 0, "amount should be > 0");
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 oldDeposit = _deposits[sender];
uint256 rewardIndex = _rewardIndexForAccount[sender];
uint256 depositDiff = 0;
if (oldDeposit == 0 || rewardIndex != _percents.length - 1) {
uint256 senderBalance = balanceOf(sender);
require(amount <= senderBalance, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_deposits[sender] = 0;
_rewardIndexForAccount[sender] = _percents.length - 1;
} else {
if (amount <= oldDeposit) {
_deposits[sender] = oldDeposit - amount;
depositDiff = amount;
} else {
uint256 senderBalance = _balances[sender];
require(
amount - oldDeposit <= senderBalance,
"ERC20: transfer amount exceeds balance"
);
_balances[sender] = senderBalance - (amount - oldDeposit);
_deposits[sender] = 0;
depositDiff = oldDeposit;
}
}
oldDeposit = _deposits[recipient];
rewardIndex = _rewardIndexForAccount[recipient];
if (oldDeposit == 0 || rewardIndex != _percents.length - 1) {
uint256 recipientBalance = balanceOf(recipient);
require(
(amount - depositDiff) + recipientBalance >= recipientBalance,
"ERC20: addition overflow for recipient balance"
);
_balances[recipient] = recipientBalance + (amount - depositDiff);
_rewardIndexForAccount[recipient] = _percents.length - 1;
_deposits[recipient] = depositDiff;
} else {
uint256 recipientBalance = _balances[recipient];
_balances[recipient] = recipientBalance + (amount - depositDiff);
_deposits[recipient] = oldDeposit + depositDiff;
}
emit Transfer(sender, recipient, amount);
}