Truffle Introduction

Ignore my last post i figured it out haha, thanks Dan-i.

1 Like

Sorry to ask you a million questions. So i changed the compiler version in the truffle-config.js file to 0.5.12, i still get the following error. Should i just change my statement to 0.5.16? or will that affect my ability to continue with the course. The other option is to downgrade truffle to compiler 0.5.12? I went to https://trufflesuite.com/docs/truffle/reference/configuration#compiler-configuration but I dont understand how to implement this.

Hey @RCV

Make sure to change the compiler (to 0.5.12) as explained here: FAQ - How do change truffle version

Once done, close ganache and open it back.
Then run truffle migrate --reset.

The compiler is downloaded as soon as you run truffle so you don’t need to do anything manually except for change the truffle version in truffle-config.

Give it a try and let me know.

Cheers,
Dani

1 Like

Success!! Finally thanks dan-i!!!

1 Like

I’m working with a Mac machine running Big Sur 11 (my first time using a mac for development) and for some reason, even after installing truffle in the local directory, my command prompt returns an error for any truffle commands. It says truffle is not a recognized command. Any idea how to fix this? Thank you!

Weird it works if I use npx truffle init
I’d still like to hear any solutions so I can run truffle commands the usual way, thank you!

Hey @a.lwsn

Try to install truffle globally sudo npm install -g truffle.
Also downgrade node: FAQ - How to downgrade Node.Js

Let me know if that helped.

Cheers,
Dani

That worked thank you very much!

1 Like

Happy to read that! :grin:

I am now in the setter function lecture when I run the migrate --reset command i get an ExtendableError.

I am also reading through the forum some people had a similar issue. They fixed it by upgrading to a newer version of ganache. I am running version 2.1.1.

I tried upgrading ganaches to the newest version i still get the same error. The error happens when Iam in the truffle console and run migrate --reset.

Hello guys,

Some help please :laughing:

Using VSC and all the dependencies that the course uses. Right now I got everything migrate to Ganache, but my Helloworld.sol is getting this error when I truffle migrate

The contract still deploys so I proceeded to unit testing but when I test it I’m that same message. Please help :sweat_smile:

Hi @RCV

Add this in your truffle config in the Network object:

     ganache: {
      host: "127.0.0.1",     // Localhost (default: none)
      port: 7545,            // Standard Ethereum port (default: none)
      network_id: "*",       // Any network (default: none)
     },

Then again truffle migrate --reset

1 Like

Hey @wilsonlee123

Your deployment is failing because your contract is hitting a revert statement.
Check your migration file and your constructor method and you will probably find require() that is failing.
Feel free to post both your migration file and your contract here.

Happy coding,
Dani

Dan-i, you’re the man!!! Much appreciated. Finally finished that lecture it all ran smoothly just at the end it didn’t console log the message is set for some reason on the terminal. So i had to run instance.getMessage() to see the message I set on the editor.

I have a new issue. In the Payable Function lecture, I did it all without issue but once I set {value: 1000000, from: accounts[0]} save the file, then run migrate --reset, i get the following error.

Hello @dani-i ,

Please take a look.

Not sure what you mean by constructor method. I do have require() in there though.


@dan-i I don’t know what made me think to put that require() method in there. Took that out and things are moving along now. Thanks :grin:

1 Like

Hey @RCV

I would need to check both your contract and your migration file.

What I can suggest you is to make sure that the function you sending ether to during the deployment is payable.

If you are sending ether to your constructor make sure it is set to payable otherwise it will fail.

If that’s not the issue post your contract and your migration file.

Cheers,
Dani

Hey @wilsonlee123

Happy that you solved.
Whenever you see this error keep in mind that it is most likely related to a require statement that fails, therefore you transaction gets reverted.
Screenshot 2021-02-11 at 10.22.15

Happy learning,
Dani

2 Likes