Hub
HUMAN Website
  • HUMAN Protocol Document Hub
  • HUMAN Tech Docs
    • Architecture
      • Components
        • Smart Contracts
          • Escrow.sol
          • EscrowFactory.sol
          • Contract Addresses
        • Dashboard
        • Job Launcher
          • Standard
          • HUMAN Job Launcher
        • Exchange Oracle
          • Standard
        • Recording Oracle
          • Standard
        • Reputation Oracle
          • Standard
          • HUMAN Reputation Oracle
        • HUMAN App
        • Annotation Tools
          • CVAT
          • hCaptcha
          • Fortune (test)
      • Protocol Features
        • Routing Protocol
        • Abuse System
        • Qualifications System
        • Governance
    • SDK
    • Tutorials
      • Job Requesters
        • Signup
        • Launch Jobs
          • Fortune
      • Workers
        • Sign Up
        • KYC Verification
        • Wallet address registration
      • Operators
        • Sign Up
      • HMToken
        • Bridge
          • Ethereum <--> Polygon
          • Ethereum <--> Binance Smart Chain
    • Developer
      • Prerequisites
      • Initial setup
      • Run web3 in Docker
      • Run services in Docker
      • Setting up Oracles
      • Running HUMAN Protocol with CVAT
        • Running CVAT
        • Setting up Worker user
        • Launch simple CVAT job
      • FAQ
  • Routing Protocol Tokenomics
    • Status
    • Premise
    • Token design
    • Proposition for a governance minimization model
    • Liquidity provision /market making
    • Alternate Conviction voting model
    • Voting model
    • The HUMAN-RP Magistrate
    • Voting process
    • Security
    • Policies
    • Slashing and Soft-freezing
    • Staking for tool vendors
  • Grants Program
    • Introduction and Program Overview
    • Application Process
      • Application Process of the HUMAN Grants Program
    • Funded Projects
    • Community
    • Help & FAQs
    • Terms and condition
  • Guide to the HUMAN Protocol SDK's
Powered by GitBook
LogoLogo

© 2023 HPF. HUMAN Protocol® is a registered trademark

On this page
  • Key Features and Components
  • Workflow/Functions

Was this helpful?

  1. HUMAN Tech Docs
  2. Architecture
  3. Components
  4. Smart Contracts

EscrowFactory.sol

The EscrowFactory contract is a smart contract designed to facilitate the creation of Escrow contracts within the HUMAN Protocol ecosystem. It allows users to create escrow instances for secure and transparent transactions between job requesters and workers.

Key Features and Components

ERC-20 Token Compatibility

The factory supports the creation of escrows utilizing any ERC-20 compliant token, ensuring a wide range of payment options.

Staking Requirement

Users must maintain a minimum stake (in HMT tokens) to create an escrow. This requirement integrates platform utility with token economics, ensuring that only committed users can initiate escrows.

Standardized Duration

All escrows created through the factory have a predefined duration, standardizing the timeline for escrow completion.

Ownership and Upgradeability

Utilizes OpenZeppelin's OwnableUpgradeable and UUPSUpgradeable for contract ownership and upgradeable functionality, ensuring secure management and the ability to introduce future improvements.

Escrow Tracking

The contract maintains a counter of created escrows and provides functionalities to query the existence and details of individual escrows

Event Emission

Events are emitted upon the creation of new escrows, providing transparency and traceability of operations.

Workflow/Functions

Initialization

This function initializes the factory by:

  • Setting the staking contract address, ensuring that only users with sufficient stakes can create escrows.

  • Configuring the minimum stake requirement.

  • Initializing ownership via OpenZeppelin’s upgradeable pattern.

  • Ensuring the contract is ready for escrow creation.

Escrow Creation:

Users with sufficient HMT token stakes can invoke the createEscrow function, specifying the token address, trusted handlers, and a job requester ID.

  • Checks that the caller’s available stake meets the minimum requirement.

  • Deploys a new Escrow contract with a standardized duration.

  • Increments the internal counter and maps the new escrow’s address.

  • Emits an event (LaunchedV2) with details of the created escrow.

  • Can be called by:

    • Anyone.

  • Conditions:

    • HMT stake > 0.

Has Escrow

The hasEscrow function allows checking if a given address corresponds to a created escrow.

Can be called by:

  • Anyone.

Upgradeability:

Through the UUPSUpgradeable pattern, the contract owner can propose upgrades to the Escrow Factory, allowing for future enhancements and adjustments without disrupting existing operations.

  • Can be called by:

    • Owner.

Security and Trust

The Escrow Factory Smart Contract embeds multiple layers of security and trust mechanisms, including staking requirements for escrow creation, ownership controls for critical operations, and upgradeability for future improvements. The contract's design prioritizes transparency, security, and efficiency, making it a foundational component of its ecosystem for managing escrow processes on a scalable and reliable platform.

PreviousEscrow.solNextContract Addresses

Last updated 3 months ago

Was this helpful?