ether

How can we generate multiple random number in ethereum?

佐手、 提交于 2020-06-27 09:38:27
问题 I want my smart contract to return 7 or 8 UNIQUE random numbers ranging from 1 to 100 upon calling the contract. What can be the best approach to obtain such result? 回答1: Probably if you are trying to build roulettes, lotteries, and card games using the Ethereum blockchain, as the Ethereum blockchain is deterministic, it imposes certain difficulties for those who have chosen to write their own pseudo-random number generator (PRNG). Some Vulnerable Methods Currently Used If you are using the

Create an account with web3.js v0.2.6

爱⌒轻易说出口 提交于 2019-12-13 03:38:58
问题 so everytime i try to create an account with web3 i always get errors like the wrong version of web3 and that i should switch to v1.0.0 i used this command to install web3 npm install ethereum/web3.js --save i ve tried these commands to create an account but there is always a mismatch web3.eth.accounts.create(); web3.eth.personal.newAccount('!@superpassword') .then(console.log); and i always get errors even though i installed npm install web3-eth-account --save npm install web3-eth-personal -