Blockwell

EXMR_FDN

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

Burn Event

Parameters help
from
address help
value
uint256 help

FrozenFunds Event

Parameters help
target
address help
frozen
bool help

OwnershipTransferredEv Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

releaseMyExmrEv Event

Parameters help
token
address help
amount
uint help

tokenBalanceFreezeEv Event

Parameters help
token
address help
amount
uint help
earning
uint help

tokenBalanceMeltEv Event

Parameters help
token
address help
amount
uint help
earning
uint help

tokenDepositEv Event

Parameters help
token
address help
user
address help
amount
uint help
balance
uint help

tokenWithdrawEv Event

Parameters help
token
address help
user
address help
amount
uint help
balance
uint help

whitelistingStatus Variable

bool help

meltHoldSeconds Variable

uint help

name Variable

bytes23 help

symbol Variable

bytes8 help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

totalMintAfterInitial Variable

uint256 help

maximumSupply Variable

uint256 help

burningRate Variable

uint help

owner Variable

address help

newOwner Variable

address help

safeGuard Variable

bool help

whitelisted Variable

mapping(address => bool) help

balanceOf Variable

mapping(address => uint256) help

frozenAccount Variable

mapping(address => bool) help

tokens Variable

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

allowance Variable

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

tokenTypeDatas Variable

mapping(address => tokenTypeData) help
Internal Variable

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address payable _newOwner) public onlyOwner {
  newOwner = _newOwner;
}

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() public {
  require(msg.sender == newOwner);
  emit OwnershipTransferredEv(owner, newOwner);
  owner = newOwner;
  newOwner = address(0);
}

changesafeGuardStatus keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function changesafeGuardStatus() public onlyOwner {
  if (safeGuard == false) {
    safeGuard = true;
  } else {
    safeGuard = false;
  }
}

setBurningRate keyboard_arrow_up

Parameters help

Name Type
_burningRate
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setBurningRate(uint256 _burningRate)
  public
  onlyOwner
  returns (bool success)
{
  burningRate = _burningRate;
  return true;
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address _to, uint256 _value) public returns (bool success) {
  _transfer(msg.sender, _to, _value);
  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

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;
}

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 success)
{
  require(!safeGuard);
  allowance[msg.sender][_spender] = _value;
  return true;
}

mintToken keyboard_arrow_up

Parameters help

Name Type
target
address help
mintedAmount
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public onlyOwner returns (bool success) {
  burnInternal(msg.sender, _value);
  return true;
}

burnFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burnFrom(address _from, uint256 _value)
  public
  onlyOwner
  returns (bool success)
{
  burnInternal(_from, _value);
  return true;
}

changeWhitelistingStatus keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function changeWhitelistingStatus() public onlyOwner {
  if (whitelistingStatus == false) {
    whitelistingStatus = true;
    whitelisted[owner] = true;
  } else {
    whitelistingStatus = false;
  }
}

whitelistUser keyboard_arrow_up

Parameters help

Name Type
userAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function whitelistUser(address userAddress) public onlyOwner {
  require(whitelistingStatus == true);
  require(userAddress != address(0));
  whitelisted[userAddress] = true;
}

freezeAccount keyboard_arrow_up

Parameters help

Name Type
target
address help
freeze
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeAccount(address target, bool freeze) public onlyOwner {
  frozenAccount[target] = freeze;
  emit FrozenFunds(target, freeze);
}

manualWithdrawToken keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function manualWithdrawToken(uint256 _amount) public onlyOwner {
  uint256 tokenAmount = _amount.mul(100);
  _transfer(address(this), msg.sender, tokenAmount);
}

manualWithdrawEther keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function manualWithdrawEther() public onlyOwner {
  uint256 amount = address(this).balance;
  owner.transfer(amount);
}

Bounty keyboard_arrow_up

Parameters help

Name Type
recipients
address[] help
tokenAmount
uint[] help

Properties

Visibility help public
Mutability help transaction

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

Parameters help

Name Type
valueInSeconds
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setWithdrawWaitingPeriod(uint256 valueInSeconds)
  public
  onlyOwner
  returns (bool)
{
  meltHoldSeconds = valueInSeconds;
  return true;
}

newTokenTypeData keyboard_arrow_up

Parameters help

Name Type
token
address help
_tokenName
bytes23 help
_tokenSymbol
bytes8 help
_decimalCount
uint help
_minFreezingValue
uint help
_rateFactor
uint help
_perDayFreezeRate
uint help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help
_minFreezingValue
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setMinFreezingValue(address token, uint256 _minFreezingValue)
  public
  onlyOwner
  returns (bool)
{
  tokenTypeDatas[token].minFreezingValue = _minFreezingValue;
  return true;
}

setRateFactor keyboard_arrow_up

Parameters help

Name Type
token
address help
_rateFactor
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setRateFactor(address token, uint256 _rateFactor)
  public
  onlyOwner
  returns (bool)
{
  tokenTypeDatas[token].rateFactor = _rateFactor;
  return true;
}

setPerDayFreezeRate keyboard_arrow_up

Parameters help

Name Type
token
address help
_perDayFreezeRate
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPerDayFreezeRate(address token, uint256 _perDayFreezeRate)
  public
  onlyOwner
  returns (bool)
{
  tokenTypeDatas[token].perDayFreezeRate = _perDayFreezeRate;
  return true;
}

tokenDeposit keyboard_arrow_up

Parameters help

Name Type
token
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

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

Parameters help

Name Type
token
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
token
address help

Properties

Visibility help public
Mutability help view
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 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 EXMR_FDN.getEarning keyboard_arrow_up

Parameters help

Name Type
token
address help
user
address help
amount
uint help

Properties

Visibility help internal
Mutability help view
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

Parameters help

Name Type
PercentOf
uint256 help
percentTo
uint256 help

Properties

Visibility help internal
Mutability help pure
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

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help internal
Mutability help transaction

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

Parameters help

Name Type
_burnFrom
address help
_burnValue
uint help

Properties

Visibility help internal
Mutability help transaction
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

Parameters help

Name Type
mintedAmount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function mintInternal(uint256 mintedAmount) internal returns (bool success) {
  totalSupply = totalSupply.add(mintedAmount);
  totalMintAfterInitial = totalMintAfterInitial.add(mintedAmount);
  return true;
}