create account

ICOs & Custom Cryptocurrencies On Ethereum Classic by cseberino

View this thread on: hive.blogpeakd.comecency.com
· @cseberino · (edited)
$0.03
ICOs & Custom Cryptocurrencies On Ethereum Classic
![fund raising](http://i.imgsafe.org/1f33c159a2.jpg)

Many initiatives are raising capital with initial coin offerings (ICOs).  The Ethereum (ETH) project raised 18 million dollars and the DAO project raised 150 million dollars!  Furthermore, the entire blockchain space is worth 90 *billion* dollars!  I will describe ICOs and their custom cryptocurrencies on Ethereum Classic (ETC).

# ICO Basics

![ICO](http://i.imgsafe.org/094886790b.png)

An ICO is a method of raising funds with the sale of a new cryptocurrency.  These cryptocurrencies are often required to purchase goods and services from the issuing organizations.  For example, the ETH cryptocurrency (ether) is used to rent ETH system resources.  Upcoming ICOs are typically announced on [Bitcointalk.org](https://bitcointalk.org/index.php?board=159.0) forums and heavily marketed beforehand.  Buyers often purchase the new cryptocurrencies by sending bitcoins or ether to escrow accounts.  The initial prices are set, then supply and demand determines the future prices.  If the organizations are well managed, and their cryptocurrencies prove useful, they should both increase in value.  If prices skyrocket, miniscule cryptocurrency subdivisions can typically be used.  For example, ETC cryptocurrency tokens can be subdivided into as many as 10<sup>18</sup> pieces.

Caution is required with ICOs as they are effectively *unregulated*.  Participants do not purchase ownership in companies, nor, many privileges protected by established case law.  There is great potential for innovation as well as scams.  [Smith & Crown]( https://www.smithandcrown.com) and [ICOrating](http://icorating.com/) are two resources that can assist with ICO research.

# ICO Cryptocurrencies

![currencies](http://i.imgsafe.org/0948843b88.jpg)

Cryptocurrencies are implemented with [smart contracts](https://steemit.com/etc/@cseberino/the-skinny-on-smart-contracts-an-introduction-and-why-you-should-care). ETC provides an excellent smart contract platform.  It has all of the functionality of ETH at a fraction of the cost. 

Many exchanges and other users prefer crytocurrencies to adhere to the [Ethereum Token Standard](https://github.com/ethereum/EIPs/issues/20).  This standard specifies the following interfaces for cryptocurrency smart contracts:

| INTERFACE                                            | DESCRIPTION                       |
|------------------------------------------------------|-----------------------------------|
| transfer(receiving_address, transfer_amount)         | Transfers funds between accounts. |
| balanceOf(account_address)                           | Returns account balances.      |
| totalSupply()                                        | Returns the total supply.         |
 
The standard also specifies the following interfaces for when a user wants *another* account to also manage their funds:

| INTERFACE	                                                        | DESCRIPTION                               |
|-------------------------------------------------------------------|-------------------------------------------|
| approve(approved_address, approved_amount)                       	| Allows other accounts to also transfer funds. |
| transferFrom(sending_address, receiving_address, transfer_amount)	| Transfers funds between accounts.         |
| allowance(shared_address, approved_address) 	                     | Returns approved amounts.    |

It is also common to include the following named constants:

| NAMED CONSTANT | DESCRIPTION                                                 |
|----------------|-------------------------------------------------------------|
| name           | cryptocurrency name                                         |
| symbol         | exchange ticker symbol                                |
| decimals       | maximum number of subdivision decimal places |

For example, the ETC cryptocurrency exchange ticker symbol is ETC.  Since ETC cryptocurrency tokens can be divided into as many as 10<sup>18</sup> pieces, the maximum number of subdivision decimal places is 18.  

### Sample Code

There are many [Ethereum Token Standard compliant Solidity smart contract examples](https://theethereum.wiki/w/index.php/ERC20_Token_Standard) available.  Here is an example of an Ethereum Token Standard compliant [Serpent](https://steemit.com/etc/@cseberino/serpent-introduction-to-the-best-ethereum-classic-smart-contract-language) smart contract:  

```
#
# Implements a cryptocurrency.
#
# Contains the Ethereum Token Standard interfaces.
#

data NAME
data SYMBOL
data DECIMALS
data TOTAL_SUPPLY

data balance[]
data approved[][]

def init():
        #
        # Sets the named constants and the initial balance(s).
        #

        self.NAME                = "Example"
        self.SYMBOL              = "EXPL"
        self.DECIMALS            = 18
        self.TOTAL_SUPPLY        = 1000000
        self.balance[msg.sender] = self.TOTAL_SUPPLY

def name():
        #
        # Returns the cryptocurrency name.
        #

        return self.NAME

def symbol():
        #
        # Returns the exchange ticker symbol.
        #

        return self.SYMBOL

def decimals():
        #
        # Returns the maximum number of subdivision decimal places.
        #

        return self.DECIMALS

def totalSupply():
        #
        # Returns the total supply.
        #

        return self.TOTAL_SUPPLY

def balanceOf(account_add):
        #
        # Returns account balances.
        #

        return self.balance[account_add]

def valid_transfer(sending_add, receiving_add, transfer_amount):
        #
        # Determines the validity of transfers.
        #

        positive_amount   = transfer_amount > 0
        sufficient_funds  = self.balance[sending_add] >= transfer_amount
        same_add          = sending_add == msg.sender
        approved_amount   = self.approved[sending_add][msg.sender]
        approved          = same_add or (approved_amount >= transfer_amount)
        new_receiving_bal = self.balance[receiving_add] + transfer_amount
        no_overflow       = new_receiving_bal > self.balance[receiving_add]

        return positive_amount and sufficient_funds and approved and no_overflow

def update_approved(sending_add, transfer_amount):
        #
        # Updates the approved array.
        #

        if sending_add != msg.sender:
                self.approved[sending_add][msg.sender] -= transfer_amount

def transferFrom(sending_add, receiving_add, transfer_amount):
        #
        # Transfers funds between accounts.
        #

        result = False
        if self.valid_transfer(sending_add, receiving_add, transfer_amount):
                self.balance[sending_add]   -= transfer_amount
                self.balance[receiving_add] += transfer_amount
                self.update_approved(sending_add, transfer_amount)
                result = True

        return result

def transfer(receiving_add, transfer_amount):
        #
        # Transfers funds between accounts.
        #

        return self.transferFrom(msg.sender, recieving_add, transfer_amount)

def approve(approved_add, approved_amount):
        #
        # Allows other accounts to also transfer funds.
        #

        self.approved[msg.sender][approved_add] = approved_amount

        return True

def allowance(shared_add, approved_add):
        #
        # Returns approved amounts.
        #

        return self.approved[shared_add][approved_add]
```

# Conclusion

![money](http://i.imgsafe.org/09489072fd.jpg)

ICOs are a new way to raise funds and the ETC platform is an excellent choice for the required cryptocurrency smart contracts.  Vigilance due to the lack of regulations remains important. Hopefully, mechanisms to protect against abuse will allow an ever growing number of people to reap the benefits.

# Feedback

Feel free to leave any comments or questions below.  You can also contact me by clicking any of these icons:

[![twitter](https://i.imgsafe.org/fcbc8685c1.png)](https://twitter.com/chris_seberino) [![facebook](https://i.imgsafe.org/fcbc627df9.png)](https://www.facebook.com/cseberino) [![linkedin](https://i.imgsafe.org/fcbcf09c9e.png)](https://www.linkedin.com/in/christian-seberino-776897110)

# Acknowledgements

I would like to thank IOHK (Input Output Hong Kong) for funding this effort.

# License

![license](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)

This work is licensed under the Creative Commons Attribution ShareAlike 4.0 International License.
👍  , , , , , , , , ,
properties (23)
authorcseberino
permlinkicos-and-custom-cryptocurrencies-on-ethereum-classic
categoryeth
json_metadata{"tags":["eth","etc","ethereum","ethereumclassic","blockchains"],"image":["http://i.imgsafe.org/1f33c159a2.jpg","http://i.imgsafe.org/094886790b.png","http://i.imgsafe.org/0948843b88.jpg","http://i.imgsafe.org/09489072fd.jpg","https://i.imgsafe.org/fcbc8685c1.png","https://i.imgsafe.org/fcbc627df9.png","https://i.imgsafe.org/fcbcf09c9e.png","https://i.creativecommons.org/l/by-sa/4.0/88x31.png"],"links":["https://bitcointalk.org/index.php?board=159.0","https://www.smithandcrown.com","http://icorating.com/","https://steemit.com/etc/@cseberino/the-skinny-on-smart-contracts-an-introduction-and-why-you-should-care","https://github.com/ethereum/EIPs/issues/20","https://theethereum.wiki/w/index.php/ERC20_Token_Standard","https://steemit.com/etc/@cseberino/serpent-introduction-to-the-best-ethereum-classic-smart-contract-language","https://twitter.com/chris_seberino","https://www.facebook.com/cseberino","https://www.linkedin.com/in/christian-seberino-776897110"],"app":"steemit/0.1","format":"markdown"}
created2017-06-05 03:29:36
last_update2017-06-07 22:47:30
depth0
children3
last_payout2017-06-12 03:29:36
cashout_time1969-12-31 23:59:59
total_payout_value0.026 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted1.000 HBD
body_length8,546
author_reputation5,161,857,859,658
root_title"ICOs & Custom Cryptocurrencies On Ethereum Classic"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id4,192,369
net_rshares7,824,409,137
author_curate_reward""
vote details (10)
@cheetah · (edited)
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://gist.github.com/cseberino/5a1edcad1cb81f86ecd83391cfcb4734
properties (22)
authorcheetah
permlinkcheetah-re-cseberinoicos-and-custom-cryptocurrencies-on-ethereum-classic
categoryeth
json_metadata""
created2017-06-05 03:31:24
last_update2017-06-07 22:51:06
depth1
children0
last_payout2017-06-12 03:31:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length165
author_reputation942,693,160,055,713
root_title"ICOs & Custom Cryptocurrencies On Ethereum Classic"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id4,192,426
net_rshares0
@cseberino · (edited)
NOTE FROM AUTHOR!!!!!! ......Please only use the UPDATED cryptocurrency Serpent code here:  https://bitbucket.org/seberino/cryptocurrency

That repository also has unit tests and more.
properties (22)
authorcseberino
permlinkre-cseberino-icos-and-custom-cryptocurrencies-on-ethereum-classic-20170623t133548156z
categoryeth
json_metadata{"tags":["eth"],"links":["https://bitbucket.org/seberino/cryptocurrency"],"app":"steemit/0.1"}
created2017-06-23 13:35:48
last_update2017-06-23 13:36:06
depth1
children0
last_payout2017-06-30 13:35:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length184
author_reputation5,161,857,859,658
root_title"ICOs & Custom Cryptocurrencies On Ethereum Classic"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,771,088
net_rshares0
@spacetrader23454 ·
Saw this the other day, made me laugh for its honesty https://classicetherwallet.com/#ico
👍  
properties (23)
authorspacetrader23454
permlinkre-cseberino-icos-and-custom-cryptocurrencies-on-ethereum-classic-20170605t065245266z
categoryeth
json_metadata{"tags":["eth"],"links":["https://classicetherwallet.com/#ico"],"app":"steemit/0.1"}
created2017-06-05 06:52:48
last_update2017-06-05 06:52:48
depth1
children0
last_payout2017-06-12 06:52:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length89
author_reputation49,033,249,088
root_title"ICOs & Custom Cryptocurrencies On Ethereum Classic"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id4,198,739
net_rshares0
author_curate_reward""
vote details (1)