diff options
Diffstat (limited to 'vm/vm_debug.go')
-rw-r--r-- | vm/vm_debug.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go index 13446d6c0..b3fbfe341 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -169,9 +169,13 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) { gas.Set(ethutil.Big0) case SLOAD: + require(1) + gas.Set(GasSLoad) // Memory resize & Gas case SSTORE: + require(2) + var mult *big.Int y, x := stack.Peekn() val := closure.GetStorage(x) @@ -179,7 +183,8 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) { // 0 => non 0 mult = ethutil.Big3 } else if val.BigInt().Cmp(ethutil.Big0) != 0 && len(y.Bytes()) == 0 { - //state.AddBalance(closure.caller.Address(), new(big.Int).Mul(big.NewInt(100), closure.Price)) + state.Refund(closure.caller.Address(), GasSStoreRefund, closure.Price) + mult = ethutil.Big0 } else { // non 0 => non 0 @@ -699,11 +704,11 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) { self.Printf(" => [%d] %x [0] %x", n, x.Bytes(), y.Bytes()) case LOG0, LOG1, LOG2, LOG3, LOG4: n := int(op - LOG0) - topics := make([]*big.Int, n) + topics := make([][]byte, n) mSize, mStart := stack.Pop().Int64(), stack.Pop().Int64() data := mem.Geti(mStart, mSize) for i := 0; i < n; i++ { - topics[i] = stack.Pop() + topics[i] = stack.Pop().Bytes() } self.env.AddLog(Log{closure.Address(), topics, data}) case MLOAD: |