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 4a39aaad00..793f398367 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -84,6 +84,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