From 1d05e317925e9c167b8c62b6e7ecb32291bd49d0 Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 6 Nov 2024 08:28:15 -0800 Subject: [PATCH] Prevent zero tracer from panic in edge cases (#1411) --- eth/tracers/native/zero.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tracers/native/zero.go b/eth/tracers/native/zero.go index 3d4c05b51a6..65c32c30069 100644 --- a/eth/tracers/native/zero.go +++ b/eth/tracers/native/zero.go @@ -115,7 +115,7 @@ func (t *zeroTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, sco slot := libcommon.Hash(stackData[stackLen-1].Bytes32()) t.addAccountToTrace(caller) t.addSLOADToAccount(caller, slot) - case stackLen >= 1 && op == vm.SSTORE: + case stackLen >= 2 && op == vm.SSTORE: slot := libcommon.Hash(stackData[stackLen-1].Bytes32()) t.addAccountToTrace(caller) t.addSSTOREToAccount(caller, slot, stackData[stackLen-2].Clone())