TypeError: Cannot read properties of undefined (reading 'checkUpkeep') #1415
-
the error is
code describe("checkUpkeep", () => {
it("returns false if people haven't sent any eth", async () => {
await network.provider.send("evm_increaseTime", [interval.toNumber() + 1])
await network.provider.send("evm_mine", [])
const { upkeepNeeded } = await raffle.callstatic.checkUpkeep("0x")
assert(!upkeepNeeded)
})
}) i tried putting [ ] in checkUpkeep( ) but it did not work too |
Beta Was this translation helpful? Give feedback.
Answered by
Muhammad-Abdullah012
Jul 30, 2022
Replies: 3 comments 8 replies
-
Make sure you're correctly initializing raffle = await ethers.getContract("Raffle", deployer); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
alymurtazamemon
-
Beta Was this translation helpful? Give feedback.
3 replies
-
Its part of breaking changes in Ethers 6. Replace const { upkeepNeeded } = await raffle.callStatic.checkUpkeep([]); with const{ upkeepNeeded } = await raffle.checkUpkeep.staticCall("0x"); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure you're correctly initializing
raffle
.Show that code as well.