You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2024. It is now read-only.
any can say that i have done all steps correctly up to end of the raffle lesson 9 but when I run the staging test I entered the raffle , the
RequestedRaffleWinner() has been called but the fulfillWords() function was not called in the upkeep subscription website the transaction completed , but for in vrf.chain.link account it is showing in pending as you shown in the photo , but the transaction is showing success in sepolia.etherscan.io, now the raffleState is in calculating so i can't enter or call performUpkeep() function or do anything until that fulfillrandomWords () function is callled by chainllink VRF , so what i have to do to resolve this is anything i have done in wrong in the code
i have give my raffle solidity code
it is from chainlink vrf account
it is from etherscan
it is from chianlink keepers account
/Raffle//Enterthelottery(payingsomeamount//pickarandomwinner(verifiableyrandom)//wnnertobeselectedeveryxminutes->completlyautomated//ChainlinkOracle->Randomness,AutomatedExecution(Chainlinkkeeper)//SPDX-License-Identifier: MITpragmasolidity ^0.8.7;import"@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";import"@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";import"@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";errorRaffle__NotEnoughETHEntered();errorRaffle__TranferFailed();errorRaffle__NotOpen();errorRaffle__UpkeepNotNeeded(uint256currentBalance,uint256numPlayers,uint256raffleState);/**@title A sample Raffle Contract * @author kollipara surya * @notice This contract is for creating an untamperble decentralize smart contract * @dev This implements Chianlink VRF V2 and Chainlink keepers */contractRaffleisVRFConsumerBaseV2,AutomationCompatibleInterface{/* Type declarations */enumRaffleState{OPEN,CALCULATING} //uint256 /*stateVariables*/ uint256 private immutable i_entranceFee; address payable[] private s_players; VRFCoordinatorV2Interface private immutable i_COORDINATOR; bytes32 private immutable i_keyHash; uint64 private immutable i_subscriptionId; uint32 private immutable i_callbackGasLimit; uint16 private constant REQUEST_CONFIRMATIONS = 3; uint32 private constant numWords = 1; /*loteryvariables*/ address private s_recentWinner; RaffleState private s_raffleState; uint256 private s_lastTimeStamp; uint256 private immutable i_interval; /*Events*/ event RaffleEnter(address indexed player); event RequestedRaffleWinner(uint256 indexed requestId); event WinnerPicked(address indexed winner); /* Functions */ constructor( address vrfCoordinatorV2, //contractuint256entranceFee,bytes32keyHash,uint64subscriptionId,uint32callbackGasLimit,uint256interval)VRFConsumerBaseV2(vrfCoordinatorV2){i_entranceFee=entranceFee;i_COORDINATOR=VRFCoordinatorV2Interface(vrfCoordinatorV2);i_keyHash=keyHash;i_subscriptionId=subscriptionId;i_callbackGasLimit=callbackGasLimit;s_raffleState=RaffleState.OPEN;s_lastTimeStamp=block.timestamp;i_interval=interval;}functionenterRaffle()publicpayable{//require(msg.value > i_entranceFee,"Not enough ETH!")if(msg.value < i_entranceFee){revertRaffle__NotEnoughETHEntered();}if(s_raffleState != RaffleState.OPEN){revertRaffle__NotOpen();}s_players.push(payable(msg.sender));//EmitaneventwhenweupdateadynamicArrayormapping//NamedeventswiththefunctionnamedreversedemitRaffleEnter(msg.sender);}/** * @dev This is the function that the chailink keeper nodes call * they look for the `upkeepNeeded to return true * The following should be true in order to return true: * 1. Our time intervel should have passed * 2. The lottery should have at least 1 player, and have some ETH * 3. Our subscription is funded with LINK * 4. The lottery should be in an "open" state. */functioncheckUpkeep(bytescalldata/* checkData */)publicoverridereturns(boolupkeepNeeded,bytesmemory/*performdata*/){boolisOPen=(RaffleState.OPEN == s_raffleState);booltimePassed=(block.timestamp - s_lastTimeStamp > i_interval);boolhasPlayers=(s_players.length > 0);boolhasBalance=address(this).balance > 0;upkeepNeeded=(isOPen && timePassed && hasPlayers && hasBalance);}functionperformUpkeep(bytescalldata/*performData*/)externaloverride{(boolupkeepNeeded,)=this.checkUpkeep("");if(!upkeepNeeded){revertRaffle__UpkeepNotNeeded(address(this).balance,s_players.length,uint256(s_raffleState));}s_raffleState=RaffleState.CALCULATING;uint256requestId=i_COORDINATOR.requestRandomWords(i_keyHash,//gaslanei_subscriptionId,REQUEST_CONFIRMATIONS,i_callbackGasLimit,numWords);emitRequestedRaffleWinner(requestId);}functionfulfillRandomWords(uint256/*requestId*/,uint256[]memoryrandomWords)internaloverride{uint256indexOfWinner=randomWords[0] % s_players.length;addresspayablerecentWinner=s_players[indexOfWinner];s_recentWinner=recentWinner;s_raffleState=RaffleState.OPEN;s_players=newaddresspayable[](0);s_lastTimeStamp=block.timestamp;(boolsuccess,)=recentWinner.call{value: address(this).balance}("");if(!success){revertRaffle__TranferFailed();}emitWinnerPicked(recentWinner);}
/* View/Pure functions */functiongetEntranceFee()publicviewreturns(uint256){returni_entranceFee;}functiongetPlayer(uint256index)publicviewreturns(address){returns_players[index];}functiongetRecentWinner()publicviewreturns(address){returns_recentWinner;}functiongetRaffleState()publicviewreturns(RaffleState){returns_raffleState;}functiongetNumWords()publicpurereturns(uint256){returnnumWords;}functiongetNumberOfPlayers()publicviewreturns(uint256){returns_players.length;}functiongetLatestTimeStamp()publicviewreturns(uint256){returns_lastTimeStamp;}functiongetRequestConfirmations()publicpurereturns(uint256){returnREQUEST_CONFIRMATIONS;}functiongetInterval()publicviewreturns(uint256){returni_interval;}}
The text was updated successfully, but these errors were encountered:
hmm... Thanks for this. This is likely an issue with the testnet. They are testnets for a reason! If all your tests are passing, then I'd recommend just moving past this. Seems like you've learned what this lesson was intended to teach, and now the testnet is just giving issues.
It being a testnet, that happens sometimes sadly :/
This is because of the instability testnet sepolia. My vrfCoordinator on sepolia finished after maintaining pending for more than 2 hours. Finally it worked.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
any can say that i have done all steps correctly up to end of the raffle lesson 9 but when I run the staging test I entered the raffle , the
RequestedRaffleWinner() has been called but the fulfillWords() function was not called in the upkeep subscription website the transaction completed , but for in vrf.chain.link account it is showing in pending as you shown in the photo , but the transaction is showing success in sepolia.etherscan.io, now the raffleState is in calculating so i can't enter or call performUpkeep() function or do anything until that fulfillrandomWords () function is callled by chainllink VRF , so what i have to do to resolve this is anything i have done in wrong in the code
i have give my raffle solidity code
it is from chainlink vrf account
it is from etherscan
it is from chianlink keepers account
The text was updated successfully, but these errors were encountered: