Hi! Can anyone show some examples of using oracles in smart contracts? Or maybe there's another way to create an unpredictable random?

Aug 23, 2019, 3:21 PM
In what regard would you use it?
Aug 24, 2019, 10:52 AM
I found a realization on medium of randomizer, but i don't know yet how to connect it to my lottery contract
wait for __callback method for some time?
Aug 24, 2019, 10:55 AM
Lottery contractšŸ¤” we draw jurors randomly based on staking, maybe that method would work for you as well
Aug 24, 2019, 10:57 AM
How is your random made, if it's not a secret?)
Aug 24, 2019, 10:59 AM
It's not, two sec
It's a module, for now using Ethereum blockhash. It will be moved to a VDF when VDF are ready.
Aug 24, 2019, 11:24 AM
block.blockhash(block.number) ? and it's safe enough? we used block.timestamp and got hacked for some ether
Aug 24, 2019, 11:26 AM
The blockhash is not perfect, it can be sometimes "rerolled", but it cannot be fixed to a particular value. If you are a miner, you may sometimes waive some ETH to reroll the number and sometimes chose between two of them. But can never fix it to a particular value.
Aug 24, 2019, 4:34 PM
So can I use it in lottery? And can random on blockhash be hacked other way? Like look from another contract result of blockhash function and predict random value
Aug 24, 2019, 6:40 PM
No a large lottery creates a incentive for miners to withhold blocks to influence the outcome
If they have like 50% of the tickets and they mine a block which loses they will drop the block and have another chance of winning
Aug 24, 2019, 6:43 PM
Lottery is small and it's like a game, so for miners there's no interest I think
Aug 24, 2019, 6:46 PM

Ā© 2024 Draquery.com All rights reserved.