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.
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!
- 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. ๐ป
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. ๐
Curious about your bets? Use getBuyPrice()
and getSellPrice()
to check your stakes in the great Ethereum gamble. ๐ต๏ธโโ๏ธ
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! ๐
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.
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()
- Initializes the contract, mints 1,000,000
OPTION
tokens to the contract itself, and sets up the Uniswap WETH/USDT pair for price checking.
- Initializes the contract, mints 1,000,000
eth_price_check()
- ๐ Returns the current ETH price based on the Uniswap WETH/USDT pair's reserves.
-
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.
- ๐ 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
-
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 theSellPrice
. - ๐ Emits a
SellPriceSet
event.
- ๐ป Allows a user to bet on the decrease of ETH's price. Similar to
-
getBuyPrice()
- ๐ Returns the
BuyPrice
set by the calling user, if it exists.
- ๐ Returns the
-
getSellPrice()
- ๐ Returns the
SellPrice
set by the calling user, if it exists.
- ๐ Returns the
-
fallback()
- A fallback function to handle ETH sent directly to the contract.
-
receive()
- A receive function to handle plain ETH transfers to the contract.
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).
This contract employs ReentrancyGuard
from OpenZeppelin to prevent reentrancy attacks, a common vulnerability in smart contracts dealing with financial transactions.
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.