MultiversX Tracker is Live!

block.timestamp vs block.hash

Etherum Reddit

More / Etherum Reddit 134 Views

hey guys, I have a couple of questions regarding randomness in solidity

1 - is it better to use block.timestamp or block.hash?

2 - how is it possible that this.block.hash even exists in solidity? there should be an infinite loop right?

here is an example

if this.block.hash%4 == 1

{

send 10 eth to Bill

}

in this case, if the condition is True then the smart contract sends 10 eth to Bill;

well, there is a problem here, if the smart contract sends 10 Eth to Bill than it makes another transaction, that might change the block hash ( can someone tell me what I'm missing here ? thankss)

submitted by /u/iMnoTGudd
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments