@@ -17,9 +17,10 @@ import Data.Text (pack, Text)
1717import Data.Tree (flatten )
1818import Data.Tree.Zipper (fromForest , TreePos , Empty )
1919import Data.Vector (fromList )
20+ import Data.Vector qualified as V
2021
2122import EVM (traceForest )
22- import EVM.ABI (Event (.. ), Indexed (.. ), decodeAbiValue , getAbi , AbiType (.. ), AbiValue (.. ))
23+ import EVM.ABI (Event (.. ), Indexed (.. ), decodeAbiValue , getAbiSeq , AbiType (.. ), AbiValue (.. ))
2324import EVM.Dapp (DappContext (.. ), DappInfo (.. ))
2425import EVM.Expr (maybeLitWordSimp )
2526import EVM.Format (showValues , showError , contractNamePart )
@@ -91,10 +92,12 @@ extractEventValues dappInfo vm vm' =
9192 LogEntry _addr (ConcreteBuf bs) (sigHash : _) ->
9293 case Map. lookup (forceWord sigHash) dappInfo. eventMap of
9394 Just (Event _ _ params) ->
94- [ (ty, val)
95- | (_, ty, NotIndexed ) <- params
96- , Right (_, _, val) <- [ runGetOrFail (getAbi ty) (fromStrict bs) ]
97- ]
95+ let
96+ types = [ t | (_, t, NotIndexed ) <- params ]
97+ in
98+ case runGetOrFail (getAbiSeq (length types) types) (fromStrict bs) of
99+ Right (_, _, vals) -> zip types (V. toList vals)
100+ _ -> []
98101 Nothing -> []
99102 _ -> []
100103
0 commit comments