0

I was trying this Beginner tutorial on smart contracts and solidity. I typed truffle compile, truffle migrate and they ran without any error and I got my gas cost used up in Ganache. When I opened truffle console and typed TodoList = await TodoList.deployed() as per the tutorial, I faced this error below:

Uncaught ReferenceError: TodoList is not defined at evalmachine.<anonymous>:1:7

As per the tutorial, my 2_deploy_contracts.js looks like this

const TodoList = artifacts.require("TodoList.sol");

module.exports = function(deployer) {
  deployer.deploy(TodoList);
};

Let me know what am I doing wrong, thanks in advance!

1
const TodoList = artifacts.require("TodoList"); // Enter your Contract Name not File name

module.exports = function(deployer) {
  deployer.deploy(TodoList);
};
1
  • This worked for me, I messed up with the cases in the contract name and got confused as to the requirement, thanks! – Abhiram Satputé Apr 12 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.