aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/vm.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/evm/vm.go')
-rw-r--r--plugin/evm/vm.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go
index 7a310bf..b72ac49 100644
--- a/plugin/evm/vm.go
+++ b/plugin/evm/vm.go
@@ -173,6 +173,8 @@ func (vm *VM) Initialize(
}
vm.ctx = ctx
+ vm.avaxAssetID = ctx.AVAXAssetID
+ vm.avm = ctx.XChainID
vm.chaindb = Database{db}
g := new(core.Genesis)
err := json.Unmarshal(b, g)
@@ -237,6 +239,11 @@ func (vm *VM) Initialize(
chain.SetOnExtraStateChange(func(block *types.Block, statedb *state.StateDB) error {
atx := vm.getAtomicTx(block).UnsignedTx.(*UnsignedImportTx)
vm.ctx.Log.Info(atx.ID().String())
+ for _, to := range atx.Outs {
+ amount := new(big.Int)
+ amount.SetUint64(to.Amount)
+ statedb.AddBalance(to.Address, amount)
+ }
return nil
})
vm.blockCache = cache.LRU{Size: 2048}