I am trying to implement a decentralized raffle that works with custom tokens and randomly select the winner using chainlink automated keepers. I selected a time-based keeper so that "performUpkeep" will be called every 15 minutes. However,I've run into a problem that I just can't figure out. So I have this contract: initial TokenRaffle contract. I am listening for the RequestedRaffleWinner() event in the front end code, so everytime it is emitted there will be a console.log. And it works. Every 15 minutes the RequestedRaffleWinner() event is being emitted , just as intended. However, there were some things I wanted to change in the smart contract, so I tried deploying another similar one but the RequestedRaffleWinner event was no longer being called. I racked my brains trying to figure it out and in the end I wanted to check something. I took the initial contract code, and deployed it again at a different address copy of initial TokeRaffle. I did everything exactly the same way, but for this contract, still there is nothing logged to the console and I get this message on etherscan: "Although one or more Error Occurred [execution reverted] Contract Execution Completed". I don't understand how this could happen only for the second contract even if they are identical. The problem with the first contract is that I cannot enter the raffle because the raffle state is not being updated properly. The problem with the second contract is I cannot pick a winner of the raffle. Can someone please explain how I could get an option where both entering the raffle and picking a winner work?

  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Ethereum Meta, or in Ethereum Chat. Comments continuing discussion may be removed.
    – Ismael
    Aug 31, 2023 at 3:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.