Architecture

The OnlyDancers smart contract architecture is built on the FoomD2E.sol program deployed on Ethereum mainnet. The architecture enables creators to fund campaigns with variable tier rewards, dancers to enter contests with transparent payouts, and the FOOM team to maintain upgradeable infrastructure while preserving campaign integrity and user funds.

1

Campaign Creation

Creators initiate a campaign by depositing USDC into the FoomD2E smart contract. The contract locks the creator's deposit amount, immutably records the tier structure (16 tiers with specific reward amounts and winner counts), and assigns the campaign a unique identifier. The campaign state is fully on-chain and cannot be modified once created.

2

Entry Fee Collection

Dancers pay a $5 USD entry fee through Stripe, which aggregates all entry fees off-chain. The FOOM backend bridges collected entry fees as USDC to the smart contract, adding them to the campaign's prize pool. The prize pool grows in real-time as more dancers enter.

3

Tier Rewards

The FoomD2E contract maintains an immutable tier array specifying reward amounts for each tier (e.g., 1st Place: 500 USDC, 2nd Place: 300 USDC, etc.). Positions beyond explicitly defined tiers automatically receive an equal share of the remaining pool balance, ensuring no prize goes unclaimed and maintaining variable rewards across all 1,838 winner positions.

4

Position-Based Payouts

As campaign results are finalized and judges or voting determines dancer rankings, the contract executes payouts using a position-to-reward mapping. The 1st ranked dancer receives the 1st Place tier reward in USDC, the 2nd receives the 2nd Place reward, and so on. All payouts execute atomically on-chain, creating an immutable record of each dancer's earnings.

5

Admin Withdrawal

After campaign results are fully distributed and all tiers paid out, the campaign creator can invoke a withdrawal function to claim any remaining dust (unclaimed tier amounts or rounding remainders). This ensures funds are returned to creators and prevents pool waste while maintaining audit transparency.

6

UUPS Upgradeable

The FoomD2E contract uses the Universal Upgradeable Proxy Standard (UUPS) pattern, allowing the FOOM team to deploy contract improvements without affecting existing campaign data or user funds. The proxy pattern ensures all campaign state persists across upgrades while enabling new features and security patches.

7

Role-Based Access

The contract implements OpenZeppelin AccessControl with DEFAULT_ADMIN_ROLE (held by the FOOM team) and RELAYER_ROLE (for off-chain services). DEFAULT_ADMIN can upgrade the contract and manage roles. RELAYER_ROLE submits validated campaign results and executes payouts, ensuring governance remains decentralized through role separation.

8

Token Whitelisting

Only approved ERC20 tokens—currently USDC on Ethereum mainnet—can be used as campaign reward tokens. The contract maintains a whitelist that prevents unsupported or low-liquidity tokens from being used, ensuring all payouts are in stable, liquid currency.

circle-info

Campaign state is immutable once created. Tier amounts, winner counts, and prize pools are locked on-chain and cannot be changed, ensuring dancers always know their earning potential before entering

Summary

Creators deposit USDC and define campaign tiers when initializing a campaign (1), which the contract locks immutably on-chain. Dancers pay entry fees through Stripe, which are bridged as USDC to add to the prize pool (2). The contract maintains 16 tiered reward brackets with variable amounts, distributing prizes fairly across all placements (3). As results finalize, position-based payouts execute atomically on-chain, ensuring each dancer receives their USDC reward based on ranking (4). Campaign creators can withdraw remaining dust after all prizes distribute (5). The contract uses UUPS upgradeable pattern to enable protocol improvements while preserving all campaign and payout history (6). Role-based access separates admin functions from relayer operations, allowing off-chain governance to submit verified results (7). Token whitelisting restricts payouts to approved stablecoins like USDC, maintaining liquidity and stability across the network (8).