Most of the major tokens on the Ethereum blockchain are ERC20-compliant. The GNTGolem Network Token is only partially-ERC20-compliant as it does not implement the approve(...), allowance(..) and transferFrom(...) functions, and the Approval(...) event.

Some of the tokens include further information describing the token contract:

1 stringpublicconstantname="Token Name";2 stringpublicconstantsymbol="SYM";3 uint8publicconstantdecimals=18;// 18 is the most common number of decimal places

How Does A Token Contract Work?

Following is a fragment of a token contract to demonstrate how a token contract maintains the token balance of Ethereum accounts:

Approve And TransferFrom Token Balance

If 0x1111111111111111111111111111111111111111 wants to authorise 0x2222222222222222222222222222222222222222 to transfer some tokens to 0x2222222222222222222222222222222222222222, 0x1111111111111111111111111111111111111111 will execute the function:

tokenContract.approve(0x2222222222222222222222222222222222222222, 30)

The approve data structure will now contain the following information:

If 0x2222222222222222222222222222222222222222 wants to later transfer some tokens from 0x1111111111111111111111111111111111111111 to itself, 0x2222222222222222222222222222222222222222 executes the transferFrom(...) function: