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

Update hevm to 5f48aaa93e18cf8f42b46109c04a76234b746dc6 #1346

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
hevm = pkgs: pkgs.lib.pipe ((hsPkgs pkgs).callCabal2nix "hevm" (pkgs.fetchFromGitHub {
owner = "ethereum";
repo = "hevm";
rev = "release/0.54.2";
sha256 = "sha256-h0e6QeMBIUkyANYdrGjrqZ2M4fnODOB0gNPQtsrAiL8=";
rev = "5f48aaa93e18cf8f42b46109c04a76234b746dc6";
sha256 = "sha256-RNT6ySisP1mdR0NJ1Yyu12A4duzsFCfya+l4CNXHlgQ=";
}) { secp256k1 = pkgs.secp256k1; })
([
pkgs.haskell.lib.compose.dontCheck
Expand Down
3 changes: 2 additions & 1 deletion lib/Echidna/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Data.Vector (fromList)
import EVM (traceForest)
import EVM.ABI (Event(..), Indexed(..), decodeAbiValue, AbiType(..), AbiValue(..))
import EVM.Dapp (DappContext(..), DappInfo(..))
import EVM.Expr (maybeLitWordSimp)
import EVM.Format (showValues, showError, contractNamePart)
import EVM.Solidity (SolcContract(..))
import EVM.Types
Expand All @@ -37,7 +38,7 @@ extractEvents decodeErrors dappInfo vm =
where
showTrace trace =
let ?context = DappContext { info = dappInfo, contracts = vm.env.contracts, labels = vm.labels } in
let codehash' = fromJust $ maybeLitWord trace.contract.codehash
let codehash' = fromJust $ maybeLitWordSimp trace.contract.codehash
maybeContractName = maybeContractNameFromCodeHash dappInfo codehash'
in case trace.tracedata of
EventTrace addr bytes (topic:_) ->
Expand Down
5 changes: 3 additions & 2 deletions lib/Echidna/SourceMapping.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import Data.Maybe (mapMaybe)
import Data.Vector qualified as V
import Echidna.Symbolic (forceWord)
import EVM.Dapp (DappInfo(..), findSrc)
import EVM.Expr (maybeLitByteSimp)
import EVM.Solidity (SolcContract(..))
import EVM.Types (Contract(..), ContractCode(..), RuntimeCode(..), W256, maybeLitByte)
import EVM.Types (Contract(..), ContractCode(..), RuntimeCode(..), W256)

-- | Map from contracts' codehashes to their compile-time codehash.
-- This is relevant when the immutables solidity feature is used;
Expand Down Expand Up @@ -80,7 +81,7 @@ findSrcByMetadata contr dapp = find compareMetadata (snd <$> Map.elems dapp.solc
(UnknownCode _) -> Nothing
(InitCode c _) -> Just c
(RuntimeCode (ConcreteRuntimeCode c)) -> Just c
(RuntimeCode (SymbolicRuntimeCode c)) -> Just $ BS.pack $ mapMaybe maybeLitByte $ V.toList c
(RuntimeCode (SymbolicRuntimeCode c)) -> Just $ BS.pack $ mapMaybe maybeLitByteSimp $ V.toList c

getBytecodeMetadata :: ByteString -> ByteString
getBytecodeMetadata bs =
Expand Down
1 change: 1 addition & 0 deletions lib/Echidna/SymExec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ vmMakeSymbolic vm
, currentFork = vm.currentFork
, labels = vm.labels
, osEnv = vm.osEnv
, freshVar = vm.freshVar
}

frameStateMakeSymbolic :: FrameState Concrete s -> FrameState Symbolic s
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ packages:

extra-deps:
- git: https://github.com/ethereum/hevm.git
commit: 037ff11779d0089378f01cb103db1171dc642be2
commit: 5f48aaa93e18cf8f42b46109c04a76234b746dc6

- smt2-parser-0.1.0.1@sha256:1e1a4565915ed851c13d1e6b8bb5185cf5d454da3b43170825d53e221f753d77,1421
- spawn-0.3@sha256:b91e01d8f2b076841410ae284b32046f91471943dc799c1af77d666c72101f02,1162
Expand Down
Loading