I'm starting to learn solidity with Dapp University guide on youtube, and as soon as 20th minute of this guide I'm running into problem with Truffle compiling.
I cloned this repository:
git clone -b starter-code https://github.com/dappuniversity/defi_tutorial ./
And this is YT link to this tutorial:
https://www.youtube.com/watch?v=CgXQC4dbGUE
Truffle config on this guide looks like this:
require('babel-register');
require('babel-polyfill');
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
},
contracts_directory: './src/contracts/',
contracts_build_directory: './src/abis/',
compilers: {
solc: {
optimizer: {
enabled: true,
runs: 200
},
evmVersion: "petersburg"
}
}
}
And at this point in the guide, compiling succeeds, but I get an error:
Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity ^0.5.0
So I went to Truffle documentation, I found that I can specify solc version in the config, so I added version
field, and my config looks now like this:
// ...
compilers: {
solc: {
version: "0.5.0",
optimizer: {
enabled: true,
runs: 200
},
evmVersion: "petersburg"
}
}
// ...
And again my compiling failed, with another error but this time with evmVersion
:
Invalid EVM version requested.
Compilation failed. See above.
Truffle v5.1.39 (core: 5.1.39)
Node v16.9.1
Now I've change EVM version from "petersburg"
to "byzantium"
and I'm getting to another Compilation Faild with error:
Error: Truffle is currently using solc 0.5.0, but one or more of your contracts specify "pragma solidity ^0.5.0
Can someone provide me some knowledge how to deal with this error?
version: "0.5.0"
error is the same but saying about other solc version on truffle:Error: Truffle is currently using solc 0.5.16
ParserError: Expected ';' but got '}'
orParserError: Expected ';' but got end of source
depends on where I put ";" as I don't know much about syntax yet, etc. So I guess it's for different thread.