ChristoferVikstroem / FaTS

An open-source repository for a smart contract implementation in the KTH course DD2485.
MIT License
1 stars 0 forks source link

Fair and Transparent Salaries (FaTS)

FaTS is an open-source repository for a smart contract development in the KTH course DD2485. The protocol utilizes blockchain technology to make salary information more visible (transparent). The protocol are written in Solidity and contains two contracts: CompanyFactory.sol and Company.sol

Motivation and Background

The motivation behind this development is to allow employees to gain more information about the salaries of their peers in the company they are employed at, specific salary details of connected companies, and the average salary of employees within specific sectors. There are existing initiatives for making salary information more public, transparent and available (e.g., glassdoor https://www.glassdoor.com/) but the goal here is to motivate companies (employers) to deploy FaTS as a way to be transparent about their salaries. Specific employee information is anonymized besides their employment title and their salary. To increase trust, each employee can verify that their reported salary is correct. By putting this on the blockchain, nothing will be hidden, meaning that changes within an organization (layoffs or salary changes) will be visible for everyone. The protocol aims to give employees more information when negotiating their compensation and to create more trust for specific organizations by holding them more accountable.

CompanyFactory.sol

Features

Sector Management

Event Logging

Query Functions

Usage (CompanyFactory.sol)

Deployment

Granting and Revoking registration rights (onlyOwner)

Granting: Call the grantRegistryRight function to grant a company within a specific sector registration right. Revoking: Call the revokeRegistryRight function with the company key as parameter input to remove that company's registration right.

Registering or Removing company (requires company specific key) Registering: Call the registerCompany function with your company key as input to register the company's name within the specified sector. Removing: Call the removeCompany function with your company key as input to remove the company's details.

Query Functions

Sector Management

Events

Company.sol

Features

Employee Management

Employee Verification

Average Salary Calculation

Events

Access Control

Usage (Company.sol)

Deployment

Employee Management

Verification

Average Salary

Events

Access Control

Unit Test

The protocol can be automatically executed from the test suite and is done through Hardhat. The prerequisites include having Node.js installed on the machine, which can be downloaded on https://nodejs.org.

Installing Hardhat

  1. Open a terminal/command prompt.
  2. Navigate to the project directory:
    cd path/to/this/project
  3. Initialize a new Node.js project:
    npm init -y
  4. Install Hardhat:
    npm install --save-dev hardhat
  5. Run the tests:
    npx hardhat test
  6. Coverage testing:
    npx hardhat coverage

Related work

Similar initiatives to make salaries more transparent exist but mostly exist off-chain. Most on-chain efforts in this field focus on payroll management, for instance Bitwage (https://www.bitwage.com/) that allows employees and freelancers to choose if they would like to be paid in a cryptocurrency etc. Future work on this project could include contracts to be formed between the employer and the employee where currency options would be available and automated through smart contracts. OpenPayrolls (https://openpayrolls.com/) and GlassDoor (https://www.glassdoor.com/) are off-chain initiatives to make salaries more transparent.