Blockwell

ICE ROCK MINING

ERC20

This contract is an ERC20 token.

Name ICE ROCK MINING
Symbol ROCK2
Decimals
Total Supply NaN ROCK2

About link

ICE ROCK MINING (ROCK2) is a cryptocurrency and operates on the Ethereum platform. ICE ROCK MINING has a current supply of 15,724,272. The last known price of ICE ROCK MINING is 0.00649122 USD and is up 0.44 over the last 24 hours. It is currently trading on 1 active market(s) with $1,451.64 traded over the last 24 hours. More information can be found at https://icerockmining.io/.

Stats

Public Functions 16
Event Types 4
Code Size 8,881 bytes

Library Use

Uses itMaps for itMaps.itMapAddressUint.

Events (4) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

Burned Event

Parameters help
from
address help
amount
uint help

DividendsTransfered Event

Parameters help
to
address help
amount
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

name Constant

string help
ICE ROCK MINING

symbol Constant

string help
ROCK2

initialSupply Variable

uint256 help
Internal Variable

currentUSDExchangeRate Variable

uint help
Internal Variable

bonus Variable

uint help
Internal Variable

priceUSD Variable

uint help
Internal Variable

IceRockMiningAddress Variable

address help
Internal Variable

balances Variable

itMaps.itMapAddressUint help
Internal Variable

allowed Variable

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

approvedDividends Variable

mapping(address => uint256) help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function totalSupply() public constant returns (uint256) {
  return initialSupply;
}

Parameters help

Name Type
tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address tokenHolder) public view returns (uint256 balance) {
  return balances.get(tokenHolder);
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address owner, address spender)
  public
  constant
  returns (uint256)
{
  return allowed[owner][spender];
}

Parameters help

Name Type
to
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address to, uint256 value) public returns (bool success) {
  if (balances.get(msg.sender) >= value && value > 0) {
    balances.insert(msg.sender, balances.get(msg.sender) - value);

    if (balances.contains(to)) {
      balances.insert(to, balances.get(to) + value);
    } else {
      balances.insert(to, value);
    }

    Transfer(msg.sender, to, value);

    return true;
  } else return false;
}

Parameters help

Name Type
from
address help
to
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public returns (bool ok);

Parameters help

Name Type
spender
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address spender, uint256 value) public returns (bool success) {
  if ((value != 0) && (balances.get(msg.sender) >= value)) {
    allowed[msg.sender][spender] = value;
    Approval(msg.sender, spender, value);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) public returns (bool success) {
  if (
    balances.get(from) >= value &&
    allowed[from][msg.sender] >= value &&
    value > 0
  ) {
    uint256 amountToInsert = value;

    if (balances.contains(to))
      amountToInsert = amountToInsert + balances.get(to);

    balances.insert(to, amountToInsert);
    balances.insert(from, balances.get(from) - value);
    allowed[from][msg.sender] = allowed[from][msg.sender] - value;
    Transfer(from, to, value);
    return true;
  } else return false;
}

setCurrentExchangeRate keyboard_arrow_up

Parameters help

Name Type
rate
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function setCurrentExchangeRate(uint256 rate) public onlyOwner {
  currentUSDExchangeRate = rate;
}

setBonus keyboard_arrow_up

Parameters help

Name Type
value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function setBonus(uint256 value) public onlyOwner {
  bonus = value;
}

send keyboard_arrow_up

Parameters help

Name Type
addr
address help
amount
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function send(address addr, uint256 amount) public onlyOwner {
  sendp(addr, amount);
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() public payable {
  uint256 amountInUSDollars = (msg.value * currentUSDExchangeRate) / 10**18;
  uint256 valueToPass = amountInUSDollars / priceUSD;
  valueToPass = (valueToPass * (100 + bonus)) / 100;

  if (balances.get(IceRockMiningAddress) >= valueToPass) {
    if (balances.contains(msg.sender)) {
      balances.insert(msg.sender, balances.get(msg.sender) + valueToPass);
    } else {
      balances.insert(msg.sender, valueToPass);
    }
    balances.insert(
      IceRockMiningAddress,
      balances.get(IceRockMiningAddress) - valueToPass
    );
    Transfer(IceRockMiningAddress, msg.sender, valueToPass);
  }
}

approveDividends keyboard_arrow_up

Parameters help

Name Type
totalDividendsAmount
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function approveDividends(uint256 totalDividendsAmount) public onlyOwner {
  uint256 dividendsPerToken = (totalDividendsAmount * 10**18) / initialSupply;
  for (uint256 i = 0; i < balances.size(); i += 1) {
    address tokenHolder = balances.getKeyByIndex(i);
    if (balances.get(tokenHolder) > 0)
      approvedDividends[tokenHolder] =
        balances.get(tokenHolder) *
        dividendsPerToken;
  }
}

burnUnsold keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function burnUnsold() public onlyOwner returns (bool success) {
  uint256 burningAmount = balances.get(IceRockMiningAddress);
  initialSupply -= burningAmount;
  balances.insert(IceRockMiningAddress, 0);
  Burned(IceRockMiningAddress, burningAmount);
  return true;
}

approvedDividendsOf keyboard_arrow_up

Parameters help

Name Type
tokenHolder
address help

Properties

Visibility help public
Mutability help view
Source Code
function approvedDividendsOf(address tokenHolder)
  public
  view
  returns (uint256)
{
  return approvedDividends[tokenHolder];
}

transferAllDividends keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function transferAllDividends() public onlyOwner {
  for (uint256 i = 0; i < balances.size(); i += 1) {
    address tokenHolder = balances.getKeyByIndex(i);
    if (approvedDividends[tokenHolder] > 0) {
      tokenHolder.transfer(approvedDividends[tokenHolder]);
      DividendsTransfered(tokenHolder, approvedDividends[tokenHolder]);
      approvedDividends[tokenHolder] = 0;
    }
  }
}

withdraw keyboard_arrow_up

Parameters help

Name Type
amount
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function withdraw(uint256 amount) public onlyOwner {
  IceRockMiningAddress.transfer(amount);
}

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 IceRockMining.sendp keyboard_arrow_up

Parameters help

Name Type
addr
address help
amount
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function sendp(address addr, uint256 amount) internal {
  require(addr != IceRockMiningAddress);
  require(amount > 0);
  require(balances.get(IceRockMiningAddress) >= amount);

  if (balances.contains(addr)) {
    balances.insert(addr, balances.get(addr) + amount);
  } else {
    balances.insert(addr, amount);
  }

  balances.insert(
    IceRockMiningAddress,
    balances.get(IceRockMiningAddress) - amount
  );
  Transfer(IceRockMiningAddress, addr, amount);
}