Questions tagged [randomness]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
0 answers
179 views

Random Number Generator without wasting RAM

I want to implement RNG on EOS the mainnet. My reference is the WAX ORNG smart contract It is based on the signidice which is an Ethereum implementation. That algorithm is based on an external oracle ...
Ami Heines's user avatar
  • 1,686
0 votes
1 answer
95 views

Generate random numbers in the smart contract

I am writing smart contract and stucked on this line : int p = 0; p = (rand() % 997); This is giving error error: use of undeclared identifier 'rand' I do search and got some reference links but ...
Varsh's user avatar
  • 307
4 votes
2 answers
981 views

Random number generation

I know that it's not possible to have a completely 'safe' random generator on block chain. But still wondering how safe it would be if I use a combination of methods like now() and transaction_size() ...
daniaoren's user avatar
1 vote
1 answer
48 views

Validation for contract which has data which varies

How does the EOS contract system handle data which varies? This could be from using a true random number, or receiving real-world data like a token price. Every time the contract executes, different ...
expaand's user avatar
  • 654
26 votes
4 answers
4k views

How can I generate random numbers inside a smart contract?

If I'm building a smart contract that requires random numbers (e.g. games of chance), how do I reliably generate randomness inside a smart contract?
John Haager's user avatar
  • 1,844