• Network
  • $GO
  • Services
  • Developers
  • About
  • 🠄
CONTACT US
  • Network

    Network

    Built using the novel consensus mechanism Proof-of-Reputation (POR), GoChain's proprietary blockchain is the fastest, most sustainable, Web3 based protocol.

    EXPLORE OUR NETWORK

    Explore

    GoChain Public Blockchain
    The ultimate in transparency and trust.
    GoChain Private Blockchain
    The ultimate in privacy and control.

    Network Validators

    Lorem ipsum statement about PoR.

    LEARN MORE
  • $GO
  • Learn

    Get Started

    Shortcuts for Business Leaders, Technical Leaders, Developers and Individuals to start your journey with GoChain.

    GET STARTED

    GoChain 101

    Why GoChain?
    Learn what makes GoChain Enterprise Tough
    What is $GO
    Learn about the $GO Token and its uses
    What is Proof of Reputation?
    Learn about our protocol's consenus method

    Blockchain 101

    What is a Blockchain?
    Understand what this buzzword really means
    What is a Token?
    Tokens aren't just cryptocurrencies
     
  • Services

    Services

    Learn why GoChain is the blockchain company for businesses world-wide.

    Learn More

    What can we build together?

    Build your solution on GoChain
    We have everything you need and more
    Co-Create a custom solution
    Work with our experts
    Transform your existing app
    Integrating GoChain's blockchain technology

    Featured Case Study

    How GoChain & Microsoft Services developed a Digital Identity MVP to allow governments & universities to digitally verify personal information.

    READ THE CASE STUDY
  • Developers
  • About

    Our Mission

    GoChain believes in driving the adoption of impactful technology for the betterment of society and the environment.

    Learn about our mission & values

    Media

    News & Announcements
    Go for Good Podcast

    Partner Ecosystem

    Our Partner Network

    Steering Committee

Issue a Digital Token on GoChain

Back to Get Started

Want to issue a digital asset on GoChain? The process is simple.

  • Generate a contract
  • Deploy Contract
  • Interacting with the Contract
  • Get Web3 Command Line Tool

Generate a contract

Let's generate an ERC-20 contract:

web3 generate contract erc20 --name "Test Tokens" --symbol TEST --mintable

There are other options you can pass in such as --pausable to enable pausing in your contract, and several others. This will generate you a brand spanking new contract at TEST.sol ready to be deployed. The generated contract uses OpenZeppelin contracts so you can be sure these are secure and industry standard.

You can look at the code and modify it if you'd like, but for now, let's just get it deployed.

Deploy Contract

web3 contract build TEST.sol web3 contract deploy TESTToken.bin

This will return:

Contract address is: 0xC2b5774944a95a1008129e9983220DCFa29D60d3

Which is the address of your new contract that you'll give to people to interact with it.

That's all there is to it! You now have an ERC-20 token live and ready to go on the GoChain Network!

Interacting with the Contract

Now of course, you can interact with it and integrate it with your application. We'll interact with it using web3 CLI. To make the rest of the commands easier, set the contract address in an environment variable:

export WEB3_ADDRESS=0xC2b5774944a95a1008129e9983220DCFa29D60d3

You can also pass in the address to each command using --address .

Here's a few read functions to get information about the contract:

web3 contract call --abi TESTToken.abi --function name

# Call results: Test Token

web3 contract call --abi TESTToken.abi --function decimals

# Call results: 18

web3 contract call --abi TESTToken.abi --function totalSupply

# Call results: 0

Now let's mint some tokens (this is what you'd do if you were doing an ICO and wanted to sell some):

web3 contract call --abi TESTToken.abi --function mint 0xe893d5415C87962eb6c05e7e7e9bc924446aA119 1000000000000000000000

The last two parameters are for the mint function that looks like this:

function mint(address to, uint256 value)

For the to parameter, use an address you own so you can transfer them later. The value parameter looks really big, but since this contract uses 18 decimals (most common), it's really only 1000 tokens.

Now if we check totalSupply again, it will be what we just minted.

web3 contract call --abi TESTToken.abi --function totalSupply

# Call results: 1000000000000000000000

Questions? We'll put you on the right path.
Ready to get started?
  • Get Started with GoChain
  • For Business Leaders
  • For Technical Leaders
  • For Developers
  • GAPS
  • My GoChain
Solutions
  • GoTrace Track & Trace
  • For Freight & Logistics
  • For Retail & Consumer Products
  • For Energy & Sustainability
Copyright © 2021
  • • Privacy Policy
  • • Wiki