Skip to content

SakshiShah29/Cursed-Takes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ CursedTakes: The Opinion Casino

Welcome to CursedTakes - where controversial opinions become valuable assets in a high-stakes prediction market. This isn't your typical prediction platform; it's a battleground for the hottest takes, wildest opinions, and most divisive debates on the internet.

๐Ÿ”ฅ A prediction market for the bold, the controversial, and the cursed

In this unique ecosystem, you don't just predict outcomesโ€”you bet on the court of public opinion. From food debates to pop culture controversies, every hot take has a price, and every opinion could be your ticket to rewards.

View on Block Explorer

๐ŸŽฒ The CursedTakes Difference

  • Opinion-Based Markets: Trade on subjective, controversial, and often humorous debates
  • Simple Yes/No Format: No complex options, just pure binary predictions
  • Winner-Takes-Most: The majority opinion splits the pot from the losing side
  • Fixed Entry Fee: Equal stakes for all participants
  • Time-Limited Debates: Quick, engaging prediction windows keep the action fresh

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

๐ŸŽฎ Game Mechanics

๐Ÿค” What is CursedTakes?

CursedTakes is a prediction market game where players can stake on the outcome of various events, from crypto prices to pop culture moments. It's a fun, engaging way to test your predictive skills against others in the community.

๐ŸŽฒ How to Play

  1. Create a Poll

    • Pose a yes/no question (e.g., "Will Bitcoin hit $100K by 2025?")
    • Set a duration for the poll (how long voting will be open)
    • Define a voting fee (the amount users need to pay to vote)
  2. Vote on Predictions

    • Browse active polls
    • Stake your ETH to vote 'Yes' or 'No'
    • The more you stake, the higher your potential rewards
  3. Earn Rewards

    • When a poll ends, the winning side shares the prize pool
    • Your rewards are proportional to your stake
    • The earlier you vote, the higher your potential multiplier
  4. Special Features

    • Cursed Mode: Double-or-nothing side bets
    • Streaks: Consecutive correct predictions earn bonus rewards
    • Leaderboards: Compete with other players for the top spot

๐Ÿ† Why Play?

  • Earn ETH by making accurate predictions
  • Prove your knowledge in various topics
  • Engage with the community through discussions and debates
  • No minimum stake - play with as little as you want

๐ŸŽฏ Game Modes

  1. Quick Takes: Short-term predictions (hours/days)
  2. Seasonal Events: Special themed prediction events
  3. High Stakes: For the bold - higher risks, higher rewards
  4. Community Challenges: User-created prediction contests

๐Ÿš€ Features

  • Create Polls: Users can create prediction polls with custom questions, duration, and voting fees
  • Vote with Stakes: Participants can vote on active polls by staking ETH
  • Earn Rewards: Win rewards by correctly predicting outcomes
  • Decentralized: Fully on-chain with smart contract logic
  • Responsive UI: Mobile-friendly interface built with Tailwind CSS

๐Ÿ›  Tech Stack

Smart Contracts

  • Solidity: For writing smart contracts
  • Foundry: For development and testing
  • Hardhat: Alternative development environment

Frontend

  • Next.js: React framework for server-rendered applications
  • TypeScript: For type-safe code
  • wagmi: React Hooks for Ethereum
  • RainbowKit: For wallet connection
  • Tailwind CSS: For styling
  • viem: TypeScript interface for Ethereum

๐Ÿ“ฆ Prerequisites

  • Node.js (v18 or later)
  • npm or yarn
  • Foundry (for smart contract development)
  • MetaMask or any Web3 wallet

๐Ÿš€ Getting Started

Smart Contracts

  1. Install Foundry:

    curl -L https://foundry.paradigm.xyz | bash
    foundryup
  2. Install dependencies:

    forge install
  3. Compile contracts:

    forge build
  4. Run tests:

    forge test

Frontend

  1. Navigate to the frontend directory:

    cd cursed-takes-frontend
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Create a .env.local file in the frontend directory with:

    NEXT_PUBLIC_CONTRACT_ADDRESS=your_contract_address_here
    NEXT_PUBLIC_RPC_URL=your_ethereum_rpc_url
    
  4. Start the development server:

    npm run dev
    # or
    yarn dev
  5. Open http://localhost:3000 in your browser

๐Ÿ“ Smart Contract Overview

Main Contract: CursedTakes.sol

  • createPoll: Create a new prediction poll
  • vote: Vote on an active poll
  • finalizePoll: Finalize a poll after it ends
  • claimWinnings: Claim rewards from a finalized poll
  • extendPoll: Extend the duration of a poll

๐Ÿ“ฑ Frontend Structure

  • /app: Next.js app router pages
  • /components: Reusable React components
  • /contracts: Contract ABIs and addresses
  • /hooks: Custom React hooks
  • /styles: Global styles and Tailwind configuration

๐Ÿงช Testing

Smart Contracts

Run tests with:

forge test -vvv

Frontend

Run tests with:

npm test
# or
yarn test

๐ŸŒ Deployment

Smart Contracts

  1. Deploy to a testnet:
    forge script script/Deploy.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

Frontend

Deploy to Vercel or Netlify with environment variables set.

๐Ÿค Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with โค๏ธ using Foundry and Next.js
  • Inspired by prediction markets like Augur and Polymarket

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •