Skip to content

bujosa/caos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caos - Employee Management System

Caos is a smart contract designed to manage employee information, track hours worked, calculate payments, and process them securely and efficiently. It allows employees to input their personal and professional information and provides an interface for them to log their hours worked. The contract uses this information to calculate employee payments and can process them using cryptocurrency or traditional currency.

Smart Contract

The smart contract is written in Solidity, a programming language used for developing smart contracts on the Ethereum blockchain. The code consists of four main functions:

Employee Registration

The registerEmployee function allows employees to register their personal and professional information, including their name, date of hire, salary, position in the company, and hourly rate. This information is stored securely on the blockchain, ensuring that it cannot be tampered with or accessed by unauthorized parties.

Hour Tracking

The logHours function allows employees to log their hours worked using an interface accessible through the web or mobile. This information is automatically recorded and used to calculate employee payments.

Payment Calculation

The calculatePayment function uses the information stored in the contract to calculate each employee's payment based on their hourly rate and the number of hours worked. The result is stored in the contract, ready for payment processing.

Payment Processing

The processPayment function enables the contract to process payments to employees using cryptocurrency or traditional currency. This function accesses the stored payment information and initiates a payment transaction to the employee's specified account.

Transaction Logging

The contract also maintains an array of payment transactions made to employees, providing a clear and accurate record of all financial activity.

Conclusion

Caos provides an efficient and secure solution for managing employee information, tracking hours worked, calculating payments, and processing them. Its smart contract design ensures the privacy and security of employee data while providing a reliable and accurate payment system.

EIP2535 Diamond Standard

Contracts Required by EIP2535 (This section is copy from EIP2535)

  • DiamondCutFacet: Contract in charge of handling the update logic of the diamond.
  • DiamondLoupeFacet: Contract in charge of introspection. Allows to se the facet addresses and their functions.
  • Diamond: The proxy contract that handles the routing logic to send user requests to the correct facet if one is available.

Run the tests

forge test

Run the script to deploy the diamond in a local network

anvil
forge script scripts/Deploy.s.sol --fork-url http://localhost:8545/ --broadcast

Releases

No releases published

Packages

No packages published

Languages