Lesson 9: No Contract deployed with name lottery #5072
-
Hi! based on the Patrick's course I tried to create the same smart contract, but using as name lottery ( yes, with a lowercase letter), the contract is deployed succesfully, but when I tried to test it, if the code is good, I have this error:
lottery.test.js
contract- lottery.sol:
01-deploy_lottery.js
And this is my repository: https://github.com/margelatufml/lottery-contract |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Looks like you need to declare: In 'lottery.test.js' You could use this line: At end of 'deploy-lottery', need an 's' in Just glanced in your helper-hardhat as well. Looks like 'subscription misspelled.
|
Beta Was this translation helpful? Give feedback.
Looks like you need to declare:
subscribtionId = transactionReceipt.events[0].args.subId
Also,
entranceFEE
=entranceFee
in hardhat, might want to keep those all the same in every file including contract.Test after changes and see if that works.
In 'lottery.test.js' You could use this line:
deployer = (await getNamedAccounts()).deployer
or the line you have:
const { deployer } = await getNamedAccounts()
but add a declaration for 'deployer' after describe().At end of 'deploy-lottery', need an 's' in
tags
module.exports.tag = ["all", "lottery"]
Just glanced in your helper-hardhat as well. Looks like 'subscription misspelled.