Feeling Lucky User Guide

Introducing Feeling Lucky

The Feeling Lucky system utilizes smart contracts to operate a transparent, fair, and decentralized game directly on the Base blockchain, ensuring the establishment of trust and maintenance of integrity. This system is structured around a sequence of 'rounds', with each round representing a distinct game iteration.

Participants have the opportunity to enter these rounds by placing deposits (ETH, ERC-721 or ERC-20 tokens). The probability of a participant winning is directly proportional to the portion of the total pool they have deposited. Each deposit value is calculated, and each participant is allocated a number of entry spots proportional to the value deposited. Winners are selected at the end of each round.

The Feeling Lucky contract depends on several external oracles: Chainlink for ensuring fair randomness, Reservoir for ERC-721 pricing information, and Uniswap for ERC-20 pricing data.

Please note: The valuation of all NFTs is the floor price of the collection; rarity is not taken into consideration.

Frequently Asked Questions (FAQ)

1.How does the Feeling Lucky system manage participant deposits?

The value of a participant's deposit is acquired either directly for ETH or through one of the external oracles for ERC-20/ERC-721 tokens. Once the value is established, it is divided by the contract's defined ValuePerEntry. Subsequently, the depositor is allocated a corresponding number of entries. This ensures that each depositor's number of entries aligns with the total value of their deposited assets.

Please note:

  1. The valuation of all NFTs is the floor price of the collection; rarity is not taken into consideration.

  2. An ERC-20 token price is determined by relying on the Uniswap oracle. The Feeling Lucky contract requests the TWAP (time-weighted average price) from Uniswap.

  3. An ERC-721 token 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).

2.Are the prices fetched at each deposit?

The price will be fetched only when a collection or currency (tokenAddress) is deposited for the first time. Then the same value will be used for the duration of the round if more of those assets are deposited.

3.How does a round completes?

A round completes when the time has elapsed and there are at least two participants, or when the maximum number of participants or deposits per round is reached; whichever occurs first.

4.How is the winner of a round selected?

The winner is selected based on a provably fair random number generated by the Chainlink oracle. This ensures that the drawing process is fair and resistant to manipulation. For more details, see the Chainlink VRF Documentation .

For each request, Chainlink VRF generates a random values and cryptographic proof of how the value were determined. The proof is published and verified on-chain. This process ensures that results cannot be tampered with or manipulated by any single entity including oracle operators, validators, users, or smart contract developers.

The random number serves to determine the winning entry, and the depositor associated with that entry is the winner of the round.

For more details, see the Chainlink VRF Documentation.

5.How does the contract interact with external oracles?

The Feeling Lucky contract relies on 3 external oracles:

  • The Chainlink 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 Feeling Lucky round?

A round starts in the Open status, where it can accept new deposits. Once the cutoff time is reached, the round progresses to the Drawing status while waiting for the Chainlink oracle to provide the randomness requested.

Once Chainlink fulfils the request, the round moves to the Drawn status and a winner is declared. If certain conditions aren't met, the round can be Cancelled.

Reasons for a round being cancelled are:

  • There were less than two participants when the cutoff time was reached.

  • The randomness request sent to Chainlink has not been fulfilled within 12 minutes.

As soon as a round is completed (Drawn) or cancelled (Cancelled) a new one will start.

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

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

8.What happens when a round is cancelled?

If a round is cancelled, the system will immediately start a new round. The depositors will be able to withdraw their deposits on any cancelled round.

Reasons for a round being cancelled are:

  • There were less than two participants when the cutoff time was reached.

  • The randomness request sent to Chainlink has not been fulfilled within 12 minutes.

Last updated