Skip to content

Commit

Permalink
feat: trace state change only if store is nil (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
recursion128 authored Jul 5, 2022
1 parent 3e9f6a2 commit 4a41150
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/txtracev1/trace_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (ot *OeTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scop
fromTrace.childTraces = append(fromTrace.childTraces, trace)
case vm.SSTORE:
stackLen := len(stack.Data())
if stackLen >= 2 {
if stackLen >= 2 && ot.store == nil {
accountAddress := contract.Address()
if ot.stateDiff[accountAddress] == nil {
ot.stateDiff[accountAddress] = make(AccountDiff)
Expand Down
2 changes: 1 addition & 1 deletion pkg/txtracev2/trace_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func (ot *OeTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scop
ot.traceStack[len(ot.traceStack)-1].Error = "execution reverted"
case vm.SSTORE:
stackLen := len(scope.Stack.Data())
if stackLen >= 2 {
if stackLen >= 2 && ot.store == nil {
accountAddress := scope.Contract.Address()
if ot.stateDiff[accountAddress] == nil {
ot.stateDiff[accountAddress] = make(AccountDiff)
Expand Down

0 comments on commit 4a41150

Please sign in to comment.