MCPcopy Create free account
hub / github.com/CPChain/chain / opMod

Function opMod

core/vm/instructions.go:95–104  ·  view source on GitHub ↗
(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack)

Source from the content-addressed store, hash-verified

93}
94
95func opMod(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
96 x, y := stack.pop(), stack.pop()
97 if y.Sign() == 0 {
98 stack.push(x.SetUint64(0))
99 } else {
100 stack.push(math.U256(x.Mod(x, y)))
101 }
102 evm.interpreter.intPool.put(y)
103 return nil, nil
104}
105
106func opSmod(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
107 x, y := math.S256(stack.pop()), math.S256(stack.pop())

Callers

nothing calls this directly

Calls 4

popMethod · 0.80
SignMethod · 0.45
pushMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected