diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-24 19:30:57 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-24 19:30:57 +0800 |
commit | ee7c16a8d977389c63ef60ea6c5eaff11e150ca4 (patch) | |
tree | fe3364d13e09a6cf619563aa8eba228ccdd0727e | |
parent | 1c85d8c66b9db23687b0446b4a7e97e3e61fe188 (diff) | |
download | dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar.gz dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar.bz2 dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar.lz dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar.xz dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.tar.zst dexon-ee7c16a8d977389c63ef60ea6c5eaff11e150ca4.zip |
Fixed Base problem and sload/sstore
-rw-r--r-- | ethchain/vm.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index 7df63b181..bc4c65d03 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -121,7 +121,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro } else { mult = ethutil.Big1 } - useGas(base.Mul(mult, GasSStore)) + useGas(new(big.Int).Mul(mult, GasSStore)) case oBALANCE: useGas(GasBalance) case oCREATE: @@ -156,6 +156,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro x, y := stack.Popn() // (x + y) % 2 ** 256 base.Add(x, y) + fmt.Println(x, y, base) // Pop result back on the stack stack.Push(base) case oSUB: @@ -317,8 +318,8 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro case oCALLDATALOAD: require(1) offset := stack.Pop().Int64() - fmt.Println(closure.Args) - val := closure.Args[offset : offset+31] + val := closure.Args[offset : offset+32] + fmt.Println(ethutil.BigD(val)) stack.Push(ethutil.BigD(val)) case oCALLDATASIZE: |