Timesheet

I. What is a Timesheet ?

A timesheet in Algolancer represents a single week of work within an ongoing project. It serves as the primary unit for tracking, reviewing, and validating hourly contributions made by a freelancer during a defined seven-day period. Throughout the week, freelancers record their working hours and maintain work diaries describing the tasks performed, progress achieved, and deliverables produced.
All data associated with a timesheet are fully decentralized on Algorand for immutability and transparency. Any update to a timesheet requires a blockchain interaction, creating a permanent and verifiable record of all changes.
A timesheet is unique to each {project, freelancer} pair. This means it cannot be shared between multiple freelancers for the same project, nor can it be associated with multiple projects for the same freelancer.

II. Starting New Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "waiting_to_start_new_timesheet"

When starting a new timesheet, the user is required to deposit a USDC amount equal to Max Timesheet Amount + Max Protocol Fees. The remaining amount is recovered by the end of the timesheet.

All funds are locked in the smart contract escrow, we do not hold any money, and all transactions are automatically executed by the contract’s logic, ensuring instant and transparent peer-to-peer payouts.

Total Paid Amount = Max Timesheet Amount + Max Protocol Fees

Max Timesheet Amount = Agreed Hour Amount * Max Daily Hours (12h) * Timesheet Size (7 days)

Max Protocol Fees = Max Timesheet Amount * 3%

Remaining Amount = Total Paid Amount - (Worked Amount + Protocol Fees)

Worked Amount = Agreed Hour Amount * Worked Hours

Protocol Fees = Worked Amount * 3%

Example :

  • A client hires a freelancer with an agreed hourly budget of $50
  • Max Timesheet Amount = $50 * 12 * 7 = $4200
  • Max Protocol Fees = $4200 * 3% = $126
  • Total Paid Amount = $4200 + $126 = $4326
  • Freelancer worked three days: 8 hours, 8 hours, and 6 hours.
  • Worked Amount = $50 * (8 + 8 + 6) = $1200
  • Protocol Fees = $1200 * 3% = $36
  • Remaining Amount = $4326 - ($1200 + $36) = $3090
  • The remaining amount is always refunded to the client when the timesheet is terminated.
  • The fate of the worked amount highly depends on the next steps which are detailed in the following sections.

III. Freelancer - Update Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "running_timesheet"
  • One day per One update
  • The target day has been reached
  • The logged hours <= daily limit (12h)

A freelancer can update a timesheet at any time, as long as the above conditions are satisfied.

IV. Freelancer - Submit Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "running_timesheet"

A freelancer can submit a timesheet at any time, as long as the above conditions are satisfied.

V. Client - Approve Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "submitted_timesheet"

A client can approve a submitted timesheet at any time, as long as the above conditions are satisfied. Once approved, the remaining amount is immediately returned to the client, and the freelancer receives their payment instantly. The client can now start a new timesheet if desired

Freelancer Amount = Worked Amount - Protocol Fees

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Freelancer Amount = $1200 - $36 = $1164
  • Freelancer receives their amount immediately

VI. Client - Cancel Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "running_timesheet"

A client can cancel a running timesheet at any time, as long as the above conditions are satisfied.
The period between timesheet creation and cancellation is known as the Cancellation Interval (CL). This interval plays a key role in determining the fate of the worked amount. Below are the most common scenarios based on the cancellation interval:

Freelancers cannot log hours for future days. therefore, the previous example will be used for only demonstration purposes

CL < 1 Hour :

The client will recover 100% of the worked amount, while freelancer receives nothing. In this particular case, the client has to cover the freelancer protocol fee (3%), which will be deducted from the refund. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 - $36 = $1164
  • Client Total Refund = $3090 + $1164 = $4254
  • Freelancer Amount = $0

CL >= 1 Hour and <= 4 Hours :

The client will recover 80% of the worked amount, while freelancer receives 20% with protocol fees (3%) deducted from the payment. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 * 80% = $960
  • Client Total Refund = $3090 + $960 = $4050
  • Freelancer Amount = ($1200 * 20%) - $36 = $204

CL > 4 Hours and <= 24 Hours :

The client will recover 70% of the worked amount, while freelancer receives 30% with protocol fees (3%) deducted from the payment. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 * 70% = $840
  • Client Total Refund = $3090 + $840 = $3930
  • Freelancer Amount = ($1200 * 30%) - $36 = $324

CL > 24 Hours and <= MAX_CL :

MAX_CL is the maximum cancellation interval allowed for a client to cancel a timesheet. It is dynamic and calculated at runtime using an advanced strategy. Once exceeded, the timesheet can no longer be cancelled.

The client will recover 55% of the worked amount, while freelancer receives 45% with protocol fees (3%) deducted from the payment. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 * 55% = $660
  • Client Total Refund = $3090 + $660 = $3750
  • Freelancer Amount = ($1200 * 45%) - $36 = $504

VII. Freelancer - Cancel Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "running_timesheet"

A freelancer can cancel a running timesheet at any time, as long as the above conditions are satisfied. Once cancelled, the client will recover 100% of the worked amount, while freelancer receives nothing.
In this particular case, the client has to cover the freelancer protocol fee (3%), which will be deducted from the refund. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 - $36 = $1164
  • Client Total Refund = $3090 + $1164 = $4254
  • Freelancer Amount = $0

VIII. Client - Refund Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "running_timesheet"
  • timesheet submission deadline has been reached (24h * 7 from start date)

A client can request a full refund at any time, as long as the above conditions are satisfied. Client will recover 100% of the worked amount, while freelancer receives nothing.
In this particular case, the client has to cover the freelancer protocol fee (3%), which will be deducted from the refund. The remaining amount is immediately returned to the client

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $1200 - $36 = $1164
  • Client Total Refund = $3090 + $1164 = $4254
  • Freelancer Amount = $0

IX. Client - Burn Timesheet

Rules :

  • Project global state == "running"
  • Freelancer local state == "hired"
  • Freelancer local project state == "submitted_timesheet"

A client can burn a submitted timesheet at any time if they are not satisfied with the freelancer’s work, as long as the above conditions are satisfied.
Neither the client nor the freelancer will receive any share of the worked amount. The remaining amount is immediately returned to the client

Burned Amount = Worked Amount - Protocol Fees

The full burned amount will be transferred to a designated burn address. These funds will be allocated to build our dispute resolution system, which will replace the burn mechanism in the near future and will be used to resolve disputes between clients and freelancers when disagreements arise over submitted work.

Previous Example :

  • The remaining amount ($3090) is refunded to the client immediately
  • Client Worked Amount Refund = $0
  • Client Total Refund = $3090
  • Freelancer Amount = $0
  • Burned Amount = $1200 - $36 = $1164