$ npm install $ npm start
navigate browser to localhost:3000
React Js Solidity
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
src Folder - Contracts - BankApp.sol - You can view the smartcontract used in this code bank_app_abi.json - The abi file of the smartcontract.
The smart contract is deployed on Test BSC Network.
1.Firstly connect your wallet by clicking on connectwallet button(Make sure you have test BNB in your wallet). 2.You need to create the account by clicking on createAccount button 3.You can check whether your account is listed in the network by clicking on checkAccountExists Button 4.Next you can deposit the balance into your account by entering the number in the textbox. 5.You can check the balance in the bank account using Account Balance button. 6.You can transfer your funds in the bank account to another bank account(Make sure that account is also listed in the network) 7.You can withdraw funds using Withdraw button.
connectWalletHandler - For connecting the metamask wallet AccoutChangedHandler - Chainging account from metamask can cause this function to work chainChangedHandler - Chainging the chain network in the metamask can cause this function to work updateEthers - This function helps in communicating with the abi,deployed smart contract and the provider network of the metamask
let tempContract = new ethers.Contract(contractAddress, simple_token_abi, tempSigner)
- These are the steps for integrating Smartcontract with the Frontend.
createAccount - Creates the Account in the Bank Dapp checkAccountExists - Checks if the Account is listed in the Dapp AccountBalance - Checks the balance of the account in the Bank DepositBalance - For depositing the balance from your metamask wallet account to bank account WithdrawBalance - For Withdrawing the balance from your bank account to metamask wallet address TransferHandler -For transferring the funds between accounts in the bank. Make sure both the banks are listed in the network.