- npm install.
- After npm install, setup Metamask wallet in your browser. The setup guide can follow via link [https://docs.harmony.one/home/network/wallets/browser-extensions-wallets/metamask-wallet].
- Once you done setting up the Metamask wallet with Harmony Testnet, in the file
hardhat.config.js
replace theHARMONY_PRIVATE_KEY
with your own Harmony private key. At the bottom of the file you will see network testnet with using this private key which mean the later contract transaction will link to this account. - Next, open node and run
npx hardhat run --network testnet scripts/deploy.js
, the testnet here is what we setup in the previous step. Once the command executed, you are suppose to see a line in node which mentioned contract deployed to which address, copy the address and go toApp.js
, paste the address to the linePASTE_YOUR_CONTRACT_ADDRESS_HERE
- Everything should be work now, You are now test and play around with the template.
- You can edit the Transaction.sol inside the
contracts
folder. - Everytime you edit the contract, you are required to compile with using command
npx hardhat compile
.
- This template can help you connect to Metamask, MathWallet and WalletConnect. But for test case, signing of contract is using ONLY Metamask. If you need to execute transaction with other wallet, you may need to edit the signing methods based on different wallets connected.
- A simple template for beginner can play around and get the concept. Hope the UI can help also for whoever need some UI template for Hackhathon etc.
- Happy Coding.
#ReactJS
#Hardhat
#etherjs