aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accounts/external/backend.go2
-rw-r--r--consensus/dummy/consensus.go4
-rw-r--r--core/blockchain.go17
-rw-r--r--core/state/database.go2
-rw-r--r--core/state/dump.go43
-rw-r--r--core/state/snapshot/account.go20
-rw-r--r--core/state/snapshot/generate.go11
-rw-r--r--core/state/statedb.go5
-rw-r--r--core/types/block.go32
-rw-r--r--core/vm/evm.go12
-rw-r--r--eth/api_backend.go2
-rw-r--r--eth/backend.go2
-rw-r--r--eth/filters/filter.go2
-rw-r--r--examples/chain/main.go4
-rw-r--r--examples/counter/counter.sol2
-rw-r--r--examples/multicoin/main.go4
-rw-r--r--internal/ethapi/backend.go2
-rw-r--r--plugin/evm/vm.go2
18 files changed, 95 insertions, 73 deletions
diff --git a/accounts/external/backend.go b/accounts/external/backend.go
index f3744cf..e0fc91d 100644
--- a/accounts/external/backend.go
+++ b/accounts/external/backend.go
@@ -23,12 +23,12 @@ import (
"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/core/types"
+ "github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
- "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/signer/core"
)
diff --git a/consensus/dummy/consensus.go b/consensus/dummy/consensus.go
index da63673..42e224d 100644
--- a/consensus/dummy/consensus.go
+++ b/consensus/dummy/consensus.go
@@ -262,10 +262,10 @@ func (self *DummyEngine) Finalize(
func (self *DummyEngine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) {
- var extdata []byte
+ var extdata *[]byte
if self.cb.OnFinalizeAndAssemble != nil {
ret, err := self.cb.OnFinalizeAndAssemble(state, txs)
- extdata = ret
+ extdata = &ret
if err != nil {
return nil, err
}
diff --git a/core/blockchain.go b/core/blockchain.go
index 82e3b6c..b3a7ffa 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -2492,12 +2492,13 @@ func (bc *BlockChain) SubscribeBlockProcessingEvent(ch chan<- bool) event.Subscr
}
func (bc *BlockChain) ManualHead(hash common.Hash) error {
- block := bc.GetBlockByHash(hash)
- if block == nil {
- return errors.New("block not found")
- }
- bc.chainmu.Lock()
- defer bc.chainmu.Unlock()
- bc.writeHeadBlock(block)
- return nil
+ return bc.FastSyncCommitHead(hash)
+ //block := bc.GetBlockByHash(hash)
+ //if block == nil {
+ // return errors.New("block not found")
+ //}
+ //bc.chainmu.Lock()
+ //defer bc.chainmu.Unlock()
+ //bc.writeHeadBlock(block)
+ //return nil
}
diff --git a/core/state/database.go b/core/state/database.go
index a9342f5..385c25d 100644
--- a/core/state/database.go
+++ b/core/state/database.go
@@ -21,8 +21,8 @@ import (
"fmt"
"github.com/VictoriaMetrics/fastcache"
+ "github.com/ava-labs/coreth/core/rawdb"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/trie"
lru "github.com/hashicorp/golang-lru"
diff --git a/core/state/dump.go b/core/state/dump.go
index 9bb946d..6f09398 100644
--- a/core/state/dump.go
+++ b/core/state/dump.go
@@ -37,14 +37,15 @@ type DumpCollector interface {
// DumpAccount represents an account in the state.
type DumpAccount struct {
- Balance string `json:"balance"`
- Nonce uint64 `json:"nonce"`
- Root string `json:"root"`
- CodeHash string `json:"codeHash"`
- Code string `json:"code,omitempty"`
- Storage map[common.Hash]string `json:"storage,omitempty"`
- Address *common.Address `json:"address,omitempty"` // Address only present in iterative (line-by-line) mode
- SecureKey hexutil.Bytes `json:"key,omitempty"` // If we don't have address, we can output the key
+ Balance string `json:"balance"`
+ Nonce uint64 `json:"nonce"`
+ Root string `json:"root"`
+ CodeHash string `json:"codeHash"`
+ IsMultiCoin bool `json:"isMultiCoin"`
+ Code string `json:"code,omitempty"`
+ Storage map[common.Hash]string `json:"storage,omitempty"`
+ Address *common.Address `json:"address,omitempty"` // Address only present in iterative (line-by-line) mode
+ SecureKey hexutil.Bytes `json:"key,omitempty"` // If we don't have address, we can output the key
}
@@ -89,14 +90,15 @@ type iterativeDump struct {
// OnAccount implements DumpCollector interface
func (d iterativeDump) OnAccount(addr common.Address, account DumpAccount) {
dumpAccount := &DumpAccount{
- Balance: account.Balance,
- Nonce: account.Nonce,
- Root: account.Root,
- CodeHash: account.CodeHash,
- Code: account.Code,
- Storage: account.Storage,
- SecureKey: account.SecureKey,
- Address: nil,
+ Balance: account.Balance,
+ Nonce: account.Nonce,
+ Root: account.Root,
+ CodeHash: account.CodeHash,
+ IsMultiCoin: account.IsMultiCoin,
+ Code: account.Code,
+ Storage: account.Storage,
+ SecureKey: account.SecureKey,
+ Address: nil,
}
if addr != (common.Address{}) {
dumpAccount.Address = &addr
@@ -123,10 +125,11 @@ func (s *StateDB) DumpToCollector(c DumpCollector, excludeCode, excludeStorage,
panic(err)
}
account := DumpAccount{
- Balance: data.Balance.String(),
- Nonce: data.Nonce,
- Root: common.Bytes2Hex(data.Root[:]),
- CodeHash: common.Bytes2Hex(data.CodeHash),
+ Balance: data.Balance.String(),
+ Nonce: data.Nonce,
+ Root: common.Bytes2Hex(data.Root[:]),
+ CodeHash: common.Bytes2Hex(data.CodeHash),
+ IsMultiCoin: data.IsMultiCoin,
}
addrBytes := s.trie.GetKey(it.Key)
if addrBytes == nil {
diff --git a/core/state/snapshot/account.go b/core/state/snapshot/account.go
index b92e942..303c2fc 100644
--- a/core/state/snapshot/account.go
+++ b/core/state/snapshot/account.go
@@ -29,17 +29,19 @@ import (
// or slim-snapshot format which replaces the empty root and code hash as nil
// byte slice.
type Account struct {
- Nonce uint64
- Balance *big.Int
- Root []byte
- CodeHash []byte
+ Nonce uint64
+ Balance *big.Int
+ Root []byte
+ CodeHash []byte
+ IsMultiCoin bool
}
// SlimAccount converts a state.Account content into a slim snapshot account
-func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) Account {
+func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []byte, isMultiCoin bool) Account {
slim := Account{
- Nonce: nonce,
- Balance: balance,
+ Nonce: nonce,
+ Balance: balance,
+ IsMultiCoin: isMultiCoin,
}
if root != emptyRoot {
slim.Root = root[:]
@@ -52,8 +54,8 @@ func SlimAccount(nonce uint64, balance *big.Int, root common.Hash, codehash []by
// SlimAccountRLP converts a state.Account content into a slim snapshot
// version RLP encoded.
-func SlimAccountRLP(nonce uint64, balance *big.Int, root common.Hash, codehash []byte) []byte {
- data, err := rlp.EncodeToBytes(SlimAccount(nonce, balance, root, codehash))
+func SlimAccountRLP(nonce uint64, balance *big.Int, root common.Hash, codehash []byte, isMultiCoin bool) []byte {
+ data, err := rlp.EncodeToBytes(SlimAccount(nonce, balance, root, codehash, isMultiCoin))
if err != nil {
panic(err)
}
diff --git a/core/state/snapshot/generate.go b/core/state/snapshot/generate.go
index dac782f..27f8dfc 100644
--- a/core/state/snapshot/generate.go
+++ b/core/state/snapshot/generate.go
@@ -161,15 +161,16 @@ func (dl *diskLayer) generate(stats *generatorStats) {
accountHash := common.BytesToHash(accIt.Key)
var acc struct {
- Nonce uint64
- Balance *big.Int
- Root common.Hash
- CodeHash []byte
+ Nonce uint64
+ Balance *big.Int
+ Root common.Hash
+ CodeHash []byte
+ IsMultiCoin bool
}
if err := rlp.DecodeBytes(accIt.Value, &acc); err != nil {
log.Crit("Invalid account encountered during snapshot creation", "err", err)
}
- data := SlimAccountRLP(acc.Nonce, acc.Balance, acc.Root, acc.CodeHash)
+ data := SlimAccountRLP(acc.Nonce, acc.Balance, acc.Root, acc.CodeHash, acc.IsMultiCoin)
// If the account is not yet in-progress, write it out
if accMarker == nil || !bytes.Equal(accountHash[:], accMarker) {
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 805c607..b472bd7 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -270,11 +270,12 @@ func (self *StateDB) GetBalanceMultiCoin(addr common.Address, coinID common.Hash
func (self *StateDB) EnableMultiCoin(addr common.Address) error {
stateObject := self.GetOrNewStateObject(addr)
if stateObject.data.Root != emptyRoot && stateObject.data.Root != zeroRoot {
- return errors.New("not a fresh account")
+ return errors.New(fmt.Sprintf("not a fresh account: %s", stateObject.data.Root.Hex()))
}
if !stateObject.EnableMultiCoin() {
return errors.New("multi-coin mode already enabled")
}
+ log.Debug(fmt.Sprintf("enabled MC for %s", addr.Hex()))
return nil
}
@@ -527,7 +528,7 @@ func (s *StateDB) updateStateObject(obj *stateObject) {
// enough to track account updates at commit time, deletions need tracking
// at transaction boundary level to ensure we capture state clearing.
if s.snap != nil {
- s.snapAccounts[obj.addrHash] = snapshot.SlimAccountRLP(obj.data.Nonce, obj.data.Balance, obj.data.Root, obj.data.CodeHash)
+ s.snapAccounts[obj.addrHash] = snapshot.SlimAccountRLP(obj.data.Nonce, obj.data.Balance, obj.data.Root, obj.data.CodeHash, obj.data.IsMultiCoin)
}
}
diff --git a/core/types/block.go b/core/types/block.go
index 37f3464..99d6cc8 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -166,7 +166,7 @@ type Body struct {
Transactions []*Transaction
Uncles []*Header
Version uint32
- ExtData []byte `rlp:"nil"`
+ ExtData *[]byte `rlp:"nil"`
}
// Block represents an entire block in the Ethereum blockchain.
@@ -175,7 +175,7 @@ type Block struct {
uncles []*Header
transactions Transactions
version uint32
- extdata []byte
+ extdata *[]byte
// caches
hash atomic.Value
@@ -216,7 +216,7 @@ type myextblock struct {
Txs []*Transaction
Uncles []*Header
Version uint32
- ExtData []byte `rlp:"nil"`
+ ExtData *[]byte `rlp:"nil"`
}
// [deprecated by eth/63]
@@ -235,7 +235,7 @@ type storageblock struct {
// The values of TxHash, UncleHash, ReceiptHash and Bloom in header
// are ignored and set to values derived from the given txs, uncles
// and receipts.
-func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*Receipt, hasher Hasher, extdata []byte) *Block {
+func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*Receipt, hasher Hasher, extdata *[]byte) *Block {
b := &Block{header: CopyHeader(header), td: new(big.Int)}
// TODO: panic if len(txs) != len(receipts)
@@ -264,8 +264,11 @@ func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*
}
}
- b.extdata = make([]byte, len(extdata))
- copy(b.extdata, extdata)
+ if extdata != nil {
+ data := make([]byte, len(*extdata))
+ b.extdata = &data
+ copy(*b.extdata, *extdata)
+ }
return b
}
@@ -321,13 +324,13 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error {
}
func (b *Block) SetExtraData(data []byte) {
- b.extdata = data
+ b.extdata = &data
b.header.ExtDataHash = rlpHash(data)
b.hash = atomic.Value{}
}
func (b *Block) ExtraData() []byte {
- return b.extdata
+ return *b.extdata
}
func (b *Block) SetVersion(ver uint32) {
@@ -460,16 +463,23 @@ func (b *Block) WithSeal(header *Header) *Block {
}
// WithBody returns a new block with the given transaction and uncle contents.
-func (b *Block) WithBody(transactions []*Transaction, uncles []*Header, version uint32, extdata []byte) *Block {
+func (b *Block) WithBody(transactions []*Transaction, uncles []*Header, version uint32, extdata *[]byte) *Block {
+ var data *[]byte
+ if extdata != nil {
+ _data := make([]byte, len(*extdata))
+ data = &_data
+ }
block := &Block{
header: CopyHeader(b.header),
transactions: make([]*Transaction, len(transactions)),
uncles: make([]*Header, len(uncles)),
- extdata: make([]byte, len(extdata)),
+ extdata: data,
version: version,
}
copy(block.transactions, transactions)
- copy(block.extdata, extdata)
+ if data != nil {
+ copy(*block.extdata, *extdata)
+ }
for i := range uncles {
block.uncles[i] = CopyHeader(uncles[i])
}
diff --git a/core/vm/evm.go b/core/vm/evm.go
index 85b7ba7..e895211 100644
--- a/core/vm/evm.go
+++ b/core/vm/evm.go
@@ -275,17 +275,19 @@ func (evm *EVM) CallExpert(caller ContractRef, addr common.Address, input []byte
return nil, gas, ErrDepth
}
- mcerr := evm.Context.CanTransferMC(evm.StateDB, caller.Address(), addr, coinID, value2)
+ // Fail if we're trying to transfer more than the available balance
+ if value.Sign() != 0 && !evm.Context.CanTransfer(evm.StateDB, caller.Address(), value) {
+ return nil, gas, ErrInsufficientBalance
+ }
+
+ var to = AccountRef(addr)
+ mcerr := evm.Context.CanTransferMC(evm.StateDB, caller.Address(), to.Address(), coinID, value2)
if mcerr == 1 {
return nil, gas, ErrInsufficientBalance
} else if mcerr != 0 {
return nil, gas, ErrIncompatibleAccount
}
- // Fail if we're trying to transfer more than the available balance
- if value.Sign() != 0 && !evm.Context.CanTransfer(evm.StateDB, caller.Address(), value) {
- return nil, gas, ErrInsufficientBalance
- }
snapshot := evm.StateDB.Snapshot()
p, isPrecompile := evm.precompile(addr)
diff --git a/eth/api_backend.go b/eth/api_backend.go
index 65c3be4..bbc8691 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -24,6 +24,7 @@ import (
"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/consensus"
"github.com/ava-labs/coreth/core"
+ "github.com/ava-labs/coreth/core/bloombits"
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/types"
@@ -33,7 +34,6 @@ import (
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
diff --git a/eth/backend.go b/eth/backend.go
index b1c29a5..728ec4d 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -31,6 +31,7 @@ import (
"github.com/ava-labs/coreth/consensus/dummy"
"github.com/ava-labs/coreth/consensus/ethash"
"github.com/ava-labs/coreth/core"
+ "github.com/ava-labs/coreth/core/bloombits"
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
@@ -43,7 +44,6 @@ import (
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
- "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
diff --git a/eth/filters/filter.go b/eth/filters/filter.go
index e189391..48a76c7 100644
--- a/eth/filters/filter.go
+++ b/eth/filters/filter.go
@@ -22,10 +22,10 @@ import (
"math/big"
"github.com/ava-labs/coreth/core"
+ "github.com/ava-labs/coreth/core/bloombits"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
)
diff --git a/examples/chain/main.go b/examples/chain/main.go
index 17003b5..94c5d6b 100644
--- a/examples/chain/main.go
+++ b/examples/chain/main.go
@@ -138,6 +138,8 @@ func run(config *eth.Config, a1, a2, b1, b2 int) {
bob := NewTestChain("bob", config, aliceBlk, bobBlk, aliceAck, bobAck)
alice.Start()
bob.Start()
+ log.Info("alice genesis", "block", alice.chain.GetGenesisBlock().Hash().Hex())
+ log.Info("bob genesis", "block", bob.chain.GetGenesisBlock().Hash().Hex())
alice.GenRandomTree(a1, a2)
log.Info("alice finished generating the tree")
//time.Sleep(1 * time.Second)
@@ -205,7 +207,7 @@ func main() {
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
- IstanbulBlock: nil,
+ IstanbulBlock: big.NewInt(0),
Ethash: nil,
}
diff --git a/examples/counter/counter.sol b/examples/counter/counter.sol
index b21c3bf..952b925 100644
--- a/examples/counter/counter.sol
+++ b/examples/counter/counter.sol
@@ -1,4 +1,4 @@
-pragma solidity ^0.6.0;
+pragma solidity >=0.6.0;
contract Counter {
uint256 x;
diff --git a/examples/multicoin/main.go b/examples/multicoin/main.go
index 1f96647..fc379d4 100644
--- a/examples/multicoin/main.go
+++ b/examples/multicoin/main.go
@@ -47,12 +47,12 @@ func main() {
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
- IstanbulBlock: nil,
+ IstanbulBlock: big.NewInt(0),
Ethash: nil,
}
// configure the genesis block
- genesisJSON := `{"config":{"chainId":1,"homesteadBlock":0,"daoForkBlock":0,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0},"nonce":"0x0","timestamp":"0x0","extraData":"0x00","gasLimit":"0x5f5e100","difficulty":"0x0","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"751a0b96e1042bee789452ecb20253fba40dbe85":{"balance":"0x1000000000000000", "mcbalance": {"0x0000000000000000000000000000000000000000000000000000000000000000": 1000000000000000000}}, "0100000000000000000000000000000000000000": {"code": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80631e01043914610050578063abb24ba014610092578063b6510bb3146100a9575b600080fd5b61007c6004803603602081101561006657600080fd5b8101908080359060200190929190505050610118565b6040518082815260200191505060405180910390f35b81801561009e57600080fd5b506100a761013b565b005b8180156100b557600080fd5b50610116600480360360808110156100cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061013e565b005b60003073ffffffffffffffffffffffffffffffffffffffff1682905d9050919050565b5c565b8373ffffffffffffffffffffffffffffffffffffffff1681836108fc8690811502906040516000604051808303818888878c8af69550505050505015801561018a573d6000803e3d6000fd5b505050505056fea2646970667358221220ed2100d6623a884d196eceefabe5e03da4309a2562bb25262f3874f1acb31cd764736f6c634300060a0033", "balance": "0x0", "mcbalance": {}}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}`
+ genesisJSON := `{"config":{"chainId":1,"homesteadBlock":0,"daoForkBlock":0,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0},"nonce":"0x0","timestamp":"0x0","extraData":"0x00","gasLimit":"0x5f5e100","difficulty":"0x0","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","coinbase":"0x0000000000000000000000000000000000000000","alloc":{"751a0b96e1042bee789452ecb20253fba40dbe85":{"balance":"0x1000000000000000", "mcbalance": {"0x0000000000000000000000000000000000000000000000000000000000000000": 1000000000000000000}}, "0100000000000000000000000000000000000000": {"code": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80631e01043914610050578063abb24ba014610092578063b6510bb3146100a9575b600080fd5b61007c6004803603602081101561006657600080fd5b8101908080359060200190929190505050610118565b6040518082815260200191505060405180910390f35b81801561009e57600080fd5b506100a761013b565b005b8180156100b557600080fd5b50610116600480360360808110156100cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061013e565b005b60003073ffffffffffffffffffffffffffffffffffffffff168290cd9050919050565bce565b8373ffffffffffffffffffffffffffffffffffffffff1681836108fc8690811502906040516000604051808303818888878c8acf9550505050505015801561018a573d6000803e3d6000fd5b505050505056fea26469706673582212205c4d96aa2a6488c426daa9567616a383dd6156eb3fe84f4905239179e553fc0f64736f6c634300060a0033", "balance": "0x0", "mcbalance": {}}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}`
mcAbiJSON := `[{"inputs":[],"name":"enableMultiCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"coinid","type":"uint256"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"coinid","type":"uint256"},{"internalType":"uint256","name":"amount2","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"}]`
genesisKey := "0xabd71b35d559563fea757f0f5edbde286fb8c043105b15abb7cd57189306d7d1"
diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go
index cee6b57..f89a3aa 100644
--- a/internal/ethapi/backend.go
+++ b/internal/ethapi/backend.go
@@ -24,13 +24,13 @@ import (
"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/consensus"
"github.com/ava-labs/coreth/core"
+ "github.com/ava-labs/coreth/core/bloombits"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/params"
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 5c5a5b5..993727e 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -22,9 +22,9 @@ import (
"github.com/ava-labs/coreth/node"
"github.com/ava-labs/coreth/params"
+ "github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
- "github.com/ethereum/go-ethereum/rpc"
ethcrypto "github.com/ethereum/go-ethereum/crypto"