Skip to content

Lesson 9: Cannot read properties of undefined(reading 'entranceFee') #1511

Answered by DorianDaSilva
paulcoffee85 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @paulcoffee85

  • Missing import at the top:

const { network, ethers } = require("hardhat") => You can't call ethers functions without importing ethers

  • Define chainId correctly :

const chainId = network.config.chainId instead of const chainId = network.config.chainId["VRFCoordinatorV2Mock"]
=> "VRFCoordinatorV2Mock" is not a network

Hope this helps!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@paulcoffee85
Comment options

@DuyVo96
Comment options

@othaime-en
Comment options

Answer selected by paulcoffee85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants