Sevamove / cpi-incorporated-salary

DeFi project on Ethereum Smart Contracts that pays employee's salary incorporated with a recent consumer price index (CPI) in Belgium.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repo has been achived temporary due to unmaintenance.

Employee's salary incorporated with the most recent consumer price index (CPI) in Belgium.

This project was created in order to understand DeFi and Blockchain developent in general. If you would like to experiment with it by yourself please consider to deploy the contract on the testnet only.

What the contract can do:

  • Keep track of unlimited number of employees in the smart contract by defining them with their wallet address.
  • Request the most recent consumer price index with the help of Chainlink API Calls.
  • Pay employees automatically on a regular basis with the assistance of Chainlink Keepers.
  • Allow company to store its assets in the smart contract in WETH and DAI tokens.
  • Allow employees to receive their payment in WETH or DAI as they prefer.
  • Withdraw left funds to company address.

Prerequisites

Please install or have installed the following:

Installation

  1. Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip3 install eth-brownie
  1. Clone this repo
git clone https://github.com/moonwake769/cpi-incorporated-salary
cd cpi-incorporated-salary
  1. Install ganache-cli
npm install -g ganache-cli

If you want to be able to deploy to testnets, do the following.

  1. Set your environment variables

Set your WEB3_INFURA_PROJECT_ID, and PRIVATE_KEY environment variables.

You can get a WEB3_INFURA_PROJECT_ID by getting a free trial of Infura. At the moment, it does need to be infura with brownie. You can find your PRIVATE_KEY from your ethereum wallet like metamask.

You'll also need testnet Kovan ETH and LINK. You can get LINK and ETH into your wallet by using the kovan faucets located here. If you're new to this, watch this video.

You'll also want an Etherscan API Key to verify your smart contracts.

You can add your environment variables to the .env file:

export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
export ETHERSCAN_TOKEN=<YOUR_TOKEN>

DO NOT SEND YOUR KEYS TO GITHUB If you do that, people can steal all your funds. Ideally use an account with no real money in it.

Usage:

This will deploy the contracts as well as mock contracts, request recent CPI data, add a few employees, fund the contract, and check upkeep.

brownie run scripts/main.py

This will do the same thing... but on Kovan. Make sure that you have minimum 0.5 ETH and 100 LINK on your Kovan testnet account. After that you want to register new Upkeep. Set the GAS limit to 600000 and add 50 LINK.

brownie run scripts/main.py --network kovan

About

DeFi project on Ethereum Smart Contracts that pays employee's salary incorporated with a recent consumer price index (CPI) in Belgium.


Languages

Language:Solidity 51.6%Language:Python 48.4%