internal/ethapi: skip transfer capture for callcode in log tracer

CALLCODE executes in the caller's context and does not transfer value
to the callee, so exclude it alongside delegatecall.
This commit is contained in:
Weixie Cui 2026-06-28 21:22:08 +08:00
parent ab134b2101
commit abde3fa7cc

View file

@ -80,7 +80,7 @@ func (t *tracer) Hooks() *tracing.Hooks {
func (t *tracer) onEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) { func (t *tracer) onEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
t.logs = append(t.logs, make([]*types.Log, 0)) t.logs = append(t.logs, make([]*types.Log, 0))
if vm.OpCode(typ) != vm.DELEGATECALL && value != nil && value.Cmp(common.Big0) > 0 { if vm.OpCode(typ) != vm.DELEGATECALL && vm.OpCode(typ) != vm.CALLCODE && value != nil && value.Cmp(common.Big0) > 0 {
t.captureTransfer(from, to, value) t.captureTransfer(from, to, value)
} }
} }