Blockwell

Eminence

ERC20

This contract is an ERC20 token.

Name Eminence
Symbol EMN
Decimals 18
Total Supply 11,589,814,369 EMN

About

Stats

Public Functions 21
Event Types 8
Code Size 9,847 bytes

Events (8) keyboard_arrow_up

AddGM Event

Parameters help
newGM
address help
gm
address help

AddNPC Event

Parameters help
newNPC
address help
gm
address help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

CashShopBuy Event

Parameters help
_from
address help
_amount
uint help
_deposit
uint help

CashShopSell Event

Parameters help
_from
address help
_amount
uint help
_reimbursement
uint help

RevokeGM Event

Parameters help
newGM
address help
gm
address help

RevokeNPC Event

Parameters help
newNPC
address help
gm
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

DAI Constant

IERC20 help

CURVE Constant

BondingCurve help

scale Variable

uint help

reserveBalance Variable

uint help

reserveRatio Variable

uint32 help

gamemasters Variable

mapping(address => bool) help

npcs Variable

mapping(address => bool) help

_balances Variable

mapping(address => uint) help
Internal Variable

_allowances Variable

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

_totalSupply Variable

uint help
Internal Variable

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 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 name() public view returns (string memory) {
  return _name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string memory) {
  return _symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  return _decimals;
}

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
recipient
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

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

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
amount
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

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

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address sender,
  address recipient,
  uint256 amount
) public returns (bool) {
  _transfer(sender, recipient, amount);
  _approve(
    sender,
    msg.sender,
    _allowances[sender][msg.sender].sub(
      amount,
      "ERC20: transfer amount exceeds allowance"
    )
  );
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint 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
uint 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,
      "ERC20: decreased allowance below zero"
    )
  );
  return true;
}

Parameters help

Name Type
_amount
uint help

Properties

Visibility help public
Mutability help view
Source Code
function calculateContinuousMintReturn(uint256 _amount)
  public
  view
  returns (uint256 mintAmount)
{
  return
    CURVE.calculatePurchaseReturn(
      totalSupply(),
      reserveBalance,
      uint32(reserveRatio),
      _amount
    );
}

Parameters help

Name Type
_amount
uint help

Properties

Visibility help public
Mutability help view
Source Code
function calculateContinuousBurnReturn(uint256 _amount)
  public
  view
  returns (uint256 burnAmount)
{
  return
    CURVE.calculateSaleReturn(
      totalSupply(),
      reserveBalance,
      uint32(reserveRatio),
      _amount
    );
}

Parameters help

Name Type
_npc
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function addNPC(address _npc) external {
  require(gamemasters[msg.sender], "!gm");
  npcs[_npc] = true;
  emit AddNPC(_npc, msg.sender);
}

Parameters help

Name Type
_npc
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function revokeNPC(address _npc) external {
  require(gamemasters[msg.sender], "!gm");
  npcs[_npc] = false;
  emit RevokeNPC(_npc, msg.sender);
}

Parameters help

Name Type
_gm
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

One or more of the following:
Source Code
function addGM(address _gm) external {
  require(gamemasters[msg.sender] || gamemasters[tx.origin], "!gm");
  gamemasters[_gm] = true;
  emit AddGM(_gm, msg.sender);
}

Parameters help

Name Type
_gm
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function revokeGM(address _gm) external {
  require(gamemasters[msg.sender], "!gm");
  gamemasters[_gm] = false;
  emit RevokeGM(_gm, msg.sender);
}

Parameters help

Name Type
_to
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function award(address _to, uint256 _amount) external {
  require(gamemasters[msg.sender], "!gm");
  _mint(_to, _amount);
}

Parameters help

Name Type
_from
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function claim(address _from, uint256 _amount) external {
  require(gamemasters[msg.sender] || npcs[msg.sender], "!gm");
  _burn(_from, _amount);
}

Parameters help

Name Type
_amount
uint help
_min
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function buy(uint256 _amount, uint256 _min) external returns (uint256 _bought) {
  _bought = _buy(_amount);
  require(_bought >= _min, "slippage");
  DAI.transferFrom(msg.sender, address(this), _amount);
  _mint(msg.sender, _bought);
  emit CashShopBuy(msg.sender, _bought, _amount);
}

Parameters help

Name Type
_amount
uint help
_min
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function sell(uint256 _amount, uint256 _min)
  external
  returns (uint256 _bought)
{
  _bought = _sell(_amount);
  require(_bought >= _min, "slippage");
  _burn(msg.sender, _amount);
  DAI.transfer(msg.sender, _bought);
  emit CashShopSell(msg.sender, _amount, _bought);
}

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 ContinuousToken._buy keyboard_arrow_up

Parameters help

Name Type
_amount
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _buy(uint256 _amount) internal returns (uint256 _bought) {
  _bought = _continuousMint(_amount);
}

internal ContinuousToken._sell keyboard_arrow_up

Parameters help

Name Type
_amount
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _sell(uint256 _amount) internal returns (uint256 _sold) {
  _sold = _continuousBurn(_amount);
}

internal ContinuousToken._continuousMint keyboard_arrow_up

Parameters help

Name Type
_deposit
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _continuousMint(uint256 _deposit) internal returns (uint256) {
  uint256 amount = calculateContinuousMintReturn(_deposit);
  reserveBalance = reserveBalance.add(_deposit);
  return amount;
}

internal ContinuousToken._continuousBurn keyboard_arrow_up

Parameters help

Name Type
_amount
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _continuousBurn(uint256 _amount) internal returns (uint256) {
  uint256 reimburseAmount = calculateContinuousBurnReturn(_amount);
  reserveBalance = reserveBalance.sub(reimburseAmount);
  return reimburseAmount;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint 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,
    "ERC20: transfer amount exceeds balance"
  );
  _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
uint 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
amount
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

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

  _balances[account] = _balances[account].sub(
    amount,
    "ERC20: burn amount exceeds balance"
  );
  _totalSupply = _totalSupply.sub(amount);
  emit Transfer(account, address(0), amount);
}

internal ERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 amount
) internal {
  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);
}