feat(core): add ContractCode to the OpContext #30466 (#2030)

This commit is contained in:
Daniel Liu 2026-02-07 02:45:38 +08:00 committed by GitHub
parent ec78122a31
commit f744e86dd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

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