For those of you want to Migrate to VRF 2.5 #6728
Replies: 1 comment
-
Hi! Sorry to bother you, I am having a problem with VRF V2.5 and was hoping that you could help me out? My code passes tests with mocks in local environment, but it gets reverted when calling function performUpkeep(bytes calldata) external override {
(bool upkeepNeeded, ) = checkUpkeep("0x");
if (upkeepNeeded) {
emit TestPerforming();
s_state = RaffleState.CALCULATING;
emit TestChangedState();
uint256 requestId = s_vrfCoordinator.requestRandomWords(
VRFV2PlusClient.RandomWordsRequest({
keyHash: i_keyHash,
subId: i_subscriptionId,
requestConfirmations: i_requestConfirmations,
callbackGasLimit: i_callbackGasLimit,
numWords: i_numWords,
extraArgs: VRFV2PlusClient._argsToBytes(
VRFV2PlusClient.ExtraArgsV1({nativePayment: false})
)
})
);
emit randomWinnerRequested(requestId);
} else {
revert Raffle__UpkeepNotNeeded(
address(this).balance,
s_players.length,
uint256(s_state)
);
}
} I followed the official guide, and to test whether it's issues with my subscription, I deployed the |
Beta Was this translation helpful? Give feedback.
-
Just wanted to share that I’ve migrated the project from the course to VRF 2.5. If any of you are thinking about making the switch or just want to see how it’s done, I’ve implemented it in my repo here: https://github.com/HarigovindM-G/Lucky-Node-Hardhat
I’m not an expert, but hopefully, this can be helpful if you’re looking to update your own projects. Feel free to take a look or reach out if you have any questions!
Best,
Hari
Beta Was this translation helpful? Give feedback.
All reactions