Escrow Module

Secure funds management.

Created: 1/9/2026

Escrow Module (escrow_module)

The escrow_module acts as the vault for the gig economy platform. It is responsible for the custody of funds, ensuring they are only moved according to strict protocols.

Key Features

  • Central Pool: Uses a resource EscrowPool to hold generic assets (AptosCoin).
  • Programmatic Access: Only authorized modules (friends) or specific entry functions can move funds.

Functions

escrow_funds

  • Input: account (signer), amount (u64).
  • Logic: Withdraws amount from the account and merges it into the EscrowPool.
  • Usage: Called by gig_contract upon gig creation and location_based_gig for funding pools.

release_funds

  • Input: beneficiary (address), amount (u64).
  • Logic: Withdraws amount from the EscrowPool and deposits it into the beneficiary's account.
  • Usage: Called upon successful job completion or dispute resolution favoring the worker.

return_funds

  • Input: poster (address), amount (u64).
  • Logic: Returns amount from the EscrowPool back to the original poster.
  • Usage: Called if a gig is cancelled, or if a dispute is resolved in favor of the poster.