Skip to main content
This guide walks you through setting up your development environment for the UMA CTF Adapter project.

Prerequisites

The UMA CTF Adapter uses Foundry as its development framework. Foundry is a fast, portable, and modular toolkit for Ethereum application development.

Install Foundry

To install Foundry, run:
curl -L https://foundry.paradigm.xyz | bash
foundryup
Foundry has daily updates. Run foundryup regularly to update forge and cast to the latest versions.

Clone the Repository

Clone the repository with submodules:
git clone https://github.com/Polymarket/uma-ctf-adapter.git --recurse-submodules
cd uma-ctf-adapter
Make sure to use the --recurse-submodules flag to pull in all dependencies.

Install Dependencies

Update Forge dependencies:
forge update
This will install all required Solidity dependencies, including:
  • OpenZeppelin contracts
  • UMA Protocol contracts
  • Conditional Tokens Framework

Build Contracts

Compile the smart contracts:
forge build
The build output will be written to the out/ directory. The project is configured with the following compiler settings:
  • Solidity version: 0.8.15
  • Optimizer runs: 1,000,000
  • Gas reports enabled

Build Configuration

The project’s build configuration is defined in foundry.toml:
[profile.default]
solc = "0.8.15"
ffi = true
fs_permissions = [{ access = "read", path = "./artifacts/"}]
gas_reports = ["*"]
out = "out"
optimizer_runs = 1000000

Run Tests

Execute the test suite:
forge test

Verbose Test Output

For detailed stack traces when tests fail, use the -vvv flag:
forge test -vvv
Verbosity levels:
  • -v: Show test results
  • -vv: Show logs
  • -vvv: Show stack traces for failed tests
  • -vvvv: Show stack traces for all tests and setup
  • -vvvvv: Show full traces including internal calls

Fuzz Testing

The project includes fuzz testing configuration:
[profile.default.fuzz]
runs = 256

[profile.intense.fuzz]
runs = 10_000
Run intensive fuzz tests with:
FOUNDRY_PROFILE=intense forge test

Verify Setup

To verify your environment is correctly configured, run:
forge build && forge test
If both commands complete successfully, your development environment is ready.

Next Steps

Configuration

Learn about constructor parameters and environment variables

Deploy Contract

View official deployments and deploy to your own network

Build docs developers (and LLMs) love