Hi there, I’m trying to start smart contract development using VSCode with Solidity extension by Juan Blanco... my pragma is ^0.8.12 but VSCode complains with a lot of errors (“...source files requires different compiler version (current compiler is 0.7.0+commit... (...) nightly builds are considered to be strictly less than the released version)... I’ve tried a lot of workarounds with no success... when fixing compatibility with some contracts (by changing the global compiler version) then others incompatibilities errors jump in front of my eyes... is there a way to define a range of pragma version values to be “in peace with everyone”... it’s quite frustrating for me as a newbie

Jun 6, 2022, 7:26 PM
Any advice on this?
Jun 6, 2022, 7:31 PM
Use the below command in your folder terminal to update your compiler.

Npm install solc
Jun 6, 2022, 7:42 PM
https://www.tutorialspoint.com/solidity/solidity_basic_syntax.htm
Jun 6, 2022, 7:42 PM
Oh, thanks... I guess yarn will do the trick too... am I right? (yarn add solc)
Jun 6, 2022, 7:44 PM
Yes it will.
Jun 6, 2022, 7:44 PM
It’s a matter of preference, yarn is my default package manager... ok, thanks a lot 👍
@Utility10 I did updated to [email protected] (latest)... now in VSCode -> right click menu and choosing Solidity: Compiler Information (option added by Juan Blanco’s solidity extension) it still shows an old v0.7.0+commit... any other change has to be made in VSCode settings? I can’t get rid of this annoying error...
@Utility10 On the other hand, do I have to change the default workspace compiler version to “localNodeModule”? Taking into my solc local node packages were updated
@Utility10 FINALLY!!! DONE!
@Utility10 Thanks for the tip... I just did change to “localNodeModule”... and it works according to the “logic”...
Hi, using Hardhat, when compiled my contract using:
yarn hardhat compile
it works like a charm, BUT when compiling using script Hardhat throws this error:
“HardhatError: HH700: Artifact for contract XYZ not found.
Jun 6, 2022, 10:53 PM
The error is stated here. Make sure you're referencing your contact in your getcontractfactory.
Jun 7, 2022, 4:41 AM

© 2024 Draquery.com All rights reserved.