View Source BitcoinLib.Script.Opcodes.Constants.OneNegate (BitcoinLib v0.4.7)

Based on https://en.bitcoin.it/wiki/Script

Word OP_1NEGATE Opcode 79 Hex 0x4f Input Nothing. Output -1 Description The number -1 is pushed onto the stack.

Link to this section Summary

Functions

Returns <<0x4f>>

The number 1 is pushed onto the stack.

v()

Returns 0x4f

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Constants.OneNegate

Link to this section Functions

@spec encode() :: <<_::8>>

Returns <<0x4f>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.OneNegate.encode()
<<0x4f>>
Link to this function

execute(one_negate, list)

View Source
@spec execute(t(), list()) :: {:ok, list()}

The number 1 is pushed onto the stack.

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.OneNegate.execute(
...>  %BitcoinLib.Script.Opcodes.Constants.OneNegate{},
...>  [3]
...> )
{:ok, [-1,3]}
@spec v() :: 79

Returns 0x4f

examples

Examples

iex> BitcoinLib.Script.Opcodes.Constants.OneNegate.v()
0x4f