diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 987dfa7a1e..882eb52837 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -34,6 +34,7 @@ type OpContext interface { Address() common.Address CallValue() *uint256.Int CallInput() []byte + ContractCode() []byte } // StateDB gives tracers access to the whole state. diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 6e7d28a0ce..4f4028b725 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -83,6 +83,11 @@ func (ctx *ScopeContext) CallInput() []byte { return ctx.Contract.Input } +// ContractCode returns the code of the contract being executed. +func (ctx *ScopeContext) ContractCode() []byte { + return ctx.Contract.Code +} + // EVMInterpreter represents an EVM interpreter type EVMInterpreter struct { evm *EVM