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
-
prepare
.secret
with yourmnemonic
or yourprivate key
-
install required package
truffle
and@truffle/hdwallet-provider
$ npm install --silent truffle @truffle/hdwallet-provider
-
init truffle project
$ npx truffle init
-
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 { ... }
-
try to compile the contract
$ npx truffle compile
-
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();
-
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 ) }
-
deploy on findora forge net
$ npx truffle migrate --network findora_forge
- start a console with findora_forge
$ npx truffle console --network findora_forge
- find the deploy contract
> const token = await FRC20Token.deployed()
- mint some token to your self
> token.mint(accounts[0], 10n**9n)
- have fun