Added IsPrecompileAddr on EVM to let tracer easily determine if an address is a precompiled address

This commit is contained in:
Matthieu Vachon 2023-07-28 17:03:59 -04:00
parent b9bcdef066
commit d723124530

View file

@ -38,6 +38,11 @@ type (
GetHashFunc func(uint64) common.Hash
)
func (evm *EVM) IsPrecompileAddr(addr common.Address) bool {
_, isPrecompile := evm.precompile(addr)
return isPrecompile
}
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
var precompiles map[common.Address]PrecompiledContract
switch {