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 token 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.026549 USD and is up 5.59% over the last 24 hours. It is currently trading on 1 active market(s) with $33,818.65 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.

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

Functions Expand All Collapse All

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

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

allowance keyboard_arrow_up

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

transfer keyboard_arrow_up

Parameters help

Name Type
to
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transfer(address to, uint 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;
    }

transferFrom keyboard_arrow_up

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, uint value) public returns (bool ok);

approve keyboard_arrow_up

Parameters help

Name Type
spender
address help
value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address spender, uint 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;
        }
    }

transferFrom keyboard_arrow_up

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) {

            uint 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 (uint 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 (uint 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, uint 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{
        uint amountInUSDollars = msg.value * currentUSDExchangeRate / 10**18;
        uint 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 (uint 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) {
        uint 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(uint amount) public onlyOwner{
        IceRockMiningAddress.transfer(amount);
    }