| 749 | } |
| 750 | |
| 751 | func opStaticCall(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 752 | // Pop gas. The actual gas is in evm.callGasTemp. |
| 753 | evm.interpreter.intPool.put(stack.pop()) |
| 754 | gas := evm.callGasTemp |
| 755 | // Pop other call parameters. |
| 756 | addr, inOffset, inSize, retOffset, retSize := stack.pop(), stack.pop(), stack.pop(), stack.pop(), stack.pop() |
| 757 | toAddr := common.BigToAddress(addr) |
| 758 | // Get arguments from the memory. |
| 759 | args := memory.Get(inOffset.Int64(), inSize.Int64()) |
| 760 | |
| 761 | ret, returnGas, err := evm.StaticCall(contract, toAddr, args, gas) |
| 762 | if err != nil { |
| 763 | stack.push(evm.interpreter.intPool.getZero()) |
| 764 | } else { |
| 765 | stack.push(evm.interpreter.intPool.get().SetUint64(1)) |
| 766 | } |
| 767 | if err == nil || err == errExecutionReverted { |
| 768 | memory.Set(retOffset.Uint64(), retSize.Uint64(), ret) |
| 769 | } |
| 770 | contract.Gas += returnGas |
| 771 | |
| 772 | evm.interpreter.intPool.put(addr, inOffset, inSize, retOffset, retSize) |
| 773 | return ret, nil |
| 774 | } |
| 775 | |
| 776 | func opReturn(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 777 | offset, size := stack.pop(), stack.pop() |