| 104 | } |
| 105 | |
| 106 | func opSmod(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 107 | x, y := math.S256(stack.pop()), math.S256(stack.pop()) |
| 108 | res := evm.interpreter.intPool.getZero() |
| 109 | |
| 110 | if y.Sign() == 0 { |
| 111 | stack.push(res) |
| 112 | } else { |
| 113 | if x.Sign() < 0 { |
| 114 | res.Mod(x.Abs(x), y.Abs(y)) |
| 115 | res.Neg(res) |
| 116 | } else { |
| 117 | res.Mod(x.Abs(x), y.Abs(y)) |
| 118 | } |
| 119 | stack.push(math.U256(res)) |
| 120 | } |
| 121 | evm.interpreter.intPool.put(x, y) |
| 122 | return nil, nil |
| 123 | } |
| 124 | |
| 125 | func opExp(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 126 | base, exponent := stack.pop(), stack.pop() |