Skip to main content

Module eip712

Module eip712 

Source
Expand description

EIP-712 order signing for the Polymarket CTF Exchange.

Orders on Polymarket are signed typed structured data (EIP-712) against the exchange contract selected by the market protocol on Polygon. CTF markets use:

CTF exchanges share domain version 2. Protocol V2 markets use EXCHANGE_V3 and domain version 3, irrespective of neg_risk. OrderSigningContext binds this selection for ordinary signatures, Deposit Wallet signatures, allowance requests, and order IDs.

This module owns Polygon contract identities and the CTF and V2 approval plans (approval_plan, approval_plan_v2) used by the set-allowances binary.

Structs§

Batch
Call
ClobAuth
DepositWalletCall
One contract call in a Deposit Wallet batch.
Order
OrderSigner
EIP-712 order signer for the Polymarket CTF Exchange.
OrderSigningContext
Validated exchange and EIP-712 domain for a market’s orders and order IDs.

Enums§

PolymarketApproval
One transaction in the Polymarket approval plan.

Constants§

COLLATERAL_APPROVAL_TARGETS
CTF-market spender set requiring pUSD collateral approval.
CONDITIONAL_TOKENS
Conditional Tokens Framework contract address on Polygon mainnet.
CTF_COLLATERAL_ADAPTER
Standard CTF collateral adapter address on Polygon mainnet.
CTF_EXCHANGE
CTF Exchange contract address on Polygon mainnet (CLOB V2).
DEPOSIT_WALLET_FACTORY
Deposit Wallet factory address on Polygon mainnet.
EXCHANGE_V3
Protocol V2 exchange contract on Polygon mainnet.
NEG_RISK_CTF_COLLATERAL_ADAPTER
Neg Risk CTF collateral adapter address on Polygon mainnet.
NEG_RISK_CTF_EXCHANGE
Neg Risk CTF Exchange contract address on Polygon mainnet (CLOB V2).
POLYMARKET_COLLATERAL_TOKEN
Polymarket pUSD collateral token contract address on Polygon mainnet.
POSITION_MANAGER
Protocol V2 position ledger on Polygon mainnet.
ROUTER
Protocol V2 position-operation Router proxy on Polygon mainnet.

Functions§

approval_plan
Returns the ordered approval plan for CTF (v1) markets.
approval_plan_v2
Returns the V2 trading approvals for an explicit pUSD limit in six-decimal base units.
order_hash
Computes the EIP-712 signing hash used by Polymarket as the order ID.
order_hash_with_context
Computes the order ID with the same validated context used for signing.
sign_clob_auth
Signs a ClobAuth EIP-712 message for L1 API authentication.