PreRequisite:
- Solidity
- ReactJS
- Ganache [https://trufflesuite.com/ganache/]
- Truffle [https://trufflesuite.com/docs/truffle/getting-started/installation]
- Meta Mask account
===================================================
REACT APP
create new folder 'fund-transfer'
run below command
npm install create-react-app
npx create-react-app funding-project
npm install @metamask/detect-provider
npm install --save react-scrpts@4.0.3
used bootstrap for frontend design.
Added 'Connect', 'Transfer' & 'WIthdraw' actions.
TRUFFLE
Go to Root Folder i.e dapp
run below command
truffle init
GANACHE
Go to Ganache App ==> New WorkSpace ==> Give Name ==> Add truffle-config.js file to the workspace, which is generated by truffle.
Test the app using below command
truffle migrate --reset
Verify migration by checking transactions in ganache.
SOLIDITY
File: contracts/dapp.sol
- transfer() - Transfer funds to receipient account.
- withdraw() - withdraw funds from account.
- receive() - receive funds.
META MASK PLUGIN
Go to metamask plugin in chrome browser.
Connect to local ganache using local ip address. i.e, http://127.0.0.1:7545
Import any one account from ganache to metamask account.
RUN THE APPLICATION
go to react folder and run below command
npm start
access app using local ip