Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable using slither for vyper files #1108

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Echidna.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ prepareContract env contracts solFiles specifiedContract seed = do
-- run processors
slitherInfo <- runSlither (NE.head solFiles) solConf
case find (< minSupportedSolcVersion) slitherInfo.solcVersions of
Just outdatedVersion -> throwM $ OutdatedSolcVersion outdatedVersion
Just version | detectVyperVersion version -> pure ()
Just version -> throwM $ OutdatedSolcVersion version
Nothing -> pure ()

let
Expand Down
3 changes: 1 addition & 2 deletions lib/Echidna/Processor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Data.Maybe (catMaybes, fromMaybe)
import Data.SemVer (Version, fromText)
import Data.Set (Set)
import Data.Set qualified as Set
import Data.Text (pack, isSuffixOf)
import Data.Text (pack)
import System.Directory (findExecutable)
import System.Exit (ExitCode(..))
import System.Process (StdStream(..), readCreateProcessWithExitCode, proc, std_err)
Expand Down Expand Up @@ -124,7 +124,6 @@ instance FromJSON SlitherInfo where

-- Slither processing
runSlither :: FilePath -> SolConf -> IO SlitherInfo
runSlither fp _ | ".vy" `isSuffixOf` pack fp = pure noInfo
runSlither fp solConf = do
path <- findExecutable "slither" >>= \case
Nothing -> throwM $
Expand Down
3 changes: 3 additions & 0 deletions lib/Echidna/Types/Solidity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import EVM.Types (Addr)
minSupportedSolcVersion :: Version
minSupportedSolcVersion = version 0 4 25 [] []

detectVyperVersion :: Version -> Bool
detectVyperVersion x = x > version 0 3 0 [] [] && x < version 0 4 0 [] []

data Filter = Blacklist [Text] | Whitelist [Text] deriving Show

-- | Things that can go wrong trying to load a Solidity file for Echidna testing.
Expand Down