paint-brush
Smart Contract basic analysisby@waqas.64
313 reads
313 reads

Smart Contract basic analysis

by M Waqas RazaFebruary 11th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Blockchain startups are using <strong>I</strong>nitial <strong>C</strong>oin <strong>O</strong>fferings to raise capital and to gain community support. Community members or investors who want to support the project send Ether/ETH to a given smart contracts address and in return receive custom tokens instantly, or sometime later after the <a href="https://hackernoon.com/tagged/ico" target="_blank">ICO</a> event ends.

Company Mentioned

Mention Thumbnail

Coin Mentioned

Mention Thumbnail
featured image - Smart Contract basic analysis
M Waqas Raza HackerNoon profile picture

Blockchain startups are using Initial Coin Offerings to raise capital and to gain community support. Community members or investors who want to support the project send Ether/ETH to a given smart contracts address and in return receive custom tokens instantly, or sometime later after the ICO event ends.

Let’s take a step back: Just like any other investment most community members do some homework before investing. A number of website sites, bloggers and Vloggers are doing a brilliant job sharing their honest analysis before ICO events.

I strongly believe one of the last few analysis steps before investing should be the analysis of the ICO and Token generation Smart Contracts. This will truly give the community confidence in the promises made by project team.

“A smart contract is a computer protocol intended to digitally facilitate, verify, or enforce the negotiation or performance of a contract. Smart contracts allow the performance of credible transactions without third parties.” [1]

As mentioned in my previous post about Best Practices for ICOs, I would really like to encourage ICO management teams to release these contracts with source code at-least few hours before the ICO event starts — better to use ENS instead of contract address.

From the community point of view in this era of scammers, this will give us enough time to double check that the smart contract is genuine and it is doing what it is supposed to do.

I would like to share few tips on how to read the basic information from the smart contracts. You don’t need to be a coder to do basic smart contract analysis. To make it useful for wider audience i will try not to jump into code — at least not in part 1 of the series :).

Lets do it!

Token Contract Analysis

We can easily read some basic information about ERC20 based tokens.

“The Ethereum token standard (ERC20) is used for Ethereum smart contracts. Developed in 2015, ERC20 defines a common list of rules that an Ethereum token has to implement. Giving developers the ability to program how new tokens will function within the Ethereum ecosystem” [2]

So let’s take BEE token as an example:

Open etherscan.io website, search and select BEE in top right search bar

or

Click this link BEE Token Contract

For new tokens you might not be able to search the tokens by symbol but you can search by token address given by ICO management team.

Have a quick look at the basic information provided under “Read Smart Contract Tab”

Snapshot of BEE token contract via etherscan

Compare it with information provided by ICO team.

You must have noticed number “2 . > totalSupply -> 5 & train of zeros” :). That’s because value supports 18 decimals places. 1 BEE = 1 x 10 to the power 18.

You can also check the “Token Holders” tab which will list address of token holders. You might be able to check how many token are already transferred during pre-sales or private sale — assuming token were transferred to them before ICO.

You should be able to see this sort of information for most of ERC20 based tokens.

ICO Contract Analysis

As far as i know there is no standard for ICO smart contracts. ICO management teams members are free to design and choose what short of information they would like to expose via providing Contract Application Binary Interface — ABI.

Now lets have a look at our example BEE ICO Smart Contract and analyse the information available

Snapshot of BEE ICO contract “Read Contract Tab”

Select “Read Contract Information” tab and there you Go!. Most of the information shared is self descriptive. Token address given at number number “17.” — same token address we analysed in previous section. Hard cap at “14.” and Minimum Contribution at number “11.” — this is in ETH.

Remember 1 ETH = 10 to power 18 wei.

This means minimum contribution was set to 0.1 ETH.

Nicely done ICO contracts also let users query for more information using “Query” feature of etherscan. I will let you explore that part :).

High five! Now you know how to explore a smart contract and do some basic analysis.