aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-23 19:42:30 +0800
committerobscuren <geffobscura@gmail.com>2014-06-23 19:42:30 +0800
commit614624754d2dcaf9344a3efbfa880c9b0ddba6be (patch)
tree987ca71b1b47d283de860dde7fdd9f1800aa8748 /ethchain/vm.go
parentd890258af6de8c5ef9701826fb4ee7c353788ad5 (diff)
downloaddexon-614624754d2dcaf9344a3efbfa880c9b0ddba6be.tar.gz
dexon-614624754d2dcaf9344a3efbfa880c9b0ddba6be.tar.zst
dexon-614624754d2dcaf9344a3efbfa880c9b0ddba6be.zip
Let the state create the object
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r--ethchain/vm.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index a2e1c60fd..432bc4e6d 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -594,7 +594,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
// Generate a new address
addr := ethutil.CreateAddress(closure.caller.Address(), closure.caller.N())
// Create a new contract
- contract := NewContract(addr, value, []byte(""))
+ contract := vm.state.NewStateObject(addr)
+ contract.Amount = value
+
// Set the init script
contract.initScript = mem.Get(offset.Int64(), size.Int64())
// Transfer all remaining gas to the new