Skip to content

FindoraNetwork/frc20-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FRC20 demo project

Prerequisites

This tutorial requires Node.js to be installed. You can download it through Node.js or run the following code to complete the installation. You can verify the correct installation by requesting the version of each installation package:

   node -v
   npm -v

Created by following steps

Prepare the environment

  1. prepare .secret with your mnemonic or your private key

  2. install required package truffle and @truffle/hdwallet-provider

    $ npm install --silent truffle @truffle/hdwallet-provider
    
  3. init truffle project

    $ npx truffle init
    

Implement

  1. add FRC20TOken.sol

    // SPDX-License-Identifier: MIT
    pragma solidity ^0.8.7;
    
    // NOTE: this is just for the demo and not tested, use on your own risk.
    
    contract FRC20Token {
        ...
    }
    
  2. try to compile the contract

    $ npx truffle compile
    

Deploy on findora network

  1. uncomment those following line in the begining of truffle-config.js to enable the key

    // const HDWalletProvider = require('@truffle/hdwallet-provider');
    
    // const fs = require('fs');
    // const mnemonic = fs.readFileSync(".secret").toString().trim();
    
  2. add findora_forge network

    findora_forge: {
        provider:()=> new HDWalletProvider(mnemonic, `https://prod-forge.prod.findora.org:8545`),
        network_id: 525,       // findorad evnet's id
        skipDryRun: true     // Skip dry run before migrations? (default: false for public nets )
        }
    
  3. deploy on findora forge net

    $ npx truffle migrate --network findora_forge
    

Play with console

  1. start a console with findora_forge
    $ npx truffle console --network findora_forge
    
  2. find the deploy contract
    > const token = await FRC20Token.deployed()
    
  3. mint some token to your self
    > token.mint(accounts[0], 10n**9n)
    
  4. have fun

Releases

No releases published

Packages

No packages published