ERC20
This contract is an ERC20 token.
Name
EXMR_FDN
Symbol
EXMR
Decimals
18
Total Supply
18,089,196 EXMR
About link
EXMR FDN (EXMR) is a cryptocurrency and operates on the Ethereum platform. EXMR FDN has a current supply of 18,003,524.6541 with 6,310,751.45617 in circulation. The last known price of EXMR FDN is 0.01192467 USD and is down -14.93 over the last 24 hours. It is currently trading on 5 active market(s) with $32,477.87 traded over the last 24 hours. More information can be found at https://exmr.foundation.
Stats
Public Functions
28
Event Types
9
Code Size
19,987 bytes
Library Use
Uses SafeMath for uint256.
Events (9) keyboard_arrow_up
State Variables (18) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address payable _newOwner) public onlyOwner {
newOwner = _newOwner;
}
acceptOwnership keyboard_arrow_up
changesafeGuardStatus keyboard_arrow_up
setBurningRate keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setBurningRate(uint256 _burningRate)
public
onlyOwner
returns (bool success)
{
burningRate = _burningRate;
return true;
}
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) public returns (bool success) {
require(!safeGuard);
require(_from != address(0), "transfer from adderss(0) is invalid");
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value)
public
returns (bool success)
{
require(!safeGuard);
allowance[msg.sender][_spender] = _value;
return true;
}
mintToken keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function mintToken(address target, uint256 mintedAmount)
public
onlyOwner
returns (bool success)
{
balanceOf[target] = balanceOf[target].add(mintedAmount);
tokens[address(this)][target].totalValue = tokens[address(this)][target]
.totalValue
.add(mintedAmount); //parallel record for multi token addressing need
totalSupply = totalSupply.add(mintedAmount);
totalMintAfterInitial = totalMintAfterInitial.add(mintedAmount);
emit Transfer(address(0), address(this), mintedAmount);
return true;
}
burn keyboard_arrow_up
burnFrom keyboard_arrow_up
changeWhitelistingStatus keyboard_arrow_up
whitelistUser keyboard_arrow_up
freezeAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function freezeAccount(address target, bool freeze) public onlyOwner {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
manualWithdrawToken keyboard_arrow_up
manualWithdrawEther keyboard_arrow_up
Bounty keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
Source Code
function Bounty(address[] memory recipients, uint256[] memory tokenAmount)
public
onlyOwner
returns (bool)
{
uint256 reciversLength = recipients.length;
require(reciversLength <= 150);
for (uint256 i = 0; i < reciversLength; i++) {
//This will loop through all the recipients and send them the specified tokens
_transfer(owner, recipients[i], tokenAmount[i]);
}
return true;
}
setWithdrawWaitingPeriod keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setWithdrawWaitingPeriod(uint256 valueInSeconds)
public
onlyOwner
returns (bool)
{
meltHoldSeconds = valueInSeconds;
return true;
}
newTokenTypeData keyboard_arrow_up
Parameters help
Modifiers help
onlyOwner checks for the following:
Source Code
function newTokenTypeData(
address token,
bytes23 _tokenName,
bytes8 _tokenSymbol,
uint256 _decimalCount,
uint256 _minFreezingValue,
uint256 _rateFactor,
uint256 _perDayFreezeRate
) public onlyOwner returns (bool) {
tokenTypeData memory temp;
temp.tokenName = _tokenName;
temp.tokenSymbol = _tokenSymbol;
temp.decimalCount = _decimalCount;
temp.minFreezingValue = _minFreezingValue;
temp.rateFactor = _rateFactor;
temp.perDayFreezeRate = _perDayFreezeRate;
temp.freezingAllowed = true;
tokenTypeDatas[token] = temp;
return true;
}
freezingOnOffForTokenType keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function freezingOnOffForTokenType(address token)
public
onlyOwner
returns (bool)
{
if (tokenTypeDatas[token].freezingAllowed == false) {
tokenTypeDatas[token].freezingAllowed = true;
} else {
tokenTypeDatas[token].freezingAllowed = false;
}
return true;
}
setMinFreezingValue keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setMinFreezingValue(address token, uint256 _minFreezingValue)
public
onlyOwner
returns (bool)
{
tokenTypeDatas[token].minFreezingValue = _minFreezingValue;
return true;
}
setRateFactor keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setRateFactor(address token, uint256 _rateFactor)
public
onlyOwner
returns (bool)
{
tokenTypeDatas[token].rateFactor = _rateFactor;
return true;
}
setPerDayFreezeRate keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setPerDayFreezeRate(address token, uint256 _perDayFreezeRate)
public
onlyOwner
returns (bool)
{
tokenTypeDatas[token].perDayFreezeRate = _perDayFreezeRate;
return true;
}
tokenDeposit keyboard_arrow_up
Source Code
function tokenDeposit(address token, uint256 amount) public {
require(token != address(0), "Address(0) found, can't continue");
require(
ERC20Necessary(token).transferFrom(msg.sender, address(this), amount),
"ERC20 'transferFrom' call failed"
);
tokens[token][msg.sender].totalValue = tokens[token][msg.sender]
.totalValue
.add(amount);
emit tokenDepositEv(
token,
msg.sender,
amount,
tokens[token][msg.sender].totalValue
);
}
tokenWithdraw keyboard_arrow_up
Requirements help
Source Code
function tokenWithdraw(address token, uint256 amount) public {
require(!safeGuard, "System Paused By Admin");
require(token != address(this));
require(token != address(0), "Address(0) found, can't continue");
if (now.sub(meltHoldSeconds) > tokens[token][msg.sender].freezeDate) {
tokens[token][msg.sender].meltValue = 0;
}
require(
tokens[token][msg.sender].totalValue.sub(
tokens[token][msg.sender].freezeValue.add(
tokens[token][msg.sender].meltValue
)
) >= amount,
"Required amount is not free to withdraw"
);
tokens[token][msg.sender].totalValue = tokens[token][msg.sender]
.totalValue
.sub(amount);
ERC20Necessary(token).transfer(msg.sender, amount);
emit tokenWithdrawEv(
token,
msg.sender,
amount,
tokens[token][msg.sender].totalValue
);
}
releaseMyExmr keyboard_arrow_up
Requirements help
Source Code
function releaseMyExmr(address token) public returns (bool) {
require(!safeGuard, "System Paused By Admin");
require(token != address(0), "Address(0) found, can't continue");
require(token == address(this), "Only pissible for EXMR ");
require(
now.sub(meltHoldSeconds) > tokens[token][msg.sender].freezeDate,
"wait period is not over"
);
uint256 amount = tokens[token][msg.sender].meltValue;
balanceOf[msg.sender] = balanceOf[msg.sender].add(amount);
tokens[token][msg.sender].totalValue = balanceOf[msg.sender].add(
tokens[token][msg.sender].freezeValue
);
tokens[token][msg.sender].meltValue = 0;
emit releaseMyExmrEv(token, amount);
return true;
}
tokenBalanceFreeze keyboard_arrow_up
Requirements help
Source Code
function tokenBalanceFreeze(address token, uint256 amount)
public
returns (bool)
{
require(!safeGuard, "System Paused By Admin");
require(
tokenTypeDatas[token].freezingAllowed,
"token type not allowed to freeze"
);
require(token != address(0), "Address(0) found, can't continue");
address callingUser = msg.sender;
require(msg.sender != address(0), "Address(0) found, can't continue");
require(
amount <=
tokens[token][callingUser].totalValue.sub(
tokens[token][callingUser].freezeValue.add(
tokens[token][callingUser].meltValue
)
) &&
amount >= tokenTypeDatas[token].minFreezingValue,
"less than required or less balance"
);
uint256 freezeValue = tokens[token][callingUser].freezeValue;
uint256 earnedValue;
if (freezeValue > 0) {
earnedValue = getEarning(token, callingUser, freezeValue);
require(mintInternal(earnedValue), "minting failed");
tokens[address(this)][callingUser].meltValue = tokens[address(this)][
callingUser
]
.meltValue
.add(earnedValue);
}
tokens[token][callingUser].freezeValue = tokens[token][callingUser]
.freezeValue
.add(amount);
if (token == address(this)) {
balanceOf[callingUser] = balanceOf[callingUser].sub(amount);
}
tokens[token][callingUser].freezeDate = now;
emit tokenBalanceFreezeEv(token, amount, earnedValue);
return true;
}
tokenBalanceMelt keyboard_arrow_up
Requirements help
null
Source Code
function tokenBalanceMelt(address token, uint256 amount) public returns (bool) {
require(!safeGuard, "System Paused By Admin");
require(token != address(0), "Address(0) found, can't continue");
address callingUser = msg.sender;
require(msg.sender != address(0), "Address(0) found, can't continue");
require(
amount <= tokens[token][callingUser].freezeValue && amount > 0,
"less than required or less balance"
);
uint256 freezeValue = tokens[token][callingUser].freezeValue;
uint256 earnedValue = getEarning(token, callingUser, freezeValue);
require(mintInternal(earnedValue), "minting failed");
tokens[address(this)][callingUser].meltValue = tokens[address(this)][
callingUser
]
.meltValue
.add(earnedValue);
tokens[token][callingUser].freezeValue = tokens[token][callingUser]
.freezeValue
.sub(amount);
if (token == address(this)) {
tokens[token][callingUser].meltValue = tokens[token][callingUser]
.meltValue
.add(amount);
}
tokens[token][callingUser].freezeDate = now;
emit tokenBalanceMeltEv(token, amount, earnedValue);
return true;
}
viewMyReward keyboard_arrow_up
Source Code
function viewMyReward(address token)
public
view
returns (uint256 freezedValue, uint256 rewardValue)
{
address callingUser = msg.sender;
uint256 freezeValue = tokens[token][callingUser].freezeValue;
uint256 earnedValue = getEarning(token, callingUser, freezeValue);
return (freezeValue, earnedValue);
}
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 EXMR_FDN.getEarning keyboard_arrow_up
Source Code
function getEarning(
address token,
address user,
uint256 amount
) internal view returns (uint256) {
uint256 effectiveAmount = calculatePercentage(
amount,
tokenTypeDatas[token].rateFactor
);
uint256 interestAmount = calculatePercentage(
effectiveAmount,
tokenTypeDatas[token].perDayFreezeRate
);
uint256 secondsPassed = (now - tokens[token][user].freezeDate);
uint256 daysPassed = 0;
if (secondsPassed >= 86400) // if less than one day earning will be zero
{
daysPassed = secondsPassed.div(86400);
}
return daysPassed.mul(interestAmount);
}
internal tokenERC20.calculatePercentage keyboard_arrow_up
Source Code
function calculatePercentage(uint256 PercentOf, uint256 percentTo)
internal
pure
returns (uint256)
{
uint256 factor = 10000;
require(percentTo <= factor);
uint256 c = PercentOf.mul(percentTo).div(factor);
return c;
}
internal tokenERC20._transfer keyboard_arrow_up
Requirements help
Source Code
function _transfer(
address _from,
address _to,
uint256 _value
) internal {
require(!safeGuard, "safeGuard Active");
require(_to != address(0), "to is address 0");
require(balanceOf[_from] >= _value, "no balance in from");
require(balanceOf[_to].add(_value) >= balanceOf[_to], "overflow balance");
require(!frozenAccount[_from], "from account frozen");
require(!frozenAccount[_to], "to account frozen");
balanceOf[_from] = balanceOf[_from].sub(_value);
tokens[address(this)][_from].totalValue = tokens[address(this)][_from]
.totalValue
.sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
tokens[address(this)][_to].totalValue = tokens[address(this)][_to]
.totalValue
.add(_value);
uint256 burnValue;
if (!(msg.sender == owner || msg.sender == address(this))) {
burnValue = calculatePercentage(_value, burningRate);
require(burnInternal(_to, burnValue), "burning failed");
}
emit Transfer(_from, _to, _value);
}
internal tokenERC20.burnInternal keyboard_arrow_up
Requirements help
Source Code
function burnInternal(address _burnFrom, uint256 _burnValue)
internal
returns (bool success)
{
require(!safeGuard, "safeGuard Active");
require(_burnFrom != address(0));
require(balanceOf[_burnFrom] >= _burnValue);
require(!frozenAccount[_burnFrom], "to account frozen");
balanceOf[_burnFrom] = balanceOf[_burnFrom].sub(_burnValue);
tokens[address(this)][_burnFrom].totalValue = tokens[address(this)][_burnFrom]
.totalValue
.sub(_burnValue);
balanceOf[address(0)] = balanceOf[address(0)].add(_burnValue);
tokens[address(this)][address(0)].totalValue = tokens[address(this)][
address(0)
]
.totalValue
.add(_burnValue);
totalSupply = totalSupply.sub(_burnValue);
emit Transfer(_burnFrom, address(0), _burnValue);
return true;
}
internal tokenERC20.mintInternal keyboard_arrow_up
Source Code
function mintInternal(uint256 mintedAmount) internal returns (bool success) {
totalSupply = totalSupply.add(mintedAmount);
totalMintAfterInitial = totalMintAfterInitial.add(mintedAmount);
return true;
}