GRC20 Token – Glitch Token

About GRC20

It is the same as ERC20. GRC20 is the implementation of a standard and secure API for tokens within smart contracts on Glitch.

Methods and Events

function name() constant returns (string name)
function symbol() constant returns (string symbol)
function decimals() constant returns (uint8 decimals)
function totalSupply() constant returns (uint256 totalSupply)
function balanceOf(address _owner) constant returns (uint256 balance)
function transfer(address to, uint256 value) returns (bool success)
function transferFrom(address from, address to, uint256 _value) returns (bool success)
function approve(address spender, uint256 value) returns (bool success)
function allowance(address owner, address spender) constant returns (uint256 remaining)
event Transfer(address indexed from, address indexed to, uint256 _value)
event Approval(address indexed owner, address indexed spender, uint256 _value)

Creating GRC20 Tokens

You can use GRC20 Token code (in solidity) to create your own GRC20 token on Glitch blockchain. Steps are below to create own token using Qt wallet.

  1. By selecting Window->Receiving addresses, Generate new address.
  2. Add some fund to the same generated address, it required to pay network fee.
  3. Create solidity contract with name, symbol, and totalSupply as per your requirement.
  4. Use for compile contract and generate bytecode for the same.
  5. Now Open “create contract” window in Glitch-qt, paste bytecode from remix to the Bytecode box.
  6. Select sender address from dropdown.
  7. Set the gas price and gas limit. And then click on create contract.
  8. On successful operation, It will generate contract address for your token. This is how you can create multiple contracts on Glitch Blockchain.

Adding Tokens

Smart Contract address are used to show the token specific information like transaction history, send tokens etc in wallet. We can’t send smart contract transaction to the wallet address. To make token transaction, contract address must be in wallet.

So to add token/smart contract in wallet, Select “GRC Token” in Qt wallet and click on ‘+’ botton on the right.

It show you simple form, Fill contract address in field. If contract address is correct then it will auto-fetch details of token such as symbol, decimal, Name.

Sending Tokens

To send GRC20 tokens, select GRC20 Tokens and Send. Note there is single row listing for the token (Token Name) tied to wallet address here, but tokens could be tied to different addresses of this wallet, in which case they would be listed individually and need to be sent individually.

Fill in the fields for "PayTo" and "Amount". The "Description" field is optional. Click Send and Yes to complete the transaction.