How to generate random numbers in Solidity?

preview_player
Показать описание
FREE TRAININGS (WEB3 DEV, FLASH LOANS...)

OTHER LINKS

CONTACT INFORMATION
Questions about EatTheBlocks courses, partnerships, projects:
👉 contact [at] eattheblocks [dot] com

Other Links:
Рекомендации по теме
Комментарии
Автор

Awesome, best video explaining random number in Solidity I watched so far... thank you

brunorocha
Автор

How is that not manipulable ? the rand variable is stored on chain and foo() will be called afterwards, looks like everything can be predicted isn't it ?

francoisguyot
Автор

1. The miner cannot manipulate block difficulty as you say at 3:52. This is set by the network.
2. He cannot manipulate "now" either as this is also included in the hashing process when doing the mining. Changing "now" would change the hash.
The only influence a miner has is to withhold a block from publishing. If the random number is used for a lottery and the price of the lottery is really high, it might be more lucrative to not publish a block but have another chance in the lottery. The best way to do it is with the "Lock Commit Reveal" pattern. Maybe you can do a video on this.

simonbachmann
Автор

Sir, I want to create random string like A5Ed012.Please help

jomoljaison
Автор

Thanks bro your videos are very helpfull

Photographerindian
Автор

Yo bro! Cool content but did not show how the contract interacts with Oracle!!!

Клоунеско
Автор

Neither of these ways is the true randomness.

pauleth
Автор

omg you just showed me how to make a million dollars.. ill remember your wallet friend :P

JFKTLA