feat(tracing/hooks.go): add ContractCode method to OpContext interface to provide access to contract code

feat(vm/interpreter.go): add ContractCode method to ScopeContext to return the code of the contract being executed
This commit is contained in:
kchojn 2024-09-19 11:27:26 +02:00
parent c4c2c4fb14
commit 85df9c2732
2 changed files with 6 additions and 0 deletions

View file

@ -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.

View file

@ -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