New answers tagged

0 votes

How can I instantiate an array of addresses?

address[3] memory users; users[0] = 0x...; users[1] = 0x...; users[2] = 0x...;
0xTheL's user avatar
  • 155
0 votes

Weighted Random Number Array generation in solidity

Here is an algorithm to achieve this: Add all the weight into a variable called totalWeight. Construct a binary tree with individual weights as the data nodes. The nodes of the tree is the sum of the ...
Narayan Prusty's user avatar

Top 50 recent answers are included