From 022f6eee30de2ed31ef6464b9078a84c101e62fa Mon Sep 17 00:00:00 2001 From: Mate Soos Date: Mon, 23 Dec 2024 13:03:44 +0100 Subject: [PATCH] Cleaner --- src/EVM.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/EVM.hs b/src/EVM.hs index 42a0a1b8d..6d319c71b 100644 --- a/src/EVM.hs +++ b/src/EVM.hs @@ -287,8 +287,8 @@ getOpW8 state = case state.code of getOpName :: forall (t :: VMType) s . FrameState t s -> [Char] getOpName state = intToOpName $ fromEnum $ getOpW8 state -canResolveAddr :: forall (t :: VMType) s . VMOps t => Expr EAddr -> EVM t s (Bool) -canResolveAddr addr = do +canFetchAccount :: forall (t :: VMType) s . VMOps t => Expr EAddr -> EVM t s (Bool) +canFetchAccount addr = do use (#env % #contracts % at addr) >>= \case Just _ -> pure True Nothing -> case addr of @@ -996,10 +996,9 @@ exec1 = do Just xTo' -> do case gasTryFrom xGas of Left _ -> vmError IllegalOverflow - Right gas -> do - ok <- canResolveAddr xTo' - if not ok then fallback - else do + Right gas -> canFetchAccount xTo' >>= \case + False -> fallback + True -> do overrideC <- use $ #state % #overrideCaller delegateCall this gas xTo' xTo' (Lit 0) xInOffset xInSize xOutOffset xOutSize xs $ \callee -> do