Lesson 7 Hardhat Fund Me - solhint set up #885
Replies: 7 comments 5 replies
-
Thanks @benjbright for taking out the time to put up this wonderful post. |
Beta Was this translation helpful? Give feedback.
-
Thank you for sharing this @benjbright! It's a shame we need to change the solidity version to ^0.5.8 to use the recommended setup. Did you manage to run solhint with a newer solidity version? Running it with the default extends, doesn't output any error at all. I wonder if that's the reason why hardhat doesn't include it by default anymore. Anyway, it's good to know this workaround, thank you again! |
Beta Was this translation helpful? Give feedback.
-
Awesome post @benjbright |
Beta Was this translation helpful? Give feedback.
-
Thanks @benjbright, it seems you've nailed it! Here's a version that doesn't force an older compiler: .solhint.json{
"extends": "solhint:recommended",
"plugins": [],
"rules": {
"compiler-version": ["error", "^0.8.0"],
"avoid-suicide": "error",
"avoid-sha3": "warn"
}
} |
Beta Was this translation helpful? Give feedback.
-
Best and Only answer that worked for me. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @benjbright |
Beta Was this translation helpful? Give feedback.
-
Thank you @benjbright. I finally can proceed |
Beta Was this translation helpful? Give feedback.
-
I've just got on to this section of the course and after installing with
yarn hardhat
I was given slightly different options (this is based onHardhat v2.10.0
, so I selectedCreate a Javascript project
.The installation was all fine, however I did not have a
.solhint.json
file so these were the steps I followed to be able to work along with Patrick (see also the docs at https://protofire.github.io/solhint/)yarn add solhint
.solhint.json
file by typingyarn solhint --init
.solhint.json
file as the default rules which were enabled with the--init
didn't seem to work, so I replaced the text as per the docs so my.solhint.json
file looks like this:Lock.sol
contract file instead ofGreeter.sol
so I made the following changes:pragma solidity ^0.5.8;
as I was receiving an erroruint256 someVar;
inside the contract as per Patrick's instructions in the video, without marking the visibilityyarn solhint contracts/*.sol
in the terminal and received the following output, which includes the error we were expecting:Sorry for such a long post and I'm still learning all of this, so if there is a better / more efficient way to resolve this please let me know! I wasn't sure how important this would be to the rest of the course but thought I would share in case anyone else is stuck on the same section.
Beta Was this translation helpful? Give feedback.
All reactions