• I have already set my Subscriptions for Chainlink
  • Added consumer and subscription have sufficient Link as well
  • No Error occurs whenever I call the requestRandomWords function
  • The chainlink subscriptions page fulfillments is also updated.
  • But still, the fulfillRandomWords function is not executing the code
  • s_randomWords tokenCounter nothing is updating its value

Chainlink VRF V1 is working fine but V1 is deprecated now, So I am using Chainlink VRF V2 but it is not executing the code in the given function. Although when I do the same thing in Remix it is working fine.

Subsctription and consumers on the chainlink Transaction History on etherscan

fulfillRandomWords(uint256 requestId, uint256[] memory randomWords)
    tokenCounter = tokenCounter + 1;
    s_randomWords = randomWords;
    s_one_r = randomWords[0];
    address dogOwner = requestIdToSender[s_requestId];
    string memory tokenURI = requestIdToTokenURI[s_requestId];
    uint256 newItemId = tokenCounter;
    checkUri = tokenURI;
    //This newItemId should have to be a randomWords
    _safeMint(dogOwner, newItemId);
    _setTokenURI(newItemId, tokenURI);

    Breed breed = Breed(s_randomWords[0] % 3);
    tokenIdToBreenter code hereed[newItemId] = breed;
    requestIdToTokenId[s_requestId] = newItemId;

    emit FulfillEvent(tokenCounter, s_one_r, tokenURI);
    //randomResult = randomNumber;

1 Answer 1


This is a duplicate of https://stackoverflow.com/questions/72384572/whenever-i-write-some-code-in-chianlink-vrf-fulfillrandomwords-function-it-does

Please continue posting on that thread, and update your question if you have any updates directly there. That way its easier for people to find, read and use the resource.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.