diff --git a/x/evm/vm/geth/geth.go b/x/evm/vm/geth/geth.go index ebbf8743db..33d333c8a8 100644 --- a/x/evm/vm/geth/geth.go +++ b/x/evm/vm/geth/geth.go @@ -21,8 +21,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/precompile/contract" - evm "github.com/evmos/ethermint/x/evm/vm" ) @@ -67,14 +65,14 @@ func (e EVM) Config() vm.Config { return e.EVM.Config } -// Precompile returns the precompiled contract associated with the given address -// and the current chain configuration. If the contract cannot be found it returns -// nil. -func (e EVM) Precompile(addr common.Address) (p contract.StatefulPrecompiledContract, found bool) { - precompiles := GetPrecompiles(e.ChainConfig(), e.EVM.Context.BlockNumber) - p, found = precompiles[addr] - return p, found -} +//// Precompile returns the precompiled contract associated with the given address +//// and the current chain configuration. If the contract cannot be found it returns +//// nil. +//func (e EVM) Precompile(addr common.Address) (p contract.StatefulPrecompiledContract, found bool) { +// precompiles := GetPrecompiles(e.ChainConfig(), e.EVM.Context.BlockNumber) +// p, found = precompiles[addr] +// return p, found +//} // ActivePrecompiles returns a list of all the active precompiled contract addresses // for the current chain configuration. diff --git a/x/evm/vm/geth/precompiles.go b/x/evm/vm/geth/precompiles.go index 66c842dfe2..ce9e98ec3d 100644 --- a/x/evm/vm/geth/precompiles.go +++ b/x/evm/vm/geth/precompiles.go @@ -15,28 +15,28 @@ // along with the Ethermint library. If not, see https://github.com/evmos/ethermint/blob/main/LICENSE package geth -import ( - "math/big" - - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - - evm "github.com/evmos/ethermint/x/evm/vm" -) - -// GetPrecompiles returns all the precompiled contracts defined given the -// current chain configuration and block height. -func GetPrecompiles(cfg *params.ChainConfig, blockNumber *big.Int) evm.StatefulPrecompiledContracts { - var precompiles evm.StatefulPrecompiledContracts - switch { - case cfg.IsBerlin(blockNumber): - precompiles = vm.PrecompiledContractsBerlin - case cfg.IsIstanbul(blockNumber): - precompiles = vm.PrecompiledContractsIstanbul - case cfg.IsByzantium(blockNumber): - precompiles = vm.PrecompiledContractsByzantium - default: - precompiles = vm.PrecompiledContractsHomestead - } - return precompiles -} +//import ( +// "math/big" +// +// "github.com/ethereum/go-ethereum/core/vm" +// "github.com/ethereum/go-ethereum/params" +// +// evm "github.com/evmos/ethermint/x/evm/vm" +//) +// +//// GetPrecompiles returns all the precompiled contracts defined given the +//// current chain configuration and block height. +//func GetPrecompiles(cfg *params.ChainConfig, blockNumber *big.Int) evm.StatefulPrecompiledContracts { +// var precompiles evm.StatefulPrecompiledContracts +// switch { +// case cfg.IsBerlin(blockNumber): +// precompiles = vm.PrecompiledContractsBerlin +// case cfg.IsIstanbul(blockNumber): +// precompiles = vm.PrecompiledContractsIstanbul +// case cfg.IsByzantium(blockNumber): +// precompiles = vm.PrecompiledContractsByzantium +// default: +// precompiles = vm.PrecompiledContractsHomestead +// } +// return precompiles +//} diff --git a/x/evm/vm/interface.go b/x/evm/vm/interface.go index c7eea40c76..2ccf9bbbe1 100644 --- a/x/evm/vm/interface.go +++ b/x/evm/vm/interface.go @@ -62,7 +62,7 @@ type EVM interface { ChainConfig() *params.ChainConfig ActivePrecompiles(rules params.Rules) []common.Address - Precompile(addr common.Address) (contract.StatefulPrecompiledContract, bool) + //Precompile(addr common.Address) (contract.StatefulPrecompiledContract, bool) RunPrecompiledContract( p StatefulPrecompiledContract, addr common.Address,