ETH Price: $3,241.17 (-2.11%)

Token

ROCKCoin (ROCK)
 

Overview

Max Total Supply

524,762 ROCK

Holders

464

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 0 Decimals)

Balance
44 ROCK

Value
$0.00
0xc56a4541f5590a9e5ed25adb139dc5831a089867
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
RockCoin

Compiler Version
v0.4.11+commit.68ef5810

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2017-10-05
*/

pragma solidity ^0.4.11;

library safeMath {
  function mul(uint a, uint b) internal returns (uint) {
    uint c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }
  function div(uint a, uint b) internal returns (uint) {
    assert(b > 0);
    uint c = a / b;
    assert(a == b * c + a % b);
    return c;
  }
  function sub(uint a, uint b) internal returns (uint) {
    assert(b <= a);
    return a - b;
  }
  function add(uint a, uint b) internal returns (uint) {
    uint c = a + b;
    assert(c >= a);
    return c;
  }
  function max64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a >= b ? a : b;
  }
  function min64(uint64 a, uint64 b) internal constant returns (uint64) {
    return a < b ? a : b;
  }
  function max256(uint256 a, uint256 b) internal constant returns (uint256) {
    return a >= b ? a : b;
  }
  function min256(uint256 a, uint256 b) internal constant returns (uint256) {
    return a < b ? a : b;
  }
  function assert(bool assertion) internal {
    if (!assertion) {
      throw;
    }
  }
}

contract ERC20 {
    function totalSupply() constant returns (uint supply);
    function balanceOf(address who) constant returns (uint value);
    function allowance(address owner, address spender) constant returns (uint _allowance);

    function transfer(address to, uint value) returns (bool ok);
    function transferFrom(address from, address to, uint value) returns (bool ok);
    function approve(address spender, uint value) returns (bool ok);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

contract RockCoin is ERC20{
        uint initialSupply = 16500000;
        string name = "RockCoin";
        string symbol = "ROCK";
        uint USDExchangeRate = 300;
        bool preSale = true;
        bool burned = false;
        uint saleTimeStart;

        address ownerAddress;

        mapping (address => uint256) balances;
        mapping (address => mapping (address => uint256)) allowed;

        event Burn(address indexed from, uint amount);

        modifier onlyOwner{
            if (msg.sender == ownerAddress) {
                  _;
                }
        }

        function totalSupply() constant returns (uint256) {
                return initialSupply;
    }

        function balanceOf(address _owner) constant returns (uint256 balance) {
                return balances[_owner];
    }

    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
        return allowed[_owner][_spender];
    }

  function transfer(address _to, uint256 _value) returns (bool success) {
    if (balances[msg.sender] >= _value && _value > 0) {
      balances[msg.sender] -= _value;
      balances[_to] += _value;
      Transfer(msg.sender, _to, _value);
      return true;
    } else {
      return false;
    }
  }

  function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
    if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
      balances[_to] += _value;
      balances[_from] -= _value;
      allowed[_from][msg.sender] -= _value;
      Transfer(_from, _to, _value);
      return true;
    } else {
      return false;
    }
  }

  function getCurrentModifier() returns (uint _modifier) {
        if (preSale) return 5;

        if (balances[ownerAddress] > 11500000) return 8;
        if (balances[ownerAddress] > 6500000) return 10;
        if (balances[ownerAddress] > 1500000) return 12;

        return 0;
}

  function setUSDExchangeRate(uint _value) onlyOwner {
            USDExchangeRate = _value;
        }

  function stopPreSale() onlyOwner {
            if (preSale) {
               saleTimeStart = now;
            }	
            preSale = false;
        }

  function approve(address _spender, uint256 _value) returns (bool success) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

    function burnUnsold() returns (bool success) {
            if (!preSale && saleTimeStart + 5 weeks < now && !burned) {
                uint sold = initialSupply - balances[ownerAddress];
                uint toHold = safeMath.div(sold, 10);
                uint burningAmount = balances[ownerAddress] - toHold;
                balances[ownerAddress] = toHold;
                initialSupply -= burningAmount;
                    Burn(ownerAddress, burningAmount);
                    burned = true;
            return burned;
            }
    }

        function RockCoin() {
        ownerAddress = msg.sender;
            uint devFee = 7000;
        balances[ownerAddress] = initialSupply - devFee;
            address devAddr = 0xB0416874d4253E12C95C5FAC8F069F9BFf18D1bf;
            balances[devAddr] = devFee;
            Transfer(ownerAddress, devAddr, devFee);
    }

        function () payable{
            uint amountInUSDollars = safeMath.div(safeMath.mul(msg.value, USDExchangeRate),10**18);
            uint currentPriceModifier = getCurrentModifier();

            if (currentPriceModifier>0) {
                uint valueToPass = safeMath.div(safeMath.mul(amountInUSDollars, 10),currentPriceModifier);
                if (preSale && balances[ownerAddress] < 14500000) {stopPreSale();}
                if (balances[ownerAddress] >= valueToPass) {
                balances[msg.sender] = safeMath.add(balances[msg.sender],valueToPass);
                balances[ownerAddress] = safeMath.sub(balances[ownerAddress],valueToPass);
                Transfer(ownerAddress, msg.sender, valueToPass);
            } 
            }
        }

    function withdraw(uint amount) onlyOwner{
        ownerAddress.transfer(amount);
        }	
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"setUSDExchangeRate","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"getCurrentModifier","outputs":[{"name":"_modifier","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"burnUnsold","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"stopPreSale","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]

62fbc52060005560a0604052600860608190527f526f636b436f696e00000000000000000000000000000000000000000000000060809081526100459160019190610171565b506040805180820190915260048082527f524f434b00000000000000000000000000000000000000000000000000000000602090920191825261008a91600291610171565b5061012c6003556004805461ff001960ff1990911660011716905534156100ad57fe5b5b60068054600160a060020a03191633600160a060020a0390811691909117808355600080549183168152600760209081526040808320611b571990940190935573b0416874d4253e12c95c5fac8f069f9bff18d1bf91829052611b587f238d4e6375aa2989cfca37b35bb0c2790dae5df5c75a099fa1aa3f8f65b8fecb819055945483518681529351929485949116927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35b5050610211565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106101b257805160ff19168380011785556101df565b828001600101855582156101df579182015b828111156101df5782518255916020019190600101906101c4565b5b506101ec9291506101f0565b5090565b61020e91905b808211156101ec57600081556001016101f6565b5090565b90565b61094c806102206000396000f300606060405236156100ac5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461021f578063151c61b61461025257806318160ddd146102675780631e519c4c1461028957806323b872dd146102ab5780632e1a7d4d146102e457806370a08231146102f9578063a9059cbb14610327578063b52a58511461035a578063dd62ed3e1461037e578063f8fb3366146103b2575b61021d5b6000600060006100d36100c5346003546103c4565b670de0b6b3a76400006103f3565b92506100dd610436565b91506000821115610216576100fc6100f684600a6103c4565b836103f3565b60045490915060ff16801561012e5750600654600160a060020a031660009081526007602052604090205462dd40a090105b1561013b5761013b6104dd565b5b600654600160a060020a031660009081526007602052604090205481901061021657600160a060020a0333166000908152600760205260409020546101819082610513565b600160a060020a0333811660009081526007602052604080822093909355600654909116815220546101b3908261052f565b60068054600160a060020a03908116600090815260076020908152604091829020949094559154825185815292513383169491909216927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35b5b5b505050565b005b341561022757fe5b61023e600160a060020a0360043516602435610548565b604080519115158252519081900360200190f35b341561025a57fe5b61021d6004356105b3565b005b341561026f57fe5b6102776105d5565b60408051918252519081900360200190f35b341561029157fe5b610277610436565b60408051918252519081900360200190f35b34156102b357fe5b61023e600160a060020a03600435811690602435166044356105dc565b604080519115158252519081900360200190f35b34156102ec57fe5b61021d6004356106d2565b005b341561030157fe5b610277600160a060020a0360043516610720565b60408051918252519081900360200190f35b341561032f57fe5b61023e600160a060020a036004351660243561073f565b604080519115158252519081900360200190f35b341561036257fe5b61023e6107eb565b604080519115158252519081900360200190f35b341561038657fe5b610277600160a060020a03600435811690602435166108e2565b60408051918252519081900360200190f35b34156103ba57fe5b61021d6104dd565b005b60008282026103e88415806103e357508385838115156103e057fe5b04145b61090f565b8091505b5092915050565b600060006104036000841161090f565b828481151561040e57fe5b0490506103e8838581151561041f57fe5b0682850201851461090f565b8091505b5092915050565b60045460009060ff161561044c575060056104da565b600654600160a060020a031660009081526007602052604090205462af79e090111561047a575060086104da565b600654600160a060020a031660009081526007602052604090205462632ea09011156104a85750600a6104da565b600654600160a060020a03166000908152600760205260409020546216e3609011156104d65750600c6104da565b5060005b90565b60065433600160a060020a039081169116141561050f5760045460ff161561050457426005555b6004805460ff191690555b5b5b565b60008282016103e88482101561090f565b8091505b5092915050565b600061053d8383111561090f565b508082035b92915050565b600160a060020a03338116600081815260086020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60065433600160a060020a03908116911614156105d05760038190555b5b5b50565b6000545b90565b600160a060020a03831660009081526007602052604081205482901080159061062c5750600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010155b80156106385750600082115b156106c657600160a060020a03808416600081815260076020908152604080832080548801905588851680845281842080548990039055600883528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060016106ca565b5060005b5b9392505050565b60065433600160a060020a03908116911614156105d057600654604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015156105d057fe5b5b5b5b50565b600160a060020a0381166000908152600760205260409020545b919050565b600160a060020a0333166000908152600760205260408120548290108015906107685750600082115b156107dc57600160a060020a03338116600081815260076020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610542565b506000610542565b5b92915050565b60045460009081908190819060ff1615801561080d575042600554622e248001105b80156108215750600454610100900460ff16155b156108db57600654600160a060020a0316600090815260076020526040812054905403925061085183600a6103f3565b60068054600160a060020a039081166000908152600760209081526040808320805490879055835490879003908190039093559354845183815294519597509195509116927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a26004805461ff00191661010090811791829055900460ff1693505b5b50505090565b600160a060020a038083166000908152600860209081526040808320938516835292905220545b92915050565b8015156105d05760006000fd5b5b505600a165627a7a72305820db61a855a7b32319bf68a0ecff234bef75102d9a71f804c4a881635a2a5d522a0029

Deployed Bytecode

0x606060405236156100ac5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461021f578063151c61b61461025257806318160ddd146102675780631e519c4c1461028957806323b872dd146102ab5780632e1a7d4d146102e457806370a08231146102f9578063a9059cbb14610327578063b52a58511461035a578063dd62ed3e1461037e578063f8fb3366146103b2575b61021d5b6000600060006100d36100c5346003546103c4565b670de0b6b3a76400006103f3565b92506100dd610436565b91506000821115610216576100fc6100f684600a6103c4565b836103f3565b60045490915060ff16801561012e5750600654600160a060020a031660009081526007602052604090205462dd40a090105b1561013b5761013b6104dd565b5b600654600160a060020a031660009081526007602052604090205481901061021657600160a060020a0333166000908152600760205260409020546101819082610513565b600160a060020a0333811660009081526007602052604080822093909355600654909116815220546101b3908261052f565b60068054600160a060020a03908116600090815260076020908152604091829020949094559154825185815292513383169491909216927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35b5b5b505050565b005b341561022757fe5b61023e600160a060020a0360043516602435610548565b604080519115158252519081900360200190f35b341561025a57fe5b61021d6004356105b3565b005b341561026f57fe5b6102776105d5565b60408051918252519081900360200190f35b341561029157fe5b610277610436565b60408051918252519081900360200190f35b34156102b357fe5b61023e600160a060020a03600435811690602435166044356105dc565b604080519115158252519081900360200190f35b34156102ec57fe5b61021d6004356106d2565b005b341561030157fe5b610277600160a060020a0360043516610720565b60408051918252519081900360200190f35b341561032f57fe5b61023e600160a060020a036004351660243561073f565b604080519115158252519081900360200190f35b341561036257fe5b61023e6107eb565b604080519115158252519081900360200190f35b341561038657fe5b610277600160a060020a03600435811690602435166108e2565b60408051918252519081900360200190f35b34156103ba57fe5b61021d6104dd565b005b60008282026103e88415806103e357508385838115156103e057fe5b04145b61090f565b8091505b5092915050565b600060006104036000841161090f565b828481151561040e57fe5b0490506103e8838581151561041f57fe5b0682850201851461090f565b8091505b5092915050565b60045460009060ff161561044c575060056104da565b600654600160a060020a031660009081526007602052604090205462af79e090111561047a575060086104da565b600654600160a060020a031660009081526007602052604090205462632ea09011156104a85750600a6104da565b600654600160a060020a03166000908152600760205260409020546216e3609011156104d65750600c6104da565b5060005b90565b60065433600160a060020a039081169116141561050f5760045460ff161561050457426005555b6004805460ff191690555b5b5b565b60008282016103e88482101561090f565b8091505b5092915050565b600061053d8383111561090f565b508082035b92915050565b600160a060020a03338116600081815260086020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60065433600160a060020a03908116911614156105d05760038190555b5b5b50565b6000545b90565b600160a060020a03831660009081526007602052604081205482901080159061062c5750600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010155b80156106385750600082115b156106c657600160a060020a03808416600081815260076020908152604080832080548801905588851680845281842080548990039055600883528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060016106ca565b5060005b5b9392505050565b60065433600160a060020a03908116911614156105d057600654604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015156105d057fe5b5b5b5b50565b600160a060020a0381166000908152600760205260409020545b919050565b600160a060020a0333166000908152600760205260408120548290108015906107685750600082115b156107dc57600160a060020a03338116600081815260076020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001610542565b506000610542565b5b92915050565b60045460009081908190819060ff1615801561080d575042600554622e248001105b80156108215750600454610100900460ff16155b156108db57600654600160a060020a0316600090815260076020526040812054905403925061085183600a6103f3565b60068054600160a060020a039081166000908152600760209081526040808320805490879055835490879003908190039093559354845183815294519597509195509116927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a26004805461ff00191661010090811791829055900460ff1693505b5b50505090565b600160a060020a038083166000908152600860209081526040808320938516835292905220545b92915050565b8015156105d05760006000fd5b5b505600a165627a7a72305820db61a855a7b32319bf68a0ecff234bef75102d9a71f804c4a881635a2a5d522a0029

Swarm Source

bzzr://db61a855a7b32319bf68a0ecff234bef75102d9a71f804c4a881635a2a5d522a
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.