Polymarket Neg-Risk Exchange

Polygon PoS Polymarket Browse chains

0xc5d563a36ae78145c45a50134d48a1215220f80a

Solidity v0.8.15+commit.e14f2714

🤖
Query this contract from your AI
Reference: polymarket-neg-risk-exchange-v1-polygon 0xc5d563a36ae78145c45a50134d48a1215220f80a
Sample prompt: "Tell me the current state of polymarket-neg-risk-exchange-v1-polygon"
No AI wired up yet? → mcp.smarts.md · Browse chains

Admin & Risk

Who can change the rules?

Block #89,877,628

Detected pausable controls from the verified ABI.

Polymarket contract governance
Ask your AI who can pause, upgrade, or change roles on this Polymarket contract.
Pausable

Current controls

Paused
false

Architecture

Polymarket contract role

Polymarket Neg-Risk Exchange

polymarket-neg-risk-exchange-v1-polygon

Matches orders for multi-outcome Polymarket markets. Filled orders use neg-risk outcome tokens, then resolution flows through the Neg-Risk Adapter before final CTF-style settlement.

Trader order Neg-Risk Exchange Neg-Risk Adapter UMA Adapter Final payout

Shares the same trading ABI as the CTF Exchange; the difference is the market path.

Market type Multi-outcome / mutually exclusive markets
Token path Neg-risk outcome tokens
Resolution path Neg-Risk Adapter + UMA Adapter
Compare with Polymarket CTF Exchange

Overview

Read Functions
31
Write Functions
19
Events
13

Read Functions

Block #89,877,628 · just now
admins(address) view

Read the uint256 value for a given admin address from the exchange's admins mapping.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
address

Returns

Name Type Description
uint256 The uint256 stored for that address in admins (e.g., privilege flags or expiry), as defined by the contract.✨ AI
domainSeparator() view → 0x82cb6aa85babb812f4b521a12b10f0cbc68d2b44be7bc02c047004f544adb49f

Returns the EIP-712 domain separator used to sign off-chain order data.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
bytes32 bytes32 EIP-712 domain separator used for order signatures and typed data hashing.✨ AI
getCollateral() view → 0x2791bca1f2de4661ed88a30c99a7a9449aa84174

Return the address of the collateral token used by this Neg-Risk exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address Address of the ERC20 collateral token that the exchange accepts for trades.✨ AI
getComplement(token: uint256) view

Gets the complement of a tokenId

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
token uint256 - The token

Returns

Name Type Description
uint256
getConditionId(token: uint256) view

Return the UMA condition id for the given neg-risk token id.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

dev: Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.

Parameters

Name Type Description
token uint256 Neg-risk token id encoding market and outcome used to derive the condition id.✨ AI

Returns

Name Type Description
bytes32 bytes32 condition id for the market outcome associated with the provided token id.✨ AI
getCtf() view → 0xd91e80cf2e7be2e162c6513ced06f1dd0da35296

Return the address of the CTF adapter used by this Neg-Risk Exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address CTF adapter contract address used for final CTF-style settlement of filled orders.✨ AI
getMaxFeeRate() pure → 1,000

Returns the maximum fee rate for an order

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
uint256
getOrderStatus(orderHash: bytes32) view

Gets the status of an order

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets. Returns the fill/cancel state used to decide whether a Polymarket order can still trade.

Parameters

Name Type Description
orderHash bytes32 - The hash of the order

Returns

Name Type Description
tuple
getPolyProxyFactoryImplementation() view → 0x44e999d5c2f66ef0861317f9a4805ac2e90aeb4f

Gets the Polymarket Proxy factory implementation address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address
getPolyProxyWalletAddress(_addr: address) view

Gets the Polymarket proxy wallet address for an address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
_addr address - The address that owns the proxy wallet

Returns

Name Type Description
address
getProxyFactory() view → 0xab45c5a4b0c941a2f231c04c3f49182e1a254052

Gets the Proxy factory address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address
getSafeAddress(_addr: address) view

Gets the Polymarket Gnosis Safe address for an address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
_addr address - The address that owns the proxy wallet

Returns

Name Type Description
address
getSafeFactory() view → 0xaacfeea03eb1561c4e67d661e40682bd20e3541b

Gets the Safe factory address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address
getSafeFactoryImplementation() view → 0xe51abdf814f8854941b9fe8e3a4f65cab4e7a4a8

Gets the Safe factory implementation address

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address
hashOrder(order: tuple) view

Computes the hash for an order

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
order tuple - The order to be hashed

Returns

Name Type Description
bytes32
isAdmin(usr: address) view

Checks whether an address is an admin of the Neg-Risk Exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
usr address Address to check for admin privileges.✨ AI

Returns

Name Type Description
bool True if the address has admin privileges, false otherwise.✨ AI
isOperator(usr: address) view

Checks whether the specified address is an authorized operator of this Neg-Risk Exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
usr address Address to check for operator authorization.✨ AI

Returns

Name Type Description
bool True if the address is an authorized operator for this exchange; otherwise false.✨ AI
isValidNonce(usr: address, nonce: uint256) view

Check whether the specified nonce for a user is valid (unused) for order authorization.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
usr address Address of the user whose nonce is being checked.✨ AI
nonce uint256 Nonce value to validate against the user's used nonces.✨ AI

Returns

Name Type Description
bool True if the nonce is valid (unused) for the user; false if it has been consumed or is invalid.✨ AI
nonces(address) view

Returns the current nonce for an address used when constructing signed orders.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
address

Returns

Name Type Description
uint256 The uint256 nonce associated with the address, used for signature replay protection.✨ AI
operators(address) view

Return the operator record for a given address.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
address

Returns

Name Type Description
uint256 Uint256 encoding operator metadata (permissions bitmask or expiry); zero means not an operator.✨ AI
orderStatus(bytes32) view

Return status for a given order: whether it is filled or cancelled and how much remains.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
bytes32

Returns

Name Type Description
isFilledOrCancelled bool isFilledOrCancelled: true if the order is fully filled or canceled, false otherwise.✨ AI
remaining uint256 remaining: remaining unfilled amount of the order (uint256, in order token units).✨ AI
parentCollectionId() view → 0x0000000000000000000000000000000000000000000000000000000000000000

Returns the parent collection identifier that links this exchange to its CTF-style parent market.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
bytes32 bytes32 parent collection id used to associate this exchange with the parent CTF collection.✨ AI
paused() view → false

Reports whether the Neg-Risk Exchange is paused.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
bool True if the exchange is paused, false if it is active.✨ AI
proxyFactory() view → 0xab45c5a4b0c941a2f231c04c3f49182e1a254052

Returns the address of the proxy factory used by this exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address Address of the proxy factory contract that deploys or manages exchange proxies.✨ AI
registry(uint256) view

Get a registry entry by index, returning the complement value and the conditionId for settlement.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
uint256

Returns

Name Type Description
complement uint256 complement: uint256 complement value used by the Neg-Risk mapping.✨ AI
conditionId bytes32 conditionId: bytes32 UMA condition identifier used by adapters for final settlement.✨ AI
safeFactory() view → 0xaacfeea03eb1561c4e67d661e40682bd20e3541b

Return the address of the Safe factory used by this exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Returns

Name Type Description
address The address of the Safe factory that deploys and manages safes used by the exchange.✨ AI
supportsInterface(interfaceId: bytes4) view

Check whether the exchange supports a given ERC-165 interface identifier.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

dev: Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

Name Type Description
interfaceId bytes4 ERC-165 interface identifier (bytes4) to check.✨ AI

Returns

Name Type Description
bool True if the contract implements the provided interface id, false otherwise.✨ AI
validateComplement(token: uint256, complement: uint256) view

Validates the complement of a tokenId

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
token uint256 - The tokenId
complement uint256 - The complement to be validated
validateOrder(order: tuple) view

order - The order to be validated

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets. Checks whether an order is structurally fillable before execution, including signature and exchange constraints.

Parameters

Name Type Description
order tuple
validateOrderSignature(orderHash: bytes32, order: tuple) view

Validates the signature of an order

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
orderHash bytes32 - The hash of the order
order tuple - The order
validateTokenId(tokenId: uint256) view

Validates that a tokenId is registered

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
tokenId uint256 - The tokenId

Write Functions

addAdmin(admin_: address) nonpayable

Adds a new admin Can only be called by a current admin

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
admin_ address - The new admin
addOperator(operator_: address) nonpayable

Adds a new operator Can only be called by a current admin

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
operator_ address - The new operator
cancelOrder(order: tuple) nonpayable

order - The order to be cancelled

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets. Prevents a signed order from being filled later; useful when a trader withdraws liquidity from a Polymarket market.

Parameters

Name Type Description
order tuple
cancelOrders(orders: tuple[]) nonpayable

orders - The set of orders to be cancelled

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets. Batch version of order cancellation for multiple signed Polymarket orders.

Parameters

Name Type Description
orders tuple[]
fillOrder(order: tuple, fillAmount: uint256) nonpayable

Fills an order

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
order tuple - The order to be filled
fillAmount uint256 - The amount to be filled, always in terms of the maker amount
fillOrders(orders: tuple[], fillAmounts: uint256[]) nonpayable

Fills a set of orders

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
orders tuple[] - The order to be filled
fillAmounts uint256[] - The amounts to be filled, always in terms of the maker amount
incrementNonce() nonpayable

Increment the caller's trading nonce to invalidate previously signed orders and prevent replay.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

matchOrders(takerOrder: tuple, makerOrders: tuple[], takerFillAmount: uint256, makerFillAmounts: uint256[]) nonpayable

Matches a taker order against a list of maker orders

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets. Core exchange entry point: matches signed Polymarket orders and moves collateral/outcome tokens for the active market path.

Parameters

Name Type Description
takerOrder tuple - The active order to be matched
makerOrders tuple[] - The array of maker orders to be matched against the active order
takerFillAmount uint256 - The amount to fill on the taker order, always in terms of the maker amount
makerFillAmounts uint256[] - The array of amounts to fill on the maker orders, always in terms of the maker amount
onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) nonpayable

Handle incoming ERC-1155 batch transfers of neg-risk outcome tokens to the exchange.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

dev: Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. NOTE: To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector).

Parameters

Name Type Description
address
address
uint256[]
uint256[]
bytes

Returns

Name Type Description
bytes4 `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
onERC1155Received(address, address, uint256, uint256, bytes) nonpayable

Handle an incoming ERC-1155 transfer used to settle a filled order in the Neg-Risk exchange flow.✨ AI

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

dev: Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. NOTE: To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector).

Parameters

Name Type Description
address
address
uint256
uint256
bytes

Returns

Name Type Description
bytes4 `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
pauseTrading() nonpayable

Pause trading on the Exchange

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

registerToken(token: uint256, complement: uint256, conditionId: bytes32) nonpayable

Registers a tokenId, its complement and its conditionId for trading on the Exchange

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
token uint256 - The tokenId being registered
complement uint256 - The complement of the tokenId
conditionId bytes32 - The CTF conditionId
removeAdmin(admin: address) nonpayable

Removes an existing Admin Can only be called by a current admin

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
admin address - The admin to be removed
removeOperator(operator: address) nonpayable

Removes an existing operator Can only be called by a current admin

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
operator address - The operator to be removed
renounceAdminRole() nonpayable

Removes the admin role for the caller Can only be called by an existing admin

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

renounceOperatorRole() nonpayable

Removes the operator role for the caller Can only be called by an exiting operator

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

setProxyFactory(_newProxyFactory: address) nonpayable

Sets a new Proxy Wallet factory for the Exchange

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
_newProxyFactory address - The new Proxy Wallet factory
setSafeFactory(_newSafeFactory: address) nonpayable

Sets a new safe factory for the Exchange

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Parameters

Name Type Description
_newSafeFactory address - The new Safe wallet factory
unpauseTrading() nonpayable

Unpause trading on the Exchange

Polymarket context On the Neg-Risk Exchange, this applies to multi-outcome markets.

Events

FeeCharged(receiver: address, tokenId: uint256, amount: uint256)

Emitted when a fee is charged

Name Type Indexed Description
receiver address
tokenId uint256
amount uint256
NewAdmin(newAdminAddress: address, admin: address)

Emitted when a new admin is added

Name Type Indexed Description
newAdminAddress address
admin address
NewOperator(newOperatorAddress: address, admin: address)

Emitted when a new operator is added

Name Type Indexed Description
newOperatorAddress address
admin address
OrderCancelled(orderHash: bytes32)

Emitted when an order is cancelled

Polymarket context A signed Polymarket order was invalidated before fill.

Name Type Indexed Description
orderHash bytes32
OrderFilled(orderHash: bytes32, maker: address, taker: address, makerAssetId: uint256, takerAssetId: uint256, makerAmountFilled: uint256, takerAmountFilled: uint256, fee: uint256)

Emitted when an order is filled

Polymarket context Primary exchange activity signal: a Polymarket order was matched on-chain.

Name Type Indexed Description
orderHash bytes32
maker address
taker address
makerAssetId uint256
takerAssetId uint256
makerAmountFilled uint256
takerAmountFilled uint256
fee uint256
OrdersMatched(takerOrderHash: bytes32, takerOrderMaker: address, makerAssetId: uint256, takerAssetId: uint256, makerAmountFilled: uint256, takerAmountFilled: uint256)

Emitted when a set of orders is matched

Name Type Indexed Description
takerOrderHash bytes32
takerOrderMaker address
makerAssetId uint256
takerAssetId uint256
makerAmountFilled uint256
takerAmountFilled uint256
ProxyFactoryUpdated(oldProxyFactory: address, newProxyFactory: address)
Name Type Indexed Description
oldProxyFactory address
newProxyFactory address
RemovedAdmin(removedAdmin: address, admin: address)

Emitted when an admin is removed

Name Type Indexed Description
removedAdmin address
admin address
RemovedOperator(removedOperator: address, admin: address)

Emitted when an operator is removed

Name Type Indexed Description
removedOperator address
admin address
SafeFactoryUpdated(oldSafeFactory: address, newSafeFactory: address)
Name Type Indexed Description
oldSafeFactory address
newSafeFactory address
TokenRegistered(token0: uint256, token1: uint256, conditionId: bytes32)

Emitted when a token is registered

Name Type Indexed Description
token0 uint256
token1 uint256
conditionId bytes32
TradingPaused(pauser: address)
Name Type Indexed Description
pauser address
TradingUnpaused(pauser: address)
Name Type Indexed Description
pauser address