Stage: Confirm Payment & Failure Handling
Upon the PMM's payment via makePayment(), including a paymentTxId, the trade enters the CONFIRM_PAYMENT phase. The MPC, acting as the payment verifier, must confirm the payment meets protocol specifications, checking amounts, destination chain, and paymentTxId accuracy.
Steps in This Phase
Successful Payment: The
MPCcallsconfirmPayment(), transitioning the trade toCONFIRM_SETTLEMENT, and emits aPaymentConfirmedevent for traceability. Once confirmed, the payment is immutable.Failed Payment: If discrepancies like an incorrect amount or malformed
paymentTxIdoccur, the trade moves to theWARNINGstage. Here, thePMMcan resubmit correct payments within thescriptTimeout.
Actionable Functions
confirmPayment()
function confirmPayment(bytes32 tradeId, bytes calldata signature) external;Execution: Through the
Routerby authorizedMPC Node.Verification: Ensures the trade is in the correct stage and within
scriptTimeout.State Transition: Advances trade to
CONFIRM_SETTLEMENT, logs confirmedpaymentTxId, and emitsPaymentConfirmed.
report()
function report(bytes32 tradeId, bytes calldata msgError, bytes calldata signature) external;Execution: Through the
Routerby authorizedMPC Node.Verification: Ensures trade is not yet finalized.
State Transition: Logs failure, moves trade to
WARNING, and emitsFailureReported.
Trade Data Query
On Success: Access trade stages and finalization details through relevant view functions.
function getCurrentStage(bytes32 tradeId) external view returns (uint256); function getTradeFinalization(bytes32 tradeId) external view returns (TradeFinalization memory);On Failure: Retrieve error metadata with details for resolution.
function getCurrentStage(bytes32 tradeId) external view returns (uint256); function getFailureInfo(bytes32 tradeId) external view returns (FailureDetails memory);
Last updated
