This repo has been achived temporary due to unmaintenance.
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.
- 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.
Please install or have installed the following:
- Install Brownie, if you haven't already. Here is a simple way to install brownie.
pip3 install eth-brownie
- Clone this repo
git clone https://github.com/moonwake769/cpi-incorporated-salary
cd cpi-incorporated-salary
npm install -g ganache-cli
If you want to be able to deploy to testnets, do the following.
- 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.
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