How WagerWinz Works

  • Creating a Challenge

    1. Go to the Create page and connect your wallet to the website with the sepolia testnet network.
    2. Create a challenge using the Challenge Creator form.The challenge is created using a ChallengeFactory contract and the details of the contract are available on the Create page.
    3. Following parameters are required to create a challenge:
      • Entry Fee -- The fee which will be deposited to the contract upon creation. The challenger will have to pay the same entry fee.
      • Challenge Lock Time -- Anyone can challenge the creator till the lock time if the challenge has not been accepted already. Challenge can be cancelled by the creator if it has not been accepted yet or if the it has not been accepted by the lock time.
      • Your Prediction -- Enter your prediction of ETH/USD. This value cannot be changed later and will be used to determine the winner against the ETH/USD price feed value from chainlink when the challenge is settled.
      • Challenge Settlement Start Time -- The time at which the settlement period starts. If the challenge has been accepted, the challenge can be settled by anyone for a small incentive during the settlement period. The settlement end time is calculated from the start time by the Factory contract.
    4. The above parameters will be validated by the Factory contract and upon successful creation, the challenge details will be displayed on the same page. Please copy and save the address of the challenge contract as this value is not stored anywhere (there is no backend) except the ethereum blockchain (Can be found through transaction logs on something like etherscan.)
    5. Share the challenge address with someone so that they can challenge you!
  • Accepting a Challenge

    1. Go to the View page and connect your wallet to the website with the sepolia testnet network.
    2. Enter the address of the challenge contract and click on the fetch button in the Challenge Details section. This should fetch all the contract details if the challenge contract address is valid.
    3. The Entry Fee for accepting the challenge is already fixed when the challenge contract is created.
    4. Enter Your Prediction of ETH/USD during the settlement period (available in the Challenge Details section along with other info). This value cannot be changed later and will be used to determine the winner against the ETH/USD price feed value from chainlink when the challenge is settled.
    5. Upon sending the Accept transaction, the challenge contract will validate the transaction based on your input parameters and existing state of the contract and update the Challenge details upon success.
  • Settling a Challenge

    1. Go to the View page and connect your wallet to the website with the sepolia testnet network.
    2. Enter the address of the challenge contract and click on the fetch button in the Challenge Details section. This should fetch all the contract details if the challenge contract address is valid.
    3. Based on the state of the contract and settlement period, anyone can send a settle transaction for a small incentive.
    4. The settle transaction will validate the contract state and settle the challenge if the settlement period has started and the contract is not already settled. The price of ETH/USD from chainlink will be used to determine the winner and the contract will be updated accordingly.
    5. The creator can also cancel the challenge from here provided that:
      • The challenge has not been accepted yet.
      • The creator is the one sending the cancel transaction.
    6. Upon successful cancellation, the entry fee will be refunded to the creator.
  • Withdrawing from the Challenge

    1. Go to the View page and connect your wallet to the website with the sepolia testnet network.
    2. Enter the address of the challenge contract and click on the fetch button in the Challenge Details section. This should fetch all the contract details if the challenge contract address is valid.
    3. Only the creator and/or the challenger can withdraw ETH from the challenge contract based on the following conditions:
      • If the challenge has been settled, only the winner can withdraw the winnings (Remaining value locked in the contract).
      • If the challenge has not been settled, and the settlement period has not ended, neither participants can withdraw their entry fee and must wait for either the challenge to be settled (or settle it themselves) or the settlement period to end.
      • If the challenge has not been settled till the settlement end time, i.e. the challenge expired without settlement, both participants can withdraw their entry fee only once by sending the withdraw transaction.
WagerWinz

© 2023 WagerWinz. All rights reserved.

App

CREATEVIEWHOW IT WORKS