PatrickAlphaC / hardhat-nft-fcc

100 stars 139 forks source link

reverted with custom error 'InvalidConsumer() #55

Closed mmuaaz closed 1 year ago

mmuaaz commented 1 year ago

There seems to be an issue when running the deploy scripts, its been answered in the Discussions, please add this in the repo as comment or something that people make necessary changes to avoid the error. The issue is the error: reverted with custom error 'InvalidConsumer()

this issue is resolved by either downgrading the chainlink version by running: yarn add --dev @chainlink/contracts@0.4.1

or a better solutions is editing your "02-deploy-random-ipfs-nft.js", and add following code after you deploy mock and random ipfs:

await vrfCoordinatorV2Mock.addConsumer(
        subscriptionId,
        randomIpfsNft.address
    )

the issue was addressed in the discussion: https://github.com/smartcontractkit/full-blockchain-solidity-course-js/discussions/1375

kostissss commented 1 year ago

I suppose you probably mean this code : await vrfCoordinatorV2Mock.addConsumer( subscriptionId, randomIpfsNft.address )

mmuaaz commented 1 year ago

Yes bro this code

PatrickAlphaC commented 1 year ago

Fixed in https://github.com/PatrickAlphaC/hardhat-nft-fcc/commit/4c3075e870555e99c0b76712c56a910e685df7e0

Thank you!