VRFV2[chainlink] contract reverts on all transactions

50 Views Asked by At

I am attempting to utilize the VRFv2Consumer.sol file from chainlink. ALL of my transactions are reverting with the error: "Gas estimation failed: 'execution reverted'....If you wish to broadcast, you must set the gas limit manually."

When I deploy the contract and fund it with LINK, I attempt to check the balance of the contract with 'balanceOf' method but it says the balance is zero after I fund it.

2

There are 2 best solutions below

0
Lucas Ramos Archangelo On

I think that this transaction throws an error because the owner of the subscription isn't the same that the caller of the addConsumer, but I'm not sure, btw there is an example on Chainlink VRF docs that you could follow that I think could help you.

https://docs.chain.link/vrf/v2/subscription/examples/programmatic-subscription

0
wayne On

I resolved the issues.

revert statements can be made to show the errors which brownie tends to cover up, and this makes troubleshooting g much easier.

For an implementation of the VRFCoordinatorV2.sol mock see my repo