Commit 095cb976 authored by obscuren's avatar obscuren

EXP simplified

parent d80f8bda
...@@ -166,13 +166,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price * ...@@ -166,13 +166,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price *
case EXP: case EXP:
require(2) require(2)
exp := new(big.Int).Set(stack.data[stack.Len()-2]) gas.Set(big.NewInt(int64(len(stack.data[stack.Len()-2].Bytes()) + 1)))
nbytes := 0
for exp.Cmp(ethutil.Big0) > 0 {
nbytes += 1
exp.Rsh(exp, 8)
}
gas.Set(big.NewInt(int64(nbytes + 1)))
// Gas only // Gas only
case STOP: case STOP:
gas.Set(ethutil.Big0) gas.Set(ethutil.Big0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment