help me, how. can i generate unique 10000 number with chainlink VRF with expand(uint256 randomValue, uint256 n) , just one call getRandomNumber
after generating, always duplicated number
function rnd999(uint count) public returns(uint256[] memory) { // randomResult = 93067262134428089321709436256164799680179007044406279461954102178607355307084; winnerCount = count; // return applyRandomness(expand(randomResult, winnerCount)); uint256[] memory expandedValues = expand(randomResult, winnerCount); for (uint256 i = 0; i < winnerCount; i++) { uint256 indexOfWinner = expandedValues[i] % winnerCount; // recentWinner = entrants[indexOfWinner]; winners.push(indexOfWinner); } return winners; }
-> winners : duplicated number (3,453,33,17,453, 3 ... )
Aucun commentaire:
Enregistrer un commentaire