@@ -128,7 +128,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
128
128
mem .Resize (newMemSize .Uint64 ())
129
129
130
130
switch op {
131
- // 0x20 range
132
131
case ADD :
133
132
x , y := stack .pop (), stack .pop ()
134
133
self .Printf (" %v + %v" , y , x )
@@ -142,7 +141,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
142
141
stack .push (base )
143
142
case SUB :
144
143
x , y := stack .pop (), stack .pop ()
145
- self .Printf (" %v - %v" , y , x )
144
+ self .Printf (" %v - %v" , x , y )
146
145
147
146
base .Sub (x , y )
148
147
@@ -268,9 +267,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
268
267
}
269
268
case NOT :
270
269
stack .push (U256 (new (big.Int ).Not (stack .pop ())))
271
- //base.Sub(Pow256, stack.pop()).Sub(base, common.Big1)
272
- //base = U256(base)
273
- //stack.push(base)
274
270
case LT :
275
271
x , y := stack .pop (), stack .pop ()
276
272
self .Printf (" %v < %v" , x , y )
@@ -329,7 +325,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
329
325
stack .push (common .BigTrue )
330
326
}
331
327
332
- // 0x10 range
333
328
case AND :
334
329
x , y := stack .pop (), stack .pop ()
335
330
self .Printf (" %v & %v" , y , x )
@@ -390,15 +385,13 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
390
385
391
386
stack .push (base )
392
387
393
- // 0x20 range
394
388
case SHA3 :
395
389
offset , size := stack .pop (), stack .pop ()
396
390
data := crypto .Sha3 (mem .Get (offset .Int64 (), size .Int64 ()))
397
391
398
392
stack .push (common .BigD (data ))
399
393
400
394
self .Printf (" => (%v) %x" , size , data )
401
- // 0x30 range
402
395
case ADDRESS :
403
396
stack .push (common .Bytes2Big (context .Address ().Bytes ()))
404
397
@@ -486,7 +479,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
486
479
487
480
self .Printf (" => %x" , context .Price )
488
481
489
- // 0x40 range
490
482
case BLOCKHASH :
491
483
num := stack .pop ()
492
484
@@ -527,7 +519,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
527
519
528
520
stack .push (self .env .GasLimit ())
529
521
530
- // 0x50 range
531
522
case PUSH1 , PUSH2 , PUSH3 , PUSH4 , PUSH5 , PUSH6 , PUSH7 , PUSH8 , PUSH9 , PUSH10 , PUSH11 , PUSH12 , PUSH13 , PUSH14 , PUSH15 , PUSH16 , PUSH17 , PUSH18 , PUSH19 , PUSH20 , PUSH21 , PUSH22 , PUSH23 , PUSH24 , PUSH25 , PUSH26 , PUSH27 , PUSH28 , PUSH29 , PUSH30 , PUSH31 , PUSH32 :
532
523
a := big .NewInt (int64 (op - PUSH1 + 1 ))
533
524
byts := getData (code , new (big.Int ).Add (pc , big .NewInt (1 )), a )
@@ -553,12 +544,11 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
553
544
topics := make ([]common.Hash , n )
554
545
mStart , mSize := stack .pop (), stack .pop ()
555
546
for i := 0 ; i < n ; i ++ {
556
- topics [i ] = common .BigToHash (stack .pop ()) //common.LeftPadBytes(stack.pop().Bytes(), 32)
547
+ topics [i ] = common .BigToHash (stack .pop ())
557
548
}
558
549
559
550
data := mem .Get (mStart .Int64 (), mSize .Int64 ())
560
551
log := state .NewLog (context .Address (), topics , data , self .env .BlockNumber ().Uint64 ())
561
- //log := &Log{context.Address(), topics, data, self.env.BlockNumber().Uint64()}
562
552
self .env .AddLog (log )
563
553
564
554
self .Printf (" => %v" , log )
@@ -568,7 +558,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
568
558
stack .push (val )
569
559
570
560
self .Printf (" => 0x%x" , val .Bytes ())
571
- case MSTORE : // Store the value at stack top-1 in to memory at location stack top
561
+ case MSTORE :
572
562
// pop value of the stack
573
563
mStart , val := stack .pop (), stack .pop ()
574
564
mem .Set (mStart .Uint64 (), 32 , common .BigToBytes (val , 256 ))
@@ -614,15 +604,13 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
614
604
615
605
case JUMPDEST :
616
606
case PC :
617
- //stack.push(big.NewInt(int64(pc)))
618
607
stack .push (pc )
619
608
case MSIZE :
620
609
stack .push (big .NewInt (int64 (mem .Len ())))
621
610
case GAS :
622
611
stack .push (context .Gas )
623
612
624
613
self .Printf (" => %x" , context .Gas )
625
- // 0x60 range
626
614
case CREATE :
627
615
628
616
var (
0 commit comments