ERC-7750 Decentralized employment system

Review · Other · created 2024-08-04

A standard that handles the entire employment lifecycle on the Ethereum blockchain, from company registration, employment history recording, and employment contract execution, to escrow salary payments, dispute resolution, and mutual reviews.

Why it is needed

Existing employment systems are often centralized, opaque, and lacking in trust. Job seekers' work histories depend on records kept separately by companies or institutions, making it hard to filter out forgery or exaggeration, and hiring companies must verify past records one by one. Salary payment also depends on the company's good faith, and when disputes arise over contract terms, the resolution process is slow and complicated. This standard aims to build a fairer and more transparent employment ecosystem by recording employment history on the blockchain, automating contract execution, and providing a dispute resolution mechanism. Employees prove their employment history with a non-transferable Soulbound Token (SBT), and companies can check this record before entering into a contract. Salary is held by a smart contract and paid out once conditions are met, protecting both parties.

What to implement

In depth

Employee soulbound tokens and employment history

Employees are represented by a soulbound token (SBT) minted via mintEmployeeToken. The token is non-transferable, so employment records are permanently bound to the individual. Metadata such as work history is stored off-chain and referenced via metadataURI. Employment history is maintained as an array of contract IDs linked to each employee token and can be looked up by anyone with getEmploymentHistory(uint employeeTokenId). The source states that this record is stored permanently and immutably on the blockchain and is publicly accessible so companies can verify past history before finalizing a contract. The system operates after employee testing and before final hiring and contract signing.

Company registration and lookup

Calling registerCompany(name, industry) registers a new company, issues a unique companyId, and records the caller address as the owner. Per the test cases, the companies mapping stores the name, industry, owner, and an empty employeeIds array, and a CompanyRegistered event is emitted. getCompany(companyId) returns the company name, industry, owner address, and the array of employee token IDs it holds.

Creation and execution of employment contracts

createContract takes companyId, employeeTokenId, salary, duration (in months), responsibilities, and terminationConditions, and issues a unique contractId. The contract is in Created status upon creation, and both the company and employee must call executeContract with their own wallets to agree before it becomes Active. Once both confirmations are collected, a ContractExecuted event is emitted. The test cases present company-level and employee-level tracking structures such as companyContracts and employeeContracts as an optional but common implementation choice.

Escrow-based salary payment

The company calls depositSalary(contractId) as a payable function to deposit salary into escrow. The function verifies that the deposited amount matches the contract's salary, updates escrowBalances[contractId], and emits a SalaryDeposited event. releaseSalary(contractId) sends the escrowed funds to the employee token owner's address according to the contract's payment schedule or completion, zeroes out escrowBalances, and emits a SalaryReleased event. The source Rationale explains that this structure ensures salary funds are actually available and ties payment to contract fulfillment conditions, protecting both parties.

Dispute resolution

Either party to the contract can raise a dispute with raiseDispute(contractId), which starts the moderator assignment process. The assigned moderator rules via resolveDispute(contractId, decisionForEmployee). If decisionForEmployee is true, the remaining escrowed funds are transferred to the employee; otherwise they may be returned to the company. The source explains that for complex employment issues that a smart contract cannot enforce automatically, the moderator provides human oversight, reaching a fair conclusion based on the contract terms and the submitted evidence.

Contract termination and reviews

The company can terminate a contract according to pre-agreed conditions with terminateContract(contractId, reason), changing the contract status to Terminated. If there is an objection to the termination, the dispute resolution process can be used. After a contract ends, both the company and the employee can leave a rating and comments with submitReview(contractId, rating, comments), and all reviews for a contract can be looked up with getReviews. Reviews feed into both parties' reputation scores and are designed to encourage mutual accountability and positive behavior within the ecosystem.

Proposal status

This proposal is currently in Review status. Since it is not yet a finalized standard, the function signatures or behavior in the specification may still change during review.

Things to watch out for

Original ERC · ← ERCs