Skip to content

Options allows users to bet on the increase or decrease of ETH's price, using the WETH/USDT pair from Uniswap for price reference.

Notifications You must be signed in to change notification settings

wyc-dev/Options

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Welcome to Options! 🎲🚀

Embark on an exhilarating journey into the world of Ethereum price speculation with our cutting-edge Options Contract! 🌍💹 Whether you're a seasoned trader or a crypto newbie, this game offers a thrilling way to engage with the ever-fluctuating tides of the Ethereum market.

Ride the Wave of Ethereum! 🌊

Do you have a knack for predicting market trends? Place your bet on Ethereum's future: will it soar 🚀 or plummet? 📉 With our Options Contract, you get to test your market intuition. Buy low, sell high, and see if fortune favors your foresight!

Place Your Bets! 🎰

  • Going Up? 📈 Bet on Ethereum's price increase by sending just 0.01 ETH to the contract. If you're right, you could win a whopping 90% of the contract's ETH stash! 🤑
  • Or Down? 📉 Feeling bearish? Bet on a price decrease and stand a chance to win big if the market dips. 🐻

Win Big or Win Consolation Tokens! 🎉

Winning bets earn a hefty reward, but fear not if Lady Luck isn’t on your side – consolation $OPTION tokens await to soothe your speculative spirit. 🌟

Check Your Status 📊

Curious about your bets? Use getBuyPrice() and getSellPrice() to check your stakes in the great Ethereum gamble. 🕵️‍♂️

Safe and Secure 🛡️

Rest easy knowing that your bets are safeguarded by the robust OpenZeppelin ERC20 standard and ReentrancyGuard. Your adventure in Ethereum speculation is not just thrilling but also secure! 🔐

Join the Game of Ethereum Speculation! 🎮

Get ready to dive into the riveting world of crypto betting with our Options Contract. Who knows, you might just be the next big winner in the Ethereum market! 🏆

Disclaimer: This is a speculative game intended for entertainment and educational purposes. Please ensure responsible betting and remember to audit smart contracts thoroughly for real-world use. ⚠️📚

Contract Functions 🛠️

The Options smart contract is an ERC20 token designed for speculative betting on Ethereum's price movement. It allows users to bet on the increase or decrease of ETH's price, using the WETH/USDT pair from Uniswap for price reference. This contract is built on Solidity and leverages OpenZeppelin's ERC20 standard and ReentrancyGuard for enhanced security and functionality.

Constructor 🏗️

  • constructor()
    • Initializes the contract, mints 1,000,000 OPTION tokens to the contract itself, and sets up the Uniswap WETH/USDT pair for price checking.

View Functions 👀

  • eth_price_check()
    • 📈 Returns the current ETH price based on the Uniswap WETH/USDT pair's reserves.

Transaction Functions 💰

  • buy()

    • 📊 Allows a user to bet on the increase of ETH's price. When called, it requires the user to send 0.01 ETH and records the current ETH price as the user's BuyPrice.
    • 📝 Emits a BuyPriceSet event.
  • sell()

    • 🔻 Allows a user to bet on the decrease of ETH's price. Similar to buy(), it requires 0.01 ETH and records the current price as the SellPrice.
    • 📝 Emits a SellPriceSet event.

Getter Functions 📚

  • getBuyPrice()

    • 📌 Returns the BuyPrice set by the calling user, if it exists.
  • getSellPrice()

    • 📌 Returns the SellPrice set by the calling user, if it exists.

Fallback and Receive Functions 🚨

  • fallback()

    • A fallback function to handle ETH sent directly to the contract.
  • receive()

    • A receive function to handle plain ETH transfers to the contract.

Game Mechanics 🎮

Users of this contract can speculate on Ethereum's price movement. By calling buy() or sell(), users bet on the price going up or down, respectively. The contract uses the Uniswap WETH/USDT pair to determine the current price of ETH and compares it with the user's bet. Successful predictions can be integrated with reward mechanisms (not implemented in this contract).

Security Measures 🔒

This contract employs ReentrancyGuard from OpenZeppelin to prevent reentrancy attacks, a common vulnerability in smart contracts dealing with financial transactions.

Disclaimer ⚠️

This contract is a demonstration of ERC20 token functionality and speculative betting mechanics. Users should exercise caution and understand the risks involved in blockchain-based betting. The contract should be thoroughly audited before any real-world implementation.


About

Options allows users to bet on the increase or decrease of ETH's price, using the WETH/USDT pair from Uniswap for price reference.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published