FB Pixel
Smart Contracts & Workflows

Microjob Payment Contract

Estimated reading: 4 minutes 72 views

1. Overview

The Microjob Payment Contract enables a DAO to manage pay-per-task payments for service partners who contribute to DAO operations.

This module is designed for services where contributors perform many small jobs, such as:

  • online sessions
  • moderation or facilitation tasks
  • support services
  • micro-contributions within a DAO ecosystem

Instead of paying by project milestone, the contract enables automated payment based on the number of completed jobs.

Each contributor receives a withdrawable balance recorded on-chain, which can be claimed directly from the contract.

 

2. Business Logic

The Microjob Payment mechanism operates as follows:

  1. A DAO provides services to users and collects service fees.
  2. Service Providers perform individual jobs to deliver those services.
  3. Each job has a unit payment value defined by the DAO.
  4. At the end of a period (typically monthly), the DAO calculates:
    • the number of jobs completed by each partner
    • the corresponding payment amounts
  5. These payment calculations are submitted to the Microjob Payment contract.
  6. Each partner receives a withdrawable balance recorded on-chain.
  7. Service Partners claim their payment directly from the smart contract.

The payment value for each partner is calculated using the number of completed jobs multiplied by the unit payment rate.

Example: If a session payment rate is $5 per session and a partner completes 100 sessions, the partner earns $500 equivalent in DAO treasury tokens.

 

3. Contract Architecture

The Microjob Payment module consists of two smart contracts:

  • Microjob Payment Contract
  • Revenue Calculator Contract

The Revenue Calculator is used internally to convert token values and determine distribution amounts.

 

4. Deployment Parameters

When deploying the Microjob Payment contract, the following parameters are required:

xdaoAddress

The address of the DAO’s XDAO governance contract.

currencyAddresses

Array of supported token addresses used for payments.

revenueCalculatorAddress

Address of the Revenue Calculator contract used for token conversion logic.

These parameters define how the contract interacts with the DAO treasury and supported tokens.

 

5. Core Smart Contract Functions

5.1 Set Payment Per Job

Purpose: Defines the payment amount for each completed job.

Example use cases:

  • payment per connection session
  • payment per completed service task
  • payment per content moderation job

This value serves as the unit price for all payment calculations.

 

5.2 Submit Calculation Data

Purpose: Records the payment calculation results for a given period.

The DAO submits the following data:

  • wallet addresses of service partners
  • number of completed jobs per partner
  • token amounts used for exchange rate calculations

These inputs allow the contract to compute each partner’s withdrawable balance.

 

5.3 Payment Calculation Logic

The payment calculation is performed as follows:

  1. Convert each partner’s payment value into a USDT-equivalent amount.
  2. Determine the proportion of tokens held in the DAO treasury.
  3. Distribute payment across those tokens proportionally.

Example:

If the DAO treasury holds:

  • 70% USDT
  • 30% KAT

Then each partner receives payments distributed proportionally between the tokens.

The withdrawable amount is therefore determined by:

Total Payment (USDT equivalent) × Token Treasury Ratio.

 

5.4 Claim Function

Purpose: Allows Service Partners to claim their payment.

When a partner calls the claim function:

  1. The contract verifies the withdrawable balance.
  2. Tokens are transferred from the DAO treasury.
  3. The claim transaction is recorded on-chain.

All claim activities remain publicly verifiable.

 

6. DAO Role Workflows

This section describes workflows from the perspective of DAO participants.

6.1 DAO Organizer Workflow

The DAO Organizer (or authorized role) is responsible for coordinating payments.

Typical process:

  1. Define the payment per job rate.
  2. Retrieve the list of completed jobs per contributor.
  3. Load contributor wallet addresses.
  4. Execute payment calculation.
  5. Submit calculation results to the smart contract.

Once this process is completed, contributors will see their withdrawable balances.

 

6.2 Service Partner Workflow

Service Partners are contributors who perform microjobs.

To claim payment:

  1. Connect wallet to the platform.
  2. Navigate to their profile or payment page.
  3. Click Withdraw / Claim Payment.
  4. Confirm the transaction via wallet.

Tokens are transferred directly to the partner’s wallet.

 

7. Testing

The module has been tested using:

  • unit tests
  • manual testing scenarios
  • multi-token payment conditions

Test cases verified:

  • correct DAO address return
  • accurate payment calculations
  • multi-token distribution logic
  • correct withdrawable balances

 

8. Governance and Permissions

The Microjob Payment contract operates under DAO governance rules.

Key governance requirements:

  • The contract must be added to the DAO permitted contract list.
  • Roles such as Implementor or Admin may be required to execute calculation functions.
  • Ownership should be transferred from deploy wallet to a DAO-controlled address.

This ensures that payment logic remains transparent and accountable.

 

9. Design Purpose

The Microjob Payment contract enables DAOs to:

  • manage high-volume micro-contribution tasks
  • distribute payments efficiently
  • maintain transparent accounting
  • allow contributors to claim earnings independently

This module is particularly suited for service-based DAOs such as:

  • community service platforms
  • knowledge exchange networks
  • peer-to-peer service ecosystems
  • DAO-managed digital services.