I defined a modifier in my contract Auction
modifier onlyOwner() { //Part 2 Task 1
require (msg.sender == beneficiary);
_;
}
This modifier should be used in the revealWinners function instead of public. But it's not working and I don't know why.
function revealWinners() onlyOwner returns { //Part 2 Task 1
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];
winners[id] = winners[winnerId]; //Part 1 Task 6 – 1 line
}
}
}
I got the message: Expected token LParen got 'LBrace' (behind returns). Who can assist me?