Skip to content

Commit

Permalink
precompiled contarct exposed to public
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyaniarun1993 committed Oct 30, 2023
1 parent 7e543c5 commit e273070
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import (
// deployed contract addresses (relevant after the account abstraction).
var emptyCodeHash = crypto.Keccak256Hash(nil)

func (evm *EVM) precompile(addr libcommon.Address) (PrecompiledContract, bool) {
// GetPrecompile checks and returns the precomplied contract
func (evm *EVM) GetPrecompileContract(addr libcommon.Address) (PrecompiledContract, bool) {
var precompiles map[libcommon.Address]PrecompiledContract
switch {
case evm.chainRules.IsCancun:
Expand Down Expand Up @@ -160,7 +161,7 @@ func (evm *EVM) Interpreter() Interpreter {

func (evm *EVM) call(typ OpCode, caller ContractRef, addr libcommon.Address, input []byte, gas uint64, value *uint256.Int, bailout bool) (ret []byte, leftOverGas uint64, err error) {
depth := evm.interpreter.Depth()
p, isPrecompile := evm.precompile(addr)
p, isPrecompile := evm.GetPrecompileContract(addr)

// Invoke tracer hooks that signal entering/exiting a call frame
if evm.Config().Tracer != nil {
Expand Down

0 comments on commit e273070

Please sign in to comment.