CRYPTO NEWS

Generating Randomized Start Index for TokenIds in a NFT Contract

I’ve recently started exploring and learning Solidity and have been looking at contracts of some of the famous NFT projects.

One common pattern that I’ve found is that most of them set a ProvenanceHash before mint and randomize the startingTokenIndex after the mint is complete.

Here’s code snippet from one of them

function finalizeStartingIndex() public     {         require(starting_index == 0, "Starting index already set");         require(starting_index_block != 0, "Starting index block not set");          starting_index = uint256(blockhash(starting_index_block)) % max_token_supply;          if (block.number.sub(starting_index_block) > 255)         {             starting_index = uint256(blockhash(block.number-1)) % max_token_supply;         }          if (starting_index == 0)         {             starting_index = starting_index.add(1);         }     } 

I understand what a Provenance Hash is and the need to randomize the starting index, but I am having a hard time understanding how this actually works in the contract.

In the above snippet the starting_index variable is set, but I could not find its usage anywhere within the contract apart from some guard conditions.

So how does it actually achieve the intended assignment of random tokenIds?

Shouldn’t it be used somewhere we actually store/return the ownership or tokenUri or something? or am I missing some critical piece of information here?

Here’s the link to complete source code of the contract in question.

Electrifying Live Casino Game XXXtreme Lightning Roulette in Exclusive Early Access

Play the brand new XXXtreme version of one of the most popular live casino games at Bitcoin.com Games; Lightning Roulette by Evolution! Now in Exclusive Early Access with a $ 2,000 Tournament Live casino games are a prime example of the new generation of casino games you can expect from Bitcoin.com Games. The live casino::Listen

Electrifying Live Casino Game XXXtreme Lightning Roulette in Exclusive Early Access en xxxtreme new article notext UpsIpy | BuyUcoin

Play the brand new XXXtreme version of one of the most popular live casino games at Bitcoin.com Games; Lightning Roulette by Evolution!

Now in Exclusive Early Access with a $ 2,000 Tournament

Live casino games are a prime example of the new generation of casino games you can expect from Bitcoin.com Games. The live casino format is the closest anyone could experience going to a brick-and-mortar casino with real dealers behind the screen. Not only are the dealers well-trained in the craft of conducting live casino games, but their sophisticated personas can also imbue the player’s gaming experience with a touch of luxury found only in the most privileged places in the world.

Bitcoin.com Games has been home to a host of many such live casino games that can be played with cryptocurrencies such as Bitcoin or Bitcoin Cash. A prime example of a massively popular live casino game hosted on our crypto casino is the award-winning Lightning Roulette from the software provider Evolution. Now, carrying forward the tradition of thunderous visuals and electrifying gaming experience, the provider is launching an XXXtreme version of the ever-popular game.

Our crypto casino Bitcoin.com Games is bringing you exclusive early access to the new game – XXXtreme Lightning Roulette, and an opportunity to win cash prizes worth $2,000. This latest addition to the live casino library is touted to be one of the most exhilarating games from the stables of Evolution.

Land Massive Money Multiples of up to 2,000x Your Bet Amount

XXXtreme Lightning Roulette combines live casino format with a high-payout RNG element to offer a wildly entertaining experience. What makes this new launch so XXXtreme is that you can score between 50x and 500x multipliers with up to ten Lightning and Chain Lightning numbers in total per game round – or score up to 2,000x your bet amount with the exciting Double Strikes feature!

XXXtreme Lightning Roulette is an electrifying new live casino game that features all the elements that made the original so much fun and pushes it to the XXXtreme. Play this new launch and participate in the early access tournament to win cash prizes of up to $1,000, only on Bitcoin.com Games.

What do you think about the XXXtreme Lightning Roulette casino game? Let us know what you think about it in the comments section below.

Generating Randomized Start Index for TokenIds in a NFT Contract

Shopping cart
There are no products in the cart!
Continue shopping
0