From c6d279c01ae7a2a1ce165bca48d7effb601f3ddf Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 21 Oct 2023 11:43:26 +0200 Subject: [PATCH] fix: no value for staticcall call traces (#5117) --- crates/revm/revm-inspectors/src/tracing/types.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/revm/revm-inspectors/src/tracing/types.rs b/crates/revm/revm-inspectors/src/tracing/types.rs index 71439b139..a85942add 100644 --- a/crates/revm/revm-inspectors/src/tracing/types.rs +++ b/crates/revm/revm-inspectors/src/tracing/types.rs @@ -32,14 +32,22 @@ pub enum CallKind { impl CallKind { /// Returns true if the call is a create + #[inline] pub fn is_any_create(&self) -> bool { matches!(self, CallKind::Create | CallKind::Create2) } /// Returns true if the call is a delegate of some sorts + #[inline] pub fn is_delegate(&self) -> bool { matches!(self, CallKind::DelegateCall | CallKind::CallCode) } + + /// Returns true if the call is [CallKind::StaticCall]. + #[inline] + pub fn is_static_call(&self) -> bool { + matches!(self, CallKind::StaticCall) + } } impl std::fmt::Display for CallKind { @@ -413,6 +421,11 @@ impl CallTraceNode { logs: Default::default(), }; + if self.trace.kind.is_static_call() { + // STATICCALL frames don't have a value + call_frame.value = None; + } + // we need to populate error and revert reason if !self.trace.success { call_frame.revert_reason = decode_revert_reason(self.trace.output.as_ref());