|
| 1 | +diff --git a/hevm.cabal b/hevm.cabal |
| 2 | +index cf36961e..3b31f595 100644 |
| 3 | +--- a/hevm.cabal |
| 4 | ++++ b/hevm.cabal |
| 5 | +@@ -71,6 +71,10 @@ library |
| 6 | + -Wall -Wno-deprecations |
| 7 | + extra-libraries: |
| 8 | + secp256k1, ff |
| 9 | ++ if os(darwin) |
| 10 | ++ extra-libraries: c++ |
| 11 | ++ else |
| 12 | ++ extra-libraries: stdc++ |
| 13 | + c-sources: |
| 14 | + ethjet/tinykeccak.c, ethjet/ethjet.c |
| 15 | + cxx-sources: |
| 16 | +@@ -88,7 +92,7 @@ library |
| 17 | + transformers >= 0.5.6 && < 0.6, |
| 18 | + tree-view >= 0.5 && < 0.6, |
| 19 | + abstract-par >= 0.3.3 && < 0.4, |
| 20 | +- aeson >= 1.5.6 && < 1.6, |
| 21 | ++ aeson >= 2.0 && < 2.1, |
| 22 | + bytestring >= 0.10.8 && < 0.11, |
| 23 | + scientific >= 0.3.6 && < 0.4, |
| 24 | + binary >= 0.8.6 && < 0.9, |
| 25 | +@@ -97,7 +101,7 @@ library |
| 26 | + vector >= 0.12.1 && < 0.13, |
| 27 | + ansi-wl-pprint >= 0.6.9 && < 0.7, |
| 28 | + base16-bytestring >= 1.0.0 && < 2.0, |
| 29 | +- brick >= 0.58 && < 0.63, |
| 30 | ++ brick >= 0.58 && < 0.69, |
| 31 | + megaparsec >= 9.0.0 && < 10.0, |
| 32 | + mtl >= 2.2.2 && < 2.3, |
| 33 | + directory >= 1.3.3 && < 1.4, |
| 34 | +@@ -105,13 +109,13 @@ library |
| 35 | + vty >= 5.25.1 && < 5.34, |
| 36 | + cereal >= 0.5.8 && < 0.6, |
| 37 | + cryptonite >= 0.27 && <= 0.29, |
| 38 | +- memory >= 0.14.18 && < 0.16, |
| 39 | ++ memory >= 0.14.18 && < 0.20, |
| 40 | + data-dword >= 0.3.1 && < 0.4, |
| 41 | + fgl >= 5.7.0 && < 5.8, |
| 42 | + free >= 5.1.3 && < 5.2, |
| 43 | + haskeline >= 0.8.0 && < 0.9, |
| 44 | + process >= 1.6.5 && < 1.7, |
| 45 | +- lens >= 4.17.1 && < 4.20, |
| 46 | ++ lens >= 4.17.1 && < 5.1, |
| 47 | + lens-aeson >= 1.0.2 && < 1.2, |
| 48 | + monad-par >= 0.3.5 && < 0.4, |
| 49 | + multiset >= 0.3.4 && < 0.4, |
| 50 | +@@ -124,7 +128,6 @@ library |
| 51 | + sbv >= 8.9, |
| 52 | + semver-range >= 0.2.7 && < 0.3, |
| 53 | + temporary >= 1.3 && < 1.4, |
| 54 | +- text-format >= 0.3.2 && < 0.4, |
| 55 | + witherable >= 0.3.5 && < 0.5, |
| 56 | + wreq >= 0.5.3 && < 0.6, |
| 57 | + regex-tdfa >= 1.2.3 && < 1.4, |
| 58 | +@@ -190,7 +193,6 @@ executable hevm |
| 59 | + sbv, |
| 60 | + temporary, |
| 61 | + text, |
| 62 | +- text-format, |
| 63 | + unordered-containers, |
| 64 | + vector, |
| 65 | + vty |
| 66 | +diff --git a/src/EVM/Solidity.hs b/src/EVM/Solidity.hs |
| 67 | +index b7d0f36b..4e9d6892 100644 |
| 68 | +--- a/src/EVM/Solidity.hs |
| 69 | ++++ b/src/EVM/Solidity.hs |
| 70 | +@@ -70,6 +70,7 @@ import Control.Monad |
| 71 | + import Control.Lens hiding (Indexed, (.=)) |
| 72 | + import qualified Data.String.Here as Here |
| 73 | + import Data.Aeson hiding (json) |
| 74 | ++import qualified Data.Aeson.KeyMap as KeyMap |
| 75 | + import Data.Aeson.Types |
| 76 | + import Data.Aeson.Lens |
| 77 | + import Data.Scientific |
| 78 | +@@ -714,8 +715,8 @@ astIdMap = foldMap f |
| 79 | + f :: Value -> Map Int Value |
| 80 | + f (Array x) = foldMap f x |
| 81 | + f v@(Object x) = |
| 82 | +- let t = foldMap f (HMap.elems x) |
| 83 | +- in case HMap.lookup "id" x of |
| 84 | ++ let t = foldMap f (KeyMap.elems x) |
| 85 | ++ in case KeyMap.lookup "id" x of |
| 86 | + Nothing -> t |
| 87 | + Just (Number i) -> t <> Map.singleton (round i) v |
| 88 | + Just _ -> t |
| 89 | +diff --git a/src/EVM/SymExec.hs b/src/EVM/SymExec.hs |
| 90 | +index 5bbf1c03..b828098e 100644 |
| 91 | +--- a/src/EVM/SymExec.hs |
| 92 | ++++ b/src/EVM/SymExec.hs |
| 93 | +@@ -40,8 +40,8 @@ type EquivalenceResult = ProofResult ([VM], [VM]) VM () |
| 94 | + |
| 95 | + -- | Convenience functions for generating large symbolic byte strings |
| 96 | + sbytes32, sbytes128, sbytes256, sbytes512, sbytes1024 :: Query ([SWord 8]) |
| 97 | +-sbytes32 = toBytes <$> freshVar_ @ (WordN 256) |
| 98 | +-sbytes128 = toBytes <$> freshVar_ @ (WordN 1024) |
| 99 | ++sbytes32 = toBytes <$> freshVar_ @(WordN 256) |
| 100 | ++sbytes128 = toBytes <$> freshVar_ @(WordN 1024) |
| 101 | + sbytes256 = liftA2 (++) sbytes128 sbytes128 |
| 102 | + sbytes512 = liftA2 (++) sbytes256 sbytes256 |
| 103 | + sbytes1024 = liftA2 (++) sbytes512 sbytes512 |
| 104 | +diff --git a/src/EVM/Types.hs b/src/EVM/Types.hs |
| 105 | +index fdd2368d..1dc29e83 100644 |
| 106 | +--- a/src/EVM/Types.hs |
| 107 | ++++ b/src/EVM/Types.hs |
| 108 | +@@ -434,17 +434,17 @@ readN s = fromIntegral (read s :: Integer) |
| 109 | + readNull :: Read a => a -> String -> a |
| 110 | + readNull x = fromMaybe x . Text.Read.readMaybe |
| 111 | + |
| 112 | +-wordField :: JSON.Object -> Text -> JSON.Parser W256 |
| 113 | ++wordField :: JSON.Object -> Key -> JSON.Parser W256 |
| 114 | + wordField x f = ((readNull 0) . Text.unpack) |
| 115 | + <$> (x .: f) |
| 116 | + |
| 117 | +-addrField :: JSON.Object -> Text -> JSON.Parser Addr |
| 118 | ++addrField :: JSON.Object -> Key -> JSON.Parser Addr |
| 119 | + addrField x f = (read . Text.unpack) <$> (x .: f) |
| 120 | + |
| 121 | +-addrFieldMaybe :: JSON.Object -> Text -> JSON.Parser (Maybe Addr) |
| 122 | ++addrFieldMaybe :: JSON.Object -> Key -> JSON.Parser (Maybe Addr) |
| 123 | + addrFieldMaybe x f = (Text.Read.readMaybe . Text.unpack) <$> (x .: f) |
| 124 | + |
| 125 | +-dataField :: JSON.Object -> Text -> JSON.Parser ByteString |
| 126 | ++dataField :: JSON.Object -> Key -> JSON.Parser ByteString |
| 127 | + dataField x f = hexText <$> (x .: f) |
| 128 | + |
| 129 | + toWord512 :: W256 -> Word512 |
0 commit comments