Native OpenWork Job Contract

The Native OpenWork Contract manages user profiles, job postings, work submissions, milestone payments, and interchain job functions while being totally upgradeable.

This table describes all the features this contract will have and how they will be implemented.

Feature

Implementation Details

Profile Management

Struct: Profile { address, ipfs_hash, referrer_address, rating } Functions:setProfile(ipfsHash) – Stores user profile data on-chain • getProfile(address) – Retrieves the profile for a given address

Job Posting

Struct: Job { id, jobGiver, applicants:[], jobDetailHash, isOpen, workSubmissions:[], milestonePayments:[], totalPaid, currentLockedAmount, currentMilestone, selectedApplicant } Function: postJob(ipfsHash, milestones) {

setJobDetailHash(), setmilestonePayments(), setIsOpen() } Note: Max. 10K USD per Job

Job Application

applyToJob(jobID, application_hash) {

getJobDetails()

isOpen() addApplication(jobID) }

Job Initiation (Direct)

startJob&LockMilestone1(address) { getJobDetails() isJobGiver() LockPayment() addSelectedApplicant() }

Job Initiation (InterChain)

startJobInterChain(applicationID) { getJobDetails() isJobGiver() addSelectedApplicant() }

Work Submission

submitWork(submissionHash) { getJobDetails() isApplicant() addWorkSubmission() }

Release Current Milestone Payment

releasePayment(jobID){

isJobGiver

getCurrentMilestone() makePayment() incrementMilestone() Call setRewards() on the Earnings & Rewards Contract updateTotalJobValue() }

Locking Next Milestone Payment

LockNextPayment(jobID){ isJobGiver getCurrentMilestone() LockPayment() }

InterChain Milestone Payment Release

releasePaymentInterchain(jobID){

updateJob(jobID) Call setRewards() on the Earnings & Rewards Contract updateTotalJobValue() } Note: Payment is released in local chain.

InterChain Lock Next Milestone

LockNextMilestoneInterchain(jobID) { updateJob(jobID) } Note: Payment is locked in local chain.

Rating System

rate(jobID, address)

Allows a job giver/taker to rate each other (only if the caller is associated with the job) getRating(address)

Retrieves the rating for a specified address

Adding Portfolios

AddPortfolio(address) Adds a portfolio hash to the given profile

Contract Upgrade

As per the UUPS standard, this contract, like all contracts, will have a proxy and an implementation contract. upgrade(newImplementation) – Enables the Main DAO contract to upgrade the contract’s implementation


Last updated