From f13f8f603fe733d20e2084b500b368ade9d6cdd7 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:51:27 +0300 Subject: [PATCH 01/11] fix README.md --- .github/container-linux-static/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/container-linux-static/README.md b/.github/container-linux-static/README.md index 1453628f8..011d22349 100644 --- a/.github/container-linux-static/README.md +++ b/.github/container-linux-static/README.md @@ -4,5 +4,5 @@ This container is used as part of `.github/workflows/ci.yml` to produce statically-linked amd64 linux builds of Echidna. It is based on the following container produced by FP Complete and maintained in the [`fpco/alpine-haskell-stack`](https://github.com/fpco/alpine-haskell-stack/tree/ghc927) -repository, and contains a few extra dependencies and configuration to make it +repository, and contains a few extra dependencies and configurations to make it suitable for the GitHub Actions environment. From a55cdef86abbec1eeef5a03421b30e8d5961d280 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:52:29 +0300 Subject: [PATCH 02/11] fix Array.hs --- lib/Echidna/Mutator/Array.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Mutator/Array.hs b/lib/Echidna/Mutator/Array.hs index a756c1dda..65ac2f1f5 100644 --- a/lib/Echidna/Mutator/Array.hs +++ b/lib/Echidna/Mutator/Array.hs @@ -15,7 +15,7 @@ listMutators = fromList -- | Mutate a list-like data structure using a list of mutators mutateLL :: (LL.ListLike f i, MonadRandom m) - -- | Required size for the mutated list-like value (or Nothing if there are no constrains) + -- | Required size for the mutated list-like value (or Nothing if there are no constraints) => Maybe Int -- | Randomly generated list-like value to complement the mutated list, if it is -- shorter than the requested size From aa07f4207c925db8df7c757949f8a6b0ec2d6143 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:53:03 +0300 Subject: [PATCH 03/11] fix Corpus.hs --- lib/Echidna/Output/Corpus.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Output/Corpus.hs b/lib/Echidna/Output/Corpus.hs index 4151d14b3..5c2d7d659 100644 --- a/lib/Echidna/Output/Corpus.hs +++ b/lib/Echidna/Output/Corpus.hs @@ -49,7 +49,7 @@ saveCorpusEvent env (_time, campaignEvent) = do getEventInfo = \case -- TODO: We save intermediate reproducers in separate directories. - -- This is to because there can be a lot of them and we want to skip + -- This is because there can be a lot of them and we want to skip -- loading those on startup. Ideally, we should override the same file -- with a better version of a reproducer, this is smaller or more optimized. TestFalsified test -> Just ("reproducers-unshrunk", test.reproducer) From d82fbf145f1f0ccf8af2e47929dbcde021c017a8 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:54:51 +0300 Subject: [PATCH 04/11] fix Coverage.hs --- lib/Echidna/Types/Coverage.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Types/Coverage.hs b/lib/Echidna/Types/Coverage.hs index 3531a8ddf..8d1241172 100644 --- a/lib/Echidna/Types/Coverage.hs +++ b/lib/Echidna/Types/Coverage.hs @@ -31,7 +31,7 @@ type TxResults = Word64 -- | Given good point coverage, count the number of unique points but -- only considering the different instruction PCs (discarding the TxResult). --- This is useful to report a coverage measure to the user +-- This is useful for reporting a coverage measure to the user scoveragePoints :: CoverageMap -> IO Int scoveragePoints cm = do sum <$> mapM (V.foldl' countCovered 0) (Map.elems cm) From 254161e8677cf87bb5e24b71d82fe095c37fa5ba Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:55:23 +0300 Subject: [PATCH 05/11] fix Solidity.hs --- lib/Echidna/Types/Solidity.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Types/Solidity.hs b/lib/Echidna/Types/Solidity.hs index f17e81697..f96076332 100644 --- a/lib/Echidna/Types/Solidity.hs +++ b/lib/Echidna/Types/Solidity.hs @@ -50,7 +50,7 @@ instance Show SolException where ConstructorArgs s -> "Constructor arguments are required: " ++ s NoCryticCompile -> "crytic-compile not installed or not found in PATH. To install it, run:\n pip install crytic-compile" InvalidMethodFilters f -> "Applying the filter " ++ show f ++ " to the methods produces an empty list. Are you filtering the correct functions using `filterFunctions` or fuzzing the correct contract?" - SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.)" + SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to a non-payable constructor, etc.)" DeploymentFailed a t -> "Deploying the contract " ++ show a ++ " failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):\n" ++ unpack t OutdatedSolcVersion v -> "Solc version " ++ toString v ++ " detected. Echidna doesn't support versions of solc before " ++ toString minSupportedSolcVersion ++ ". Please use a newer version." From fdd9d7536f8f86e3d5b101a25ad5eb2d3d93a1df Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:56:27 +0300 Subject: [PATCH 06/11] fix Tx.hs --- lib/Echidna/Types/Tx.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Types/Tx.hs b/lib/Echidna/Types/Tx.hs index 11c1372cc..ea844eec0 100644 --- a/lib/Echidna/Types/Tx.hs +++ b/lib/Echidna/Types/Tx.hs @@ -218,7 +218,7 @@ catNoCalls (tx1:tx2:xs) = _ -> tx1 : catNoCalls (tx2:xs) where nc = tx1 { delay = (fst tx1.delay + fst tx2.delay, snd tx1.delay + snd tx2.delay) } --- | Transform a VMResult into a more hash friendly sum type +-- | Transform a VMResult into a more hash-friendly sum type getResult :: VMResult Concrete s -> TxResult getResult = \case VMSuccess b | forceBuf b == encodeAbiValue (AbiBool True) -> ReturnTrue From 84a2e3ba71048d98554aa5842a51d31ed1ecfc14 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:56:53 +0300 Subject: [PATCH 07/11] fix Report.hs --- lib/Echidna/UI/Report.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/UI/Report.hs b/lib/Echidna/UI/Report.hs index fa6d47b3e..0edcbf974 100644 --- a/lib/Echidna/UI/Report.hs +++ b/lib/Echidna/UI/Report.hs @@ -59,7 +59,7 @@ ppCampaign vm workerStates = do , seedPrinted ] --- | Given rules for pretty-printing associated address, and whether to print +-- | Given rules for pretty-printing associated addresses, and whether to print -- them, pretty-print a 'Transaction'. ppTx :: MonadReader Env m => VM Concrete RealWorld -> Bool -> Tx -> m String ppTx _ _ Tx { call = NoCall, delay } = From 332c76024bf8c71157b6a27f4392fffce49965fc Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:57:48 +0300 Subject: [PATCH 08/11] fix ABI.hs --- lib/Echidna/ABI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/ABI.hs b/lib/Echidna/ABI.hs index d3616bdc7..e5269c967 100644 --- a/lib/Echidna/ABI.hs +++ b/lib/Echidna/ABI.hs @@ -211,7 +211,7 @@ addChars c b = foldM withR b . enumFromTo 0 =<< rand where addNulls :: MonadRandom m => ByteString -> m ByteString addNulls = addChars $ pure 0 --- | Given a \"list-y\" structure with analogues of 'take', 'drop', and 'length', +-- | Given a \"list-y\" structure with analogs of 'take', 'drop', and 'length', -- remove some elements at random. shrinkWith :: MonadRandom m From 1ba2147c1b46cc154122cb25cc0d31bd761cca94 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:58:44 +0300 Subject: [PATCH 09/11] fix Campaign.hs --- lib/Echidna/Campaign.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Campaign.hs b/lib/Echidna/Campaign.hs index 1b07cfa1e..65a8ee4d7 100644 --- a/lib/Echidna/Campaign.hs +++ b/lib/Echidna/Campaign.hs @@ -371,7 +371,7 @@ callseq vm txSeq = do where -- Given a list of transactions and a return typing rule, checks whether we - -- know the return type for each function called. If yes, tries to parse the + -- know the return type for each function called. If yes, try to parse the -- return value as a value of that type. Returns a 'GenDict' style Map. returnValues :: [(Tx, VMResult Concrete RealWorld)] From 908296be116c36fda48a8d4b749e5bbd626f8bdb Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:00:02 +0300 Subject: [PATCH 10/11] fix Exec.hs --- lib/Echidna/Exec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index afedf6245..3d0aea764 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -127,7 +127,7 @@ execTxWith executeTx tx = do fromEVM (continuation contract) liftIO $ atomicWriteIORef cacheRef $ Map.insert addr (Just contract) cache _ -> do - -- TODO: better error reporting in HEVM, when intermmittent + -- TODO: better error reporting in HEVM, when intermittent -- network error then retry liftIO $ atomicWriteIORef cacheRef $ Map.insert addr Nothing cache logMsg $ "ERROR: Failed to fetch contract: " <> show q From 64dd09acabcb496562ea479163d25240811a7cab Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:00:23 +0300 Subject: [PATCH 11/11] fix Onchain.hs --- lib/Echidna/Onchain.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Onchain.hs b/lib/Echidna/Onchain.hs index f791e5039..b511791a4 100644 --- a/lib/Echidna/Onchain.hs +++ b/lib/Echidna/Onchain.hs @@ -99,7 +99,7 @@ toFetchedContractData contract = } -- | Try to load the persisted RPC cache. --- TODO: we use the corpus dir for now, think where to place it +-- TODO: we use the corpus dir for now, think about where to place it loadRpcCache :: Env -> IO () loadRpcCache Env { cfg, fetchContractCache, fetchSlotCache } = case cfg.campaignConf.corpusDir of