Coder Social home page Coder Social logo

bonusblocks-project23's Introduction

BONUS BLOCKS

SALARY CLAIMING DAPP FOR EMPLOYEES

BONUS BLOCKS is a decentralized application (dApp) that allows employees to claim their salary and incentives in a stable cryptocurrency with full transparency. All financial transactions made through the dApp are recorded on the blockchain and can be easily tracked using a block explorer. This ensures the security and immutability of payment records, preventing any tampering or fraud.

Check out the video : Alternate text

For more details Please read documentation file

SETTING UP:

Step 1: Download the repository using the command

[email protected]:jenikaretnakaran/bonusblocks-project23.git

Step 2: Move to downloaded directory & Install the dependencies for testing using the command:

npm install

Step 3: Move to frontend-react directory & Install the dependencies for Front-end using the command:

npm install

Connect to Ethereum Network

Step 1: Create an Infura account Infura Step 2: Obtain the endpoint URL

Create Newkey
Network:Web3 API
Project Name:------

Step 3: Copy the endpoint URL and paste it in .env file Create a .env file if you don't have one

PROVIDER_URL= "https://goerli.infura.io/v3/<YOUR_API_KEY> "

######## Settingup Admin account Step 1: Setup admin account with some GoerliETH for transactions Step 2: Export Private Key from Metamask wallet Step 3: Copy private key and paste it in .env file

PRIVATE_KEY= " "

Configure hardhat.config.js file

Step 1: Give Network Details like this

Goerli : {
     url: process.env.PROVIDER_URL,
     accounts:[`${process.env.PRIVATE_KEY}`]
   }

Test Smart Contracts

Using Hardhat Environment Step 1: Deploy the contract

npx hardhat run scripts/deploy.js --network Goerli
npx hardhat run scripts/deploy_salary.js --network Goerli
npx hardhat run scripts/deploy_reward.js --network Goerli

Step 2: Test the contract

npx hardhat test

NOTE:Transfer tokens from deployer wallet to payrollcontractaddress for transactions

Start the development server

Step 1: Copy the contract addresses and paste it in frontend folder Addresses folder Step 2: Copy contractABI from artifacts and paste it in frontend folder contracts Step 3: Go to frontend React directory Open the terminal and start the development server

npm start

Settingup Employee accounts

Step 1: Setup Employee account with some GoerliETH for transactions

WORKFLOW

ADMIN

Connect admin wallet

Step 1: Make sure Admin wallet is connected
Step 2: Go http://localhost:3000 and click on ConnectWallet dropdown and select admin

Add new employee data

Step 1: Click on Employee Registration and fill up the form details

Eg: 
    Salary: 1000
    Address: 0x..............................
    Joining Date:11/11/2022

Update employee data

Step 1: On adminpage navbar click on Employeedata option and then click on Update button next to the corresponding employee
Step 2: Fill up the update form and Submit

EMPLOYEE

Connect Employee Wallet

Step 1: Make sure Employee wallet is connected
Step 2: Go http://localhost:3000 and click on ConnectWallet dropdown and select Employee

Claiming Salary

Step 1: Click on SalaryClaim option in navbar and Click Claim button

*Claiming Bonus NOTE: A salary can only be claimed after a gap of 30 seconds between each claim. A bonus can only be claimed after a gap of 90 seconds between each claim

Step 1: Click on BonusClaim option in navbar and Click Claim button

Check Transactions

Step 1: Click on transactions option in homepage navbar and then click on the block explorer link 

bonusblocks-project23's People

Contributors

jenikaretnakaran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.