Skip to Content
Blockchain Development for Finance Projects
book

Blockchain Development for Finance Projects

by Ishan Roy
January 2020
Intermediate to advanced
530 pages
11h 11m
English
Packt Publishing
Content preview from Blockchain Development for Finance Projects

App.js

App.js has the following functions:

  • Use the injected web3 objected to connect to the Ganache blockchain and set the network in the navigation bar.
  • Asynchronously access MetaMask for account authorization.
  • Define the Transfer, Approve, and Mint methods for interacting with the token contracts.
  • Set the state and pass the relevant props to the container component before each operation (Approve, Mint, and Transfer) is carried out.

Let's look at the code:

  1. We will start writing App.js by first importing React, Web3, and the app components, as shown here:
import React, { Component } from 'react';import Web3 from 'web3'import Tokens20 from './Tokens/all20';import Tokens721 from './Tokens/all721';import Nav from './Components/Nav';import ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Blockchain Development

Advanced Blockchain Development

Imran Bashir, Narayan Prusty
Blockchain for Business

Blockchain for Business

S. S. Tyagi, Shaveta Bhatia

Publisher Resources

ISBN: 9781838829094Supplemental Content