Skip to main content

YOLO Technical Overview

info

Blast Gold Receiver: 0x0000000000E14E87e5c80A8A90817308fFF715d3

Blast Points Operator: 0x4066b9BD584b5FA88897194dAbE3a37883AC35F7

The YOLO game operates on a set of smart contracts designed to provide a transparent, fair, and decentralized game experience. These are YoloV2, the main game contract, and PriceOracle a secondary component used to retrieve the TWAP price in ETH from Uniswap V3 pools for ERC-20 tokens.

The game progress by rounds which run sequentially with at most one round running at any given time. A round can have one of a set of statues (None, Open, Drawing, Drawn, Cancelled):

  • None: The round has no status, this applies to future rounds with deposits.
  • Open: The current round, players can join.
  • Drawing: The cutoff time has been reached and there were at least two players.
  • Drawn: The VRF response has been used to determine the winner. A new round opens.
  • Cancelled: Only one player joined the round. A new round opens.

The current round will remain in a open but pending state until at least one player joins. Once at least one player has joined the current round, then the cutoff time is set. If the round does not have at least 2 players before the cutoff time is reached, then the round will be cancelled and the following round will open and it will work in the same way. Players can choose to enter multiple future rounds when depositing on the current round.

The contract is designed to handle deposits of a variety of asset types (ETH, ERC-721, ERC-20). The contract owner can add and remove allowed assets, therefore not all asset types will necessarily be available at any given time, and only selected contracts for each type will be allowed as deposits. The players can then withdraw, claim or rollover (ETH only) their deposits if they won or a round was cancelled.

If the current round has at least two players when the cutoff time is reached then the winner is selected by requesting a random value using Gelato VRF. The likelihood of a participant winning is equivalent to the share of the total pot they deposited.

NOTE: All NFTs in a collection will be valued at the floor price of the collection; rarity is not accounted for.

For a more technical overview of the contract, see the YOLO Contract Overview

Frequently Asked Questions (FAQs)

1. How are player's deposits handled?

The value of each deposit is either 1:1 for ETH or we get the TWAP price in ETH from Uniswap V3 pools for ERC-20s. Once the value is determined, it gets divided by the valuePerEntry defined in the contract, the result is the number of entries for that specific deposit, which will be added to the current entriesCount of the player.

This way, each player has a number of entries proportional to the total value of the assets deposited.

2. When does a round end?

A round will remain open indefinitely until there is at least one deposit. Once the first deposit is executed the round's cutoff time will be set. A round end when the cutoff time is reached, or when the maximum number of players/deposits per round is reached; whichever occurs first.

When the cutoff time is reached, if at least two players joined the round, then the round will be successful and a winner will be selected. Otherwise, the round will be cancelled.

3. How is the winner of a round selected?

The winner is selected based on a provably fair random number we obtain via Gelato VRF, which is powered by drand. This ensures that the drawing process is provably-fair, decentralized and resistant to manipulation.

The random value we obtain via Gelato VRF is then used to select the winning entry, and the player associated with that entry is the winner of the round.

For more details on how the drand beacon works see the Drand Documentation.

4. How does the YOLO drawing process ensure fairness?

The contract employs Gelato's Verifiable Random Function (VRF) to generate a provably fair random number for a YOLO’s round draw. This ensures that the process is fair, transparent, and tamper-proof.

For more details, see the Gelato VRF Documentation and the Drand Documentation.

5. What external oracles does the contract relies upon?

The YOLO contract relies on 3 external oracles:

  • The Gelato VRF oracle to request a provably fair random value.
  • The Reservoir oracle to validate the collection floor price for an ERC-721.
  • The Uniswap oracle to get the price of an ERC-20.

6. What is the lifecycle of a YOLO round?

The current round starts in the OPEN status and will remain open indefinitely without any cutoff time. This will continue until a player deposit into the round. Once that occurs, the cutoff time is set.

Once the cutoff time is set, the current round will remain open until at least one "round-end" condition is met (for more details, see When does a round end?).

If the round was successful, the status progresses to DRAWING where a randomness request is sent to Gelato VRF. Once we get a response, the round status then progresses to DRAWN and the winner is determined using the random value obtained from the VRF. A new round then opens.

If the round was not successful, the status progresses to CANCELLED and a new round then opens.

7. What happens if a round does not have enough players within the expected time frame?

If a round doesn't reach at least 2 distinct players by the cutoff time, the round will be cancelled.

8. What happens when a round is cancelled?

If a round is cancelled, the contract will immediately start a new round. The players will then be able to withdraw or rollover (ETH only) their deposits. Reasons for a round being cancelled are:

  • There were less than two players when the cutoff time was reached.
  • The randomness request sent to Gelato VRF has not been fulfilled within 1 day.

9. How is the price for an ERC-20 token determined?

An ERC-20 token price is determined by relying on the Uniswap oracle.

The TWAP (time-weighted average price) from Uniswap V3 pools via the PriceOracle contract.

10. How is the price for an ERC-721 token determined?

The asset’s price is determined by relying on the Reservoir oracle to validate the collection floor price on-chain. The necessary data can be retrieved via their API (see get collection floor with the configurations set to 1 day TWAP). Then the contract verifies the signature to ensure Reservoir provided the data and that the request is not expired (older than signatureValidityPeriod).

NOTE: All NFTs in a collection will be valued at the floor price of the collection; rarity is not accounted for.

11. Are the prices fetched at each deposit?

The price of a deposited token will be fetched only when the specific token (tokenAddress) is deposited for the first time. Then the same value will be used for the duration of the round for all future deposits of a given token.

12. Is the contract audited?

The YOLO smart contracts has been rigorously audited by a reputable third-party auditor to ensure the highest level of safety and reliability. The audit assesses the contract for potential vulnerabilities and compliance with best practices in the blockchain industry.

Audit Report:

Sherlock Audit: https://audits.sherlock.xyz/contests/163/report