End To End

  1. The user creates an order using the Escrow smart contract on the source chain.

  2. The a hash of the order details are stored in the orders mapping.

  3. An OrderPlaced event is emitted.

  4. The Operator service, listening for the OrderPlaced event, detects the new order.

  5. The Market Maker (MM) calls the transferTo function on the PaymentRegistry smart contract on the destination chain, using details from the OrderPlaced event.

  6. The PaymentRegistry contract records the transaction details and transfers the funds to the user on the destination chain.

  7. The Operator service, listens for the Transfer event from the PaymentRegistry contract.

  8. Once the Transfer event is detected, the MM can either begin the proof process immediately or wait for better gas prices and batch proof their order fulfillments.

  9. When the proof process begins, the Operator service gathers data specifying which order is being proved.

  10. The Operator service forwards the data for the order that they claim they fulfilled back to the Escrow smart contract, which sends the data to a HDP module that calculates which storage slots in the PaymentRegistry smart contract certify order fulfillment.

  11. The HDP module checks what the value of the storage slot is true, and if so, it sends back to the Escrow contract that the order has indeed been fulfilled, and that the order can be marked as proved, and the funds can be withdrawn to the MM.

  12. The MM calls the withdrawProved function to receive payment (including the amount bridged + fee) for the proved order.

Last updated