diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e57474b8..550c6f05b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - PAnd props are now recursively flattened - Double negation in Prop are removed - Updated forge to modern version, thereby fixing JSON parsing of new forge JSONs +- Fixed RPC fetching of contract data - Symbolic ABI encoding for tuples, fuzzer for encoder - Printing `Addrs` when running `symbolic` for counterexamples and reachable end states - Improved symbolic execution tutorial diff --git a/src/EVM.hs b/src/EVM.hs index 1bf87a7b8..261607f72 100644 --- a/src/EVM.hs +++ b/src/EVM.hs @@ -1426,13 +1426,13 @@ accessStorage addr slot continue = do fetchAccount addr $ \_ -> accessStorage addr slot continue where - rpcCall c slotConc = if c.external + rpcCall c slotConc = fetchAccount addr $ \_ -> + if c.external then forceConcreteAddr addr "cannot read storage from symbolic addresses via rpc" $ \addr' -> forceConcrete slotConc "cannot read symbolic slots via RPC" $ \slot' -> do -- check if the slot is cached - contract <- preuse (#cache % #fetched % ix addr') - case contract of - Nothing -> internalError "contract marked external not found in cache" + use (#env % #contracts % at (LitAddr addr')) >>= \case + Nothing -> internalError $ "contract addr " <> show addr' <> " marked external not found in cache" Just fetched -> case readStorage (Lit slot') fetched.storage of Nothing -> mkQuery addr' slot' Just val -> continue val