Executing First Blockchain Transaction
Use Contract address and ABI to send your first blockchain transaction
In this section, we'll use web3.js to send our first blockchain transaction. In previous section we initialized our web3 object, now we'll use that to create an instance of our deployed contract and then calling the methods defined in our smart contract.
Declare Contract Address
Address of the deployed contract on ethereum blockchain
Declare Contract ABI
The Contract Application Binary Interface (ABI) is the standard way to interact with contracts in the Ethereum ecosystem, both from outside the blockchain and for contract-to-contract interaction.
Make sure web3 is Initialized before this step
Form an Instance of the contract
Send the transaction to update the current quote and current owner
Call the function of our contract to retrieve current quote and current owner
Complete Working Code Snippet
This example is built using ReactJS. Below is a simple function component in React. To keep it simple, css code is not mentioned in the code.
Congratulations! You Just Built Your First DApp
Last updated