Docs/Smart contracts/Smart contracts

Smart contracts

A high-level map of markets, outcome tokens, fee vault, liquidity distributor, registry, and verified state implementations.

Contract map#

ContractResponsibility
EventEmitterAuthenticates registered protocol sources and emits the single canonical domain-event stream.
StateImplementationRegistryMaps verified template IDs to approved, clone-compatible state implementations.
StateMarketFactoryClones verified or unverified state, deploys markets, configures fees, and mirrors canonical events.
StateMarketCustodies collateral, manages outcome tokens and orders, resolves, and pays winners.
FeeVaultHolds creation bonds and trading fees, tracks categorized claimable earnings, and finalizes resolver rewards.
LiquidityRewardsDistributorOptional treasury-funded Merkle claims for scored two-sided liquidity campaigns.
StateMarketTokenMarket-controlled ERC-20 representation of one YES or NO claim.
IState implementationReturns the boolean condition consumed by market resolution. Official families cover Uniswap spot price and FDV, ERC20 supply and balance, plus authenticated Aave V3 and Morpho Blue liquidation state.

Trust boundaries#

  • Market resolution trusts its immutable state implementation and the external contracts it reads, whether verified or unverified.
  • The protocol owner controls registry selection, current treasury, and economics defaults for newly created markets.
  • The EventEmitter owner manages registry, factory, FeeVault, and liquidity-distributor source-role allowlists; historical factories can remain live across upgrades.
  • The registry does not gate permissionless creation. It determines whether the supplied implementation receives a verified nonzero template ID.
  • Every market snapshots its fee rate, split, bond, and bounty; later default changes do not alter it.
  • The market creator can update metadata before resolution, but cannot change resolver, deadline, collateral, or outcome tokens.
  • Manipulation resistance belongs in the state template; restricting check() callers is not a price-security mechanism.
Experimental Phase onRobinhood Chain