Skip to main content

Contract Deployments

The Polymarket CTF Exchange is deployed on multiple networks for production and testing purposes.

Production Deployments

Polygon Mainnet

Network: Polygon (Chain ID: 137)Contract Address: 0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982EExplorer: View on PolygonScanThis is the primary production deployment used by Polymarket for live trading.

Testnet Deployments

Amoy Testnet

Network: Amoy (Polygon Testnet)Contract Address: 0xdFE02Eb6733538f8Ea35D585af8DE5958AD99E40Explorer: View on Amoy PolygonScanThis deployment is used for testing and development purposes.

Deployment Details

Polygon Mainnet Configuration

The Polygon mainnet deployment was initialized with the following constructor parameters:
ParameterAddressDescription
Collateral Token0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174USDC on Polygon
CTF Contract0x4D97DCd97eC945f40cF65F87097ACe5EA0476045Conditional Tokens Framework
Proxy Factory0xaB45c5A4B0c941a2F231C04C3f49182e1A254052Gnosis Safe Proxy Factory
Safe Factory0xaacFeEa03eb1561C4e67d661e40682Bd20E3541bGnosis Safe Factory
The exchange contract automatically approves the CTF contract to spend unlimited USDC, enabling efficient minting operations.

Deployment Process

The deployment followed these steps:
  1. Contract Creation: Deploy CTFExchange with constructor parameters
  2. Admin Setup: Add authorized administrator address
  3. Operator Setup: Add authorized operator address
  4. Role Renunciation: Deployer renounces admin and operator roles
  5. Verification: Verify contract source code on block explorer
The deployer address renounced all privileged roles after setup, transferring full control to the designated admin and operator addresses.

Contract Information

Version

The deployed contracts are built with:
  • Solidity Version: 0.8.15
  • License: MIT
  • Contract Name: CTFExchange

Dependencies

The exchange integrates with:

Security

Audit

Chainsecurity Audit

The CTF Exchange has been professionally audited by Chainsecurity.View Audit Report

Immutability

The core exchange logic is immutable after deployment. However, administrators retain the following capabilities:
  • Add/remove operators
  • Add/remove administrators
  • Pause/unpause trading
  • Register new token complements
  • Update proxy factory addresses
These admin functions are necessary for operational flexibility but do not allow modification of core trading logic or user funds.

Network Information

Polygon Mainnet

Amoy Testnet

Interacting with Deployments

Using Web3 Libraries

import { ethers } from 'ethers';

const EXCHANGE_ADDRESS = '0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E';
const provider = new ethers.providers.JsonRpcProvider('https://polygon-rpc.com');

const exchange = new ethers.Contract(
  EXCHANGE_ADDRESS,
  CTFExchangeABI,
  provider
);

Using Foundry

# Cast call to read contract state
cast call 0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E \
  "isValidNonce(address,uint256)" \
  "0xYourAddress" \
  "1" \
  --rpc-url https://polygon-rpc.com
For testing purposes, use the Amoy testnet deployment to avoid spending real MATIC on transaction fees.

Source Code

The complete source code is available on GitHub:

GitHub Repository

View the full source code, tests, and deployment scripts on GitHub

Building from Source

To build and test the contracts locally:
# Clone the repository
git clone https://github.com/Polymarket/ctf-exchange.git
cd ctf-exchange

# Install Foundry (if not already installed)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Run tests
forge test

# Run tests with verbosity
forge test -vvv
The project uses Foundry for development and testing. Make sure to run foundryup regularly to keep your Foundry installation up to date.

Build docs developers (and LLMs) love