Clock In System

FINANCIALUTILITYTOOLSDOCUMENTS

Contract purpose

This Smart Contract manages a clock in system for employees. The system manager defines each working day with specific parameters as the earliest clock in time or latest clock out time. Then, the employees can clock in using the index of that working day.

Exposed methods and variables

manager the ethereum address of system manager, given as a parameter at contract creation

workDays returns the details about a particular working day ( earliest and latest clock in and clock out times possible for the employees)

createWorkDay function called by the manager to add a new work day to the contract. It returns the index of the new work day. Using this index, the employees can clock in and clock out.

parameter nametypedetails
_earliestClockInintegerthe earliest time the employees can clock in during this day (unix time)
_latestClockInintegerthe latest time the employees can clock in during this day (unix time)
_earliestClockOutintegerthe earliest time the employees can clock out during this day(unix time)
_latestClockOutintegerthe latest time the employees can clock out during this day (unix time)

clockIn called by an employee who wants to clock in. It emits the EmployeeClockedIn event.

parameter nametypedetails
indexintegerthe index of the current working day

clockOut called by an employee who wants to clock out.It only works if the employee has previously clocked in. It emits the EmployeeClockedOut event.

parameter nametypedetails
indexintegerthe index of the current working day

wasAtWork allows the manager to check the clock in and clock out times of an employee during a particular working day

parameter nametypedetails
indexintegerthe index of the current working day
employeeethereum addressthe address of the employee

Events

EmployeeClockedIn

parameter nametypedetails
DayIndexintegerthe index of the working day
ClockInTimeintegerthe time of the clock in (unix time)
Employeeethereum addressthe address of the employee who has just clocked in

EmployeeClockedOut

parameter nametypedetails
DayIndexintegerthe index of the working day
ClockOutTimeintegerthe time of the clock out (unix time)
Employeeethereum addressthe address of the employee who has just clocked out
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract