I am building an auction smart contract in Remix with random winners being picked. And I am not getting any value out of the following function:
}
function revealWinners() public {
for (uint id = 0; id <3; id++) {
Item storage currentItem=items[id];
if(currentItem.itemTokens.length != 0) {
uint randomIndex = (block.number /
currentItem.itemTokens.length)% currentItem.itemTokens.length;
uint winnerId = currentItem.itemTokens[randomIndex];
}
Everything else is working as it should but I have been stuck on this for a while, anyone here have an idea what I am missing?