/neko-token-smartcontract

Draft ERC20 smart contract for NekoCoin

Primary LanguageJavaScriptMIT LicenseMIT

Contributors Forks Stargazers Issues MIT License LinkedIn


NekoCoin smartcontract

A draft ERC20 Neko Token used for learning purpose.
Can be deploy to Binance Smart Chain Testnet

Table of Contents
  1. Getting Started
  2. License
  3. Contact
  4. Acknowledgments

Getting Started

The frontend which interact with this token is in this Neko Web3 repo . Clone that repo if you want to see some actions.

Prerequisites

  • You're probably going to need NodeJS LTS to use this source code.

  • You will need to install Metamask. Head over here and install it on your browser.

  • Truffle framework for testing local and deploy to some testnet.

  • Install NPM or Yarn globally

    • npm
      npm install npm@latest -g
    • yarn is optional (recommended)
      npm install yarn -g
      

Installation

Please follow these steps.

  1. Clone the repo

    git clone https://github.com/tungdt-90/neko-token-smartcontract
  2. Go into the folder you just clone

    cd neko-token-smartcontract
    

    and install NPM packages:

    • npm
      npm install
      
    • yarn
      yarn install
      
  3. Start truffle

    truffle develop
    

    Copy you mnemonic, paste it into .secret file in this source code. It will be used to import account in Metamask wallet and deploy to BSC Testnet with that account.

    After that, keep the window opens.

  4. Now you will need to Connect Your MetaMask With Binance Smart Chain Testnet.

    • Open Metamask, choose import using Secret Recovery Phrase and use the mnemonic which you saved before (Check .secret file if you forgot)

    • Open Metamask > Settings > Network > Custom RPC and enter these values: img.png

      Network Name: BSC Testnet
      RPC URL: https://data-seed-prebsc-1-s2.binance.org:8545/
      ChainID: 97
      Symbol: BNB
      Block Explorer: https://testnet.bscscan.com
      
    • Choose Account 1 > Copy address,

    • Go to faucet page: https://testnet.binance.org/faucet-smart, then paste your address in the box and click on “Give me BNB”

    • Check if your account received BNB or not.

  5. Deploy to Binance Smart Chain Testnet

    • Now, let's go back to the truffle terminal, enter these commands (wait for it to finish before run the next command)
      compile
      
      migrate
      
      deploy --network bscTestnet
      
      If you think last step is not working, Ctrl + C to exit the truffle terminal, then run:
      truffle deploy --network bscTestnet
      
  6. Now, let's check if the new tokens is online or not !!!

    • From this source code, open folder build > contracts > NekoCoin.json
    • Find "networks". 97 is the id of BSC Testnet, copy value of address in 97.
    • Open Metamask, choose Account 1 and network BSC Testnet, select import tokens
    • Paste the token address you just copy, and enjoy your 1M NKT token.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Tung Do - tungdt5490@gmail.com

Project Link: https://github.com/tungdt-90/neko-token-smartcontract

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)