Skip to content

Commit

Permalink
add other state access to touch tracer (ethereum#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush authored and avalonche committed Mar 9, 2023
1 parent 8e3aa5e commit 440f516
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion eth/tracers/logger/account_touch_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ func (t *AccountTouchTracer) CaptureEnter(_ vm.OpCode, _ common.Address, to comm

func (t *AccountTouchTracer) CaptureExit([]byte, uint64, error) {}

func (t *AccountTouchTracer) CaptureState(uint64, vm.OpCode, uint64, uint64, *vm.ScopeContext, []byte, int, error) {
func (t *AccountTouchTracer) CaptureState(_ uint64, op vm.OpCode, _, _ uint64, scope *vm.ScopeContext, _ []byte, _ int, _ error) {
stack := scope.Stack
stackData := stack.Data()
stackLen := len(stackData)
if (op == vm.EXTCODECOPY || op == vm.EXTCODEHASH || op == vm.EXTCODESIZE || op == vm.BALANCE || op == vm.SELFDESTRUCT) && stackLen >= 1 {
addr := common.Address(stackData[stackLen-1].Bytes20())
t.touched[addr] = struct{}{}
}
}

func (t *AccountTouchTracer) CaptureFault(uint64, vm.OpCode, uint64, uint64, *vm.ScopeContext, int, error) {
Expand Down

0 comments on commit 440f516

Please sign in to comment.