Skip to content
Closed
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
62 changes: 8 additions & 54 deletions hevm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ common shared
-Wno-unticked-promoted-constructors
-Wno-orphans
-Wno-ambiguous-fields
-Wunused-packages
-optc-Wno-ignored-attributes
-fspecialize-aggressively
-fexpose-all-unfoldings
Expand Down Expand Up @@ -133,11 +134,8 @@ library
QuickCheck >= 2.13.2 && < 2.15,
Decimal >= 0.5.1 && < 0.6,
containers >= 0.6.0 && < 0.7,
deepseq >= 1.4.4 && < 1.5,
time >= 1.11 && < 1.14,
transformers >= 0.5.6 && < 0.6,
tree-view >= 0.5 && < 0.6,
abstract-par >= 0.3.3 && < 0.4,
aeson >= 2.0.0 && < 2.2,
bytestring >= 0.11.3.1 && < 0.12,
scientific >= 0.3.6 && < 0.4,
Expand All @@ -148,46 +146,32 @@ library
base16 >= 0.3.2.0 && < 0.3.3.0,
megaparsec >= 9.0.0 && < 10.0,
mtl >= 2.2.2 && < 2.3,
directory >= 1.3.3 && < 1.4,
filepath >= 1.4.2 && < 1.5,
cereal >= 0.5.8 && < 0.6,
cryptonite >= 0.30 && < 0.31,
memory >= 0.16.0 && < 0.20,
data-dword >= 0.3.1 && < 0.4,
free >= 5.1.3 && < 5.2,
haskeline >= 0.8.0 && < 0.9,
process >= 1.6.5 && < 1.7,
optics-core >= 0.4.1 && < 0.5,
optics-extra >= 0.4.2.1 && < 0.5,
optics-th >= 0.4.1 && < 0.5,
aeson-optics >= 1.2.0.1 && < 1.3,
monad-par >= 0.3.5 && < 0.4,
async >= 2.2.4 && < 2.3,
multiset >= 0.3.4 && < 0.4,
operational >= 0.2.3 && < 0.3,
optparse-generic >= 1.3.1 && < 1.5,
pretty-hex >= 1.1 && < 1.2,
quickcheck-text >= 0.1.2 && < 0.2,
restless-git >= 0.7 && < 0.8,
rosezipper >= 0.2 && < 0.3,
temporary >= 1.3 && < 1.4,
witherable >= 0.3.5 && < 0.5,
wreq >= 0.5.3 && < 0.6,
regex-tdfa >= 1.2.3 && < 1.4,
base >= 4.9 && < 5,
here >= 1.2.13 && < 1.3,
smt2-parser >= 0.1.0.1,
word-wrap >= 0.5 && < 0.6,
spool >= 0.1 && < 0.2,
stm >= 2.5.0 && < 2.6.0,
spawn >= 0.3 && < 0.4,
filepattern >= 0.1.2 && < 0.2,
witch >= 1.1 && < 1.3,
unliftio-core >= 0.2.1.0
if !os(windows)
build-depends:
brick >= 1.4 && < 2.0,
vty >= 5.37 && < 5.39
hs-source-dirs:
src

Expand All @@ -203,36 +187,14 @@ executable hevm
if os(darwin)
extra-libraries: c++
build-depends:
QuickCheck,
aeson,
async,
base,
base16,
binary,
brick,
bytestring,
containers,
cryptonite,
data-dword,
deepseq,
directory,
filepath,
free,
hevm,
memory,
mtl,
optparse-generic,
operational,
process,
quickcheck-text,
regex-tdfa,
temporary,
text,
unordered-containers,
vector,
vty,
stm,
spawn,
optics-core,
githash >= 0.1.6 && < 0.2,
witch,
Expand All @@ -252,13 +214,10 @@ common test-base
autogen-modules:
Paths_hevm
build-depends:
HUnit >= 1.6,
QuickCheck,
quickcheck-instances,
aeson,
base,
base16,
binary,
containers,
directory,
bytestring,
Expand All @@ -267,31 +226,21 @@ common test-base
here,
hevm,
mtl,
data-dword,
process,
tasty >= 1.0,
tasty-hunit >= 0.10,
tasty-quickcheck >= 0.9,
tasty-expected-failure >= 0.12,
temporary,
text,
regex-tdfa,
regex,
time,
array,
vector,
tasty-bench,
stm >= 2.5.0,
spawn >= 0.3,
witherable,
smt2-parser >= 0.1.0.1,
operational,
optics-core,
optics-extra,
witch,
unliftio-core,
exceptions,
MissingH

library test-utils
import:
Expand Down Expand Up @@ -326,6 +275,13 @@ test-suite test
test-common
type:
exitcode-stdio-1.0
build-depends:
base16,
binary,
data-dword,
regex,
time,
MissingH
main-is:
test.hs

Expand Down Expand Up @@ -372,10 +328,8 @@ benchmark bench
bytestring,
text,
hevm,
here,
test-utils,
filemanip,
filepath,
containers,
mtl,
unliftio-core
1 change: 1 addition & 0 deletions src/EVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import EVM.Types qualified as Expr (Expr(Gas))
import EVM.Sign qualified
import EVM.Concrete qualified as Concrete

import Control.Monad (unless, when)
import Control.Monad.ST (ST)
import Control.Monad.State.Strict hiding (state)
import Data.Bits (FiniteBits, countLeadingZeros, finiteBitSize)
Expand Down
2 changes: 1 addition & 1 deletion src/EVM/ABI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ bytesP :: ReadP ByteStringS
bytesP = do
_ <- string "0x"
hex <- munch isHexDigit
case BS16.decodeBase16 (encodeUtf8 (Text.pack hex)) of
case BS16.decodeBase16Untyped (encodeUtf8 (Text.pack hex)) of
Right d -> pure $ ByteStringS d
Left _ -> pfail

Expand Down
1 change: 1 addition & 0 deletions src/EVM/Effects.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ only.

module EVM.Effects where

import Control.Monad (when)
import Control.Monad.Reader
import Control.Monad.IO.Unlift
import EVM.Dapp (DappInfo)
Expand Down
1 change: 1 addition & 0 deletions src/EVM/Expr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
module EVM.Expr where

import Prelude hiding (LT, GT)
import Control.Monad (when)
import Control.Monad.ST
import Data.Bits hiding (And, Xor)
import Data.ByteString (ByteString)
Expand Down
6 changes: 3 additions & 3 deletions src/EVM/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import EVM (traceForest, traceForest', traceContext, cheatCode)
import EVM.ABI (getAbiSeq, parseTypeName, AbiValue(..), AbiType(..), SolError(..), Indexed(..), Event(..))
import EVM.Dapp (DappContext(..), DappInfo(..), findSrc, showTraceLocation)
import EVM.Expr qualified as Expr
import EVM.Solidity (SolcContract(..), Method(..), contractName, abiMap)
import EVM.Solidity (SolcContract(..), Method(..))

import Control.Arrow ((>>>))
import Optics.Core
Expand Down Expand Up @@ -823,13 +823,13 @@ strip0x' s = if "0x" `isPrefixOf` s then drop 2 s else s

hexByteString :: String -> ByteString -> ByteString
hexByteString msg bs =
case BS16.decodeBase16 bs of
case BS16.decodeBase16Untyped bs of
Right x -> x
_ -> internalError $ "invalid hex bytestring for " ++ msg

hexText :: Text -> ByteString
hexText t =
case BS16.decodeBase16 (T.encodeUtf8 (T.drop 2 t)) of
case BS16.decodeBase16Untyped (T.encodeUtf8 (T.drop 2 t)) of
Right x -> x
_ -> internalError $ "invalid hex bytestring " ++ show t

Expand Down
1 change: 1 addition & 0 deletions src/EVM/Fuzz.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
module EVM.Fuzz where

import Prelude hiding (LT, GT, lookup)
import Control.Monad (replicateM)
import Control.Monad.State
import Data.Maybe (fromMaybe)
import Data.Map.Strict as Map (fromList, Map, (!), (!?), insert)
Expand Down
4 changes: 2 additions & 2 deletions src/EVM/Solidity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import Optics.Operators.Unsafe
import Control.Applicative
import Control.Monad
import Control.Monad.IO.Unlift
import Data.Aeson hiding (json)
import Data.Aeson
import Data.Aeson.Types
import Data.Aeson.Optics
import Data.Aeson.Key qualified as Key
Expand Down Expand Up @@ -658,7 +658,7 @@ containsLinkerHole :: Text -> Bool
containsLinkerHole = regexMatches "__\\$[a-z0-9]{34}\\$__"

toCode :: Text -> Text -> ByteString
toCode contractName t = case BS16.decodeBase16 (encodeUtf8 t) of
toCode contractName t = case BS16.decodeBase16Untyped (encodeUtf8 t) of
Right d -> d
Left e -> if containsLinkerHole t
then error $ T.unpack ("Error toCode: unlinked libraries detected in bytecode, in " <> contractName)
Expand Down
1 change: 1 addition & 0 deletions src/EVM/SymExec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module EVM.SymExec where
import Control.Concurrent.Async (concurrently, mapConcurrently)
import Control.Concurrent.Spawn (parMapIO, pool)
import Control.Concurrent.STM (atomically, TVar, readTVarIO, readTVar, newTVarIO, writeTVar)
import Control.Monad (when, forM_)
import Control.Monad.Operational qualified as Operational
import Control.Monad.ST (RealWorld, stToIO, ST)
import Control.Monad.State.Strict
Expand Down
3 changes: 2 additions & 1 deletion src/EVM/Traversals.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module EVM.Traversals where

import Prelude hiding (LT, GT)

import Control.Monad.Identity
import Control.Monad (void, forM)
import Control.Monad.Identity (runIdentity, Identity (..))
import qualified Data.Map.Strict as Map
import Data.List (foldl')

Expand Down
5 changes: 3 additions & 2 deletions src/EVM/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ module EVM.Types where

import GHC.Stack (HasCallStack, prettyCallStack, callStack)
import Control.Arrow ((>>>))
import Control.Monad (mzero)
import Control.Monad.ST (ST)
import Control.Monad.State.Strict (StateT, mzero)
import Control.Monad.State.Strict (StateT)
import Crypto.Hash (hash, Keccak_256, Digest)
import Data.Aeson
import Data.Aeson qualified as JSON
Expand Down Expand Up @@ -1055,7 +1056,7 @@ instance Show ByteStringS where
T.decodeUtf8 . toStrict . toLazyByteString . byteStringHex

instance JSON.FromJSON ByteStringS where
parseJSON (JSON.String x) = case BS16.decodeBase16' x of
parseJSON (JSON.String x) = case BS16.decodeBase16Untyped (T.encodeUtf8 x) of
Left _ -> mzero
Right bs -> pure (ByteStringS bs)
parseJSON _ = mzero
Expand Down
1 change: 1 addition & 0 deletions src/EVM/UnitTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import EVM.Transaction (initTx)
import EVM.Stepper (Stepper)
import EVM.Stepper qualified as Stepper

import Control.Monad (void, when, forM)
import Control.Monad.ST (RealWorld, ST, stToIO)
import Optics.Core hiding (elements)
import Optics.State
Expand Down
3 changes: 2 additions & 1 deletion test/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Prelude hiding (LT, GT)

import GHC.TypeLits
import Data.Proxy
import Control.Monad
import Control.Monad.ST (RealWorld, stToIO)
import Control.Monad.State.Strict
import Control.Monad.IO.Unlift
Expand Down Expand Up @@ -3615,7 +3616,7 @@ loadVM x = do

hex :: ByteString -> ByteString
hex s =
case BS16.decodeBase16 s of
case BS16.decodeBase16Untyped s of
Right x -> x
Left e -> internalError $ T.unpack e

Expand Down