Constructor Parameters
TheUmaCtfAdapter contract takes three constructor parameters:
src/UmaCtfAdapter.sol
Parameters
The Conditional Token Framework contract address
When deploying for negative risk markets, this should be the
NegRiskOperator contract address instead of the standard CTF contract.The UMA Finder contract addressThe Finder is UMA’s registry contract that stores addresses of all UMA protocol contracts. The adapter uses it to locate the
CollateralWhitelist.The UMA Optimistic Oracle V2 contract addressThis is the oracle that provides resolution data for markets.
Environment Variables
Create a.env file in the project root for deployment configuration:
.env.example
Variable Descriptions
Private key of the deployer account
Address that will be granted admin privilegesThe admin can pause/unpause markets, flag markets for manual resolution, and perform emergency functions.
Conditional Tokens Framework contract addressSame as the
_ctf constructor parameter.UMA Finder contract addressSame as the
_finder constructor parameter.UMA Optimistic Oracle V2 contract addressSame as the
_oo constructor parameter.RPC endpoint for the target networkExamples:
- Polygon:
https://polygon-rpc.com - Mumbai:
https://rpc-mumbai.maticvigil.com
API key for contract verificationUsed to verify contracts on Polygonscan or other block explorers.
UMA Contract Addresses
The UMA protocol maintains deployments on various networks. You’ll need the following contract addresses:Required UMA Contracts
Finder
Finder
The Finder contract is UMA’s central registry. All other UMA contract addresses can be discovered through the Finder.The adapter uses the Finder to locate:
CollateralWhitelist: List of approved collateral tokensOptimisticOracleV2: The oracle contract (also passed directly to constructor)
OptimisticOracleV2
OptimisticOracleV2
The Optimistic Oracle V2 is UMA’s oracle that enables markets to resolve via optimistic dispute resolution.Key features:
- Proposers submit resolution data
- 2-hour default liveness period for disputes
- Falls back to DVM if disputes occur
CollateralWhitelist
CollateralWhitelist
Retrieved automatically via the Finder. Lists approved ERC20 tokens that can be used for:
- Reward payments to proposers
- Bond requirements for proposals/disputes
Finding UMA Addresses
Refer to UMA’s official documentation for contract addresses on your target network:Deployment Script
The repository includes a deployment script atdeploy/scripts/deploy_adapter.sh:
deploy/scripts/deploy_adapter.sh
- Loads environment variables from
.env - Displays deployment parameters
- Deploys the adapter using Forge
- Extracts and displays the deployed adapter address
Constants
The adapter includes several important constants:src/UmaCtfAdapter.sol
These constants are hardcoded and cannot be changed after deployment.
Next Steps
View Deployments
See official deployments on Polygon, Mumbai, and Amoy
Initialize Markets
Learn how to initialize prediction markets