diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-08-10 19:07:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-11 20:24:54 +0800 |
commit | 7bbdf3e2687ea293b68a7f73c039cbde411217fa (patch) | |
tree | 1276b6a3547f3d76516b0aca8e51623aa5725bf2 /core/vm/evm.go | |
parent | 6ca59d98f88d4b4cc8bdeb2f023ff8c1fa228c6f (diff) | |
download | go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar.gz go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar.bz2 go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar.lz go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar.xz go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.tar.zst go-tangerine-7bbdf3e2687ea293b68a7f73c039cbde411217fa.zip |
core: add Metropolis pre-compiles (EIP 197, 198 and 213)
Diffstat (limited to 'core/vm/evm.go')
-rw-r--r-- | core/vm/evm.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/vm/evm.go b/core/vm/evm.go index 9296cc7ca..20eaaccb4 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -37,6 +37,10 @@ type ( func run(evm *EVM, snapshot int, contract *Contract, input []byte) ([]byte, error) { if contract.CodeAddr != nil { precompiledContracts := PrecompiledContracts + if evm.ChainConfig().IsMetropolis(evm.BlockNumber) { + precompiledContracts = PrecompiledContractsMetropolis + } + if p := precompiledContracts[*contract.CodeAddr]; p != nil { return RunPrecompiledContract(p, input, contract) } @@ -100,8 +104,8 @@ type EVM struct { abort int32 } -// NewEVM retutrns a new EVM evmironment. The returned EVM is not thread safe -// and should only ever be used *once*. +// NewEVM retutrns a new EVM . The returned EVM is not thread safe and should +// only ever be used *once*. func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmConfig Config) *EVM { evm := &EVM{ Context: ctx, |