Reader small image

You're reading from  Mastering Ethereum

Product typeBook
Published inApr 2019
Reading LevelExpert
PublisherPackt
ISBN-139781789531374
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Merunas Grincalaitis
Merunas Grincalaitis
author image
Merunas Grincalaitis

Merunas Grincalaitis, born in Lithuania and based in Spain since he was 4, has worked with blockchain companies all around the world, helping them create ICOs, dApps, MVPs, technical whitepapers, web apps, and audits so that they improve the Ethereum ecosystem with decentralized solutions that return people's trust in themselves. He created one of the first books about Ethereum development, named Ethereum Developer - Learn Solidity From Scratch, which sold a lot of copies worldwide, as a quick guide to provide a bridge for programmers interested in the world of Ethereum and smart contract programming. Currently, he's working on providing free learning resources through his Medium blog to all developers looking for expert guidance.
Read more about Merunas Grincalaitis

Right arrow

Finishing the dApp

Now that we have a working smart contract with our desired logic, we can implement the dApp using Truffle and web3.js in a simple React application. Start by importing the required components inside your index.js file:

import React from 'react'
import ReactDOM from 'react-dom'
import MyWeb3 from 'web3'
import './index.styl'
import ABI from '../build/contracts/DAX.json'
import TokenABI from '../build/contracts/ERC20.json'

const batToken = '0x850Cbb38828adF8a89d7d799CCf1010Dc238F665'
const watToken = '0x029cc401Ef45B2a2B2D6D2D6677b9F94E26cfF9d'
const dax = ABI.networks['3'].address

We'll use only two tokens in this prototype for you to learn how to create the application since a fully-featured DAX is outside the scope of this book. The goal is to show you the path so you can...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Ethereum
Published in: Apr 2019Publisher: PacktISBN-13: 9781789531374

Author (1)

author image
Merunas Grincalaitis

Merunas Grincalaitis, born in Lithuania and based in Spain since he was 4, has worked with blockchain companies all around the world, helping them create ICOs, dApps, MVPs, technical whitepapers, web apps, and audits so that they improve the Ethereum ecosystem with decentralized solutions that return people's trust in themselves. He created one of the first books about Ethereum development, named Ethereum Developer - Learn Solidity From Scratch, which sold a lot of copies worldwide, as a quick guide to provide a bridge for programmers interested in the world of Ethereum and smart contract programming. Currently, he's working on providing free learning resources through his Medium blog to all developers looking for expert guidance.
Read more about Merunas Grincalaitis