diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 12a436dff1..de5d06a8fd 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 a566537d0e..c4041b31b8 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -80,6 +80,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 +} + // Run loops and evaluates the contract's code with the given input data and returns // the return byte-slice and an error if one occurred. //