Skip to content

Commit

Permalink
Fixing fetching RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
msooseth committed Jul 30, 2024
1 parent 2d37ede commit fdeeb04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,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

## Fixed
- `concat` is a 2-ary, not an n-ary function in SMT2LIB, declare-const does not exist in QF_AUFBV, replacing
Expand Down
10 changes: 5 additions & 5 deletions src/EVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,13 +1315,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
Expand Down Expand Up @@ -1665,7 +1665,7 @@ cheatActions = Map.fromList
Just a -> assign (#config % #overrideCaller) (Just a)
Nothing -> vmError (BadCheatCode sig)
_ -> vmError (BadCheatCode sig)

, action "startPrank(address)" $
\sig _ _ input -> case decodeStaticArgs 0 1 input of
[addr] -> case wordToAddr addr of
Expand Down

0 comments on commit fdeeb04

Please sign in to comment.