src/outcomes/EvmOutcomes.sol, Optimistic.sol, Optimism.sol, Arbitrum.sol, Retryable.sol.
RemoteOrder
The filler passes this to the router. Every field must match the matched order, or the router computes a different statement.Outcome is Pending (0), Paid (1) or ExpiredUnpaid (2).
OutcomeRouter
Reverts with
InvalidOutcome unless the caller is order.filler, it’s before payBy, the amount is non-zero, and the recipient is non-zero and not the caller. Records Paid, transfers the exact amount (native via msg.value, ERC-20 via transferFrom, checking the recipient’s balance rose by exactly the amount), and sends the outcome. Any native value beyond the payment is the message budget. Emits Decided(statement, Paid) and, for ERC-20s, TokenPaid(statement, spent, received).For tokens that take a fee on transfer. Transfers
transferAmount and records Paid only if the recipient received at least order.amount (InsufficientReceived) and the caller was debited at most maxDebit (DebitLimitExceeded). InvalidPaymentLimits if transferAmount is below order.amount or above maxDebit. msg.value is the message budget.Records ExpiredUnpaid at or after
payBy and sends it. Emits Decided(statement, ExpiredUnpaid).ORIGIN_CHAIN, MARKET, plus the messenger. Routers whose bridge charges nothing (OptimismRouter, ArbitrumRouter) revert with InvalidOutcome on a non-zero message budget.
OutcomeInbox
True only when called by the market and the request names this inbox,
proveBy = 0, a 20-byte non-zero recipient, 40 bytes of routeData naming this inbox’s router, the chain string eip155:<REMOTE_CHAIN>, and an asset string matching the token in routeData.Stores the outcome if the call is authenticated (below). Ignores a repeat of the same outcome; reverts
BadRoute on a conflicting one or Pending. Emits Recorded(statement, outcome).MARKET, REMOTE_ROUTER, REMOTE_CHAIN, plus the messenger or bridge.
OptimisticInbox
Adds bonded claims to an inbox.settledOutcome(statement) is the bridge’s record if there is one, otherwise the outcome of an undisputed claim whose window has closed. verify and verifyExpired read it.
Claims the outcome of a matched order on this inbox, with
msg.value == CLAIM_BOND (WrongBond otherwise). One claim per statement. Expiry claims only at or after payBy. ClaimUnavailable if the order isn’t matched on this inbox or the statement already has a claim or a record. Emits Claimed(statement, id, claimant, outcome, deadline).Before the claim’s deadline and while no record exists, with
msg.value == DISPUTE_BOND. One dispute per claim. A disputed claim never settles by itself. Emits Disputed(statement, disputer).Releases bonds. Disputed: once the bridge’s record exists, the side it agrees with is credited both bonds. Undisputed: after the window the claimant gets the bond back, unless a contradicting record arrived first, in which case the order’s counterparty gets it. Emits
Resolved(statement, winner, amount, truth).LIVENESS (5 minutes to 1 day), CLAIM_BOND, DISPUTE_BOND. Views: claims(statement), bonds(account), settledOutcome(statement).
RetryableRouter and AliasedInbox
For a market on a Nitro rollup (Elysium) and a route on its parent chain (HyperEVM).The message budget for one ticket: the Inbox’s submission fee plus
GAS_LIMIT × childMaxFeePerGas. Pass 0 for the current parent base fee._send takes the submission fee from the budget and sets the ticket’s fee cap from the rest, with refunds to the payer on Elysium. A budget that covers only the submission fee creates a ticket that anyone can redeem later. Emits TicketCreated(statement, ticket, budget, maxFeePerGas). Immutables: INBOX, GAS_LIMIT (200,000 on Elysium).
AliasedInbox authenticates record with msg.sender == ALIASED_ROUTER, the router’s address plus Nitro’s alias offset 0x1111000000000000000000000000000000001111.