/pet_shop_web3

Primary LanguageJavaScriptMIT LicenseMIT

Ethereum Pet Shop DApp

This repository contains the code for an adoption tracking system for a pet shop built using Ethereum and smart contracts. It is based on the Ethereum Pet Shop tutorial from the Truffle Suite documentation.Tutorial

Getting Started

These instructions will help you get more in depth knowledge about some steps.

Prerequisites && Installation

Please refer to the tutorial as this is not the official tutorial, here we gonna just give some steps their value.

Compilation:

in the compilation of the contracts we can see the generation of the build folder where we can see the .json file for each contract, in which there is the ABI and some other info.

Screenshot from 2023-11-08 12-40-10

Migration:

Migration will send the .json to the network of ganache and this will trigger a transaction of "smart contract creation".

Adoption of a pet:

Having already configured metamask, and by adopting a pet, the code in the front will trigger web3 that will trigger metamask that will ask you for an approval, if you accepted, this will trigger a transaction of type: "user to smart contract" and this will invoke the functionnality of adotpin in the smart contract that will be executed in the EVM and will use GAS for it that you will pay during the transaction.

Entering the website and metamask detected and being triggered to sign in:

Entering the website and metamask being triggered to sign in

Waiting for the confirmation of the transaction:

Waiting for the confirmation ( the signature ) of the user

Transaction confirmed:

Transaction confirmed

The transaction in ganache network:

the transaction in ganache network