Hi I am using the demo contract provided by chainlink at https://docs.chain.link/docs/vrf/v2/examples/get-a-random-number/ . I did read the documentaion and followed the steps -

  • Created subscription and then deployed the contract with that subscriptionId
  • Funded the subscription with 0.5 LINK
  • Added the address of the deployed contract as consumer in my subscription

When I call the requestRandomWords the transaction goes through successfully and but when I try to get the requested random number by s_randomWords with index 0 remix show execution reverted.

enter image description here

I am working on mumbai testnet and I have sufficient test matic so that is not the issue, when I try on goerli it shows execution reverted.

Just s_randomWords is not working upon calling and requestRandomWords works with transaction successful showing on etherscan, I have worked with chainlink VRF before and have seen this error before, please help me resolve this issue, Thanks.

  • What do you mean by getting random number by s_randomWords with index 0? Isn't the fulfillRandomWords function the only way for the consumer contract to get the result random words? Aug 28, 2022 at 15:23

1 Answer 1


Execution reverted because s_randomWords is an empty array since the fulfillment of the request hasn't been executed yet. You have a pending transaction due to a low balance. Pending requests will fail after 24 hours.

Currently, the maximum cost for a VRF request on Goerli is 2.0575084648217579 LINK, which means you're 1.5575084648217579 LINK low. You can see these details on the Subscription management page at vrf.chain.link/goerli/<YOUR_SUBSCRIPTION_ID> (make sure your wallet is connected)

You should add more Goerli LINK to your subscription. You can grab them for free from faucets.chain.link.

  • Thanks, it was not clearly mentioned. Aug 30, 2022 at 4:16

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.