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

Function opByte

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

Source from the content-addressed store, hash-verified

273}
274
275func opByte(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
276 th, val := stack.pop(), stack.peek()
277 if th.Cmp(common.Big32) < 0 {
278 b := math.Byte(val, 32, int(th.Int64()))
279 val.SetUint64(uint64(b))
280 } else {
281 val.SetUint64(0)
282 }
283 evm.interpreter.intPool.put(th)
284 return nil, nil
285}
286
287// opAddmod Multiplexed verification memory algorithm if z equals max uint
288func opAddmod(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {

Callers 1

TestByteOpFunction · 0.85

Calls 5

popMethod · 0.80
CmpMethod · 0.80
Int64Method · 0.80
peekMethod · 0.45
putMethod · 0.45

Tested by 1

TestByteOpFunction · 0.68