Truffle Solidity Compiler Error – Solution

Truffle Solidity Compiler Error – Fixed

by Alexandra Kropova from Mammoth Interactive

Trying to Compile a Solidity Smart Contract?

Getting the error message “Truffle is currently using solc 0.5.16, but one or more of your contracts specify “pragma solidity ^0.8.0″. Please update your truffle config or pragma statement(s).” ?

Read the solution below!

Want to learn more? Enroll in Beginners Solidity for Ethereum Blockchain Masterclass - Build Smart Contracts. Free in the Mammoth Unlimited Membership. Get 200+ courses and 2,000 hours at a dirt-cheap price.

Your solution:

Open your truffle-config.js file.

Under the section ‘compilers’, change the compiler version to the one requested in the error message.

compilers: {

solc: {

version: "0.8.0"

}

}

Suggest more solutions or ask a question in the comments below.

Want to learn more? Enroll in Beginners Solidity for Ethereum Blockchain Masterclass - Build Smart Contracts. Free in the Mammoth Unlimited Membership. Get 200+ courses and 2,000 hours at a dirt-cheap price.
Mammoth Interactive Favicon

Why you NEED to take this course :

Get in Touch.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

EMAIL US

support@mammothinteractive.com