View Source BitcoinLib.Script.Opcodes.Stack.Depth (BitcoinLib v0.4.7)
Based on https://en.bitcoin.it/wiki/Script
Word OP_DEPTH Opcode 116 Hex 0x74 Input nothing Output stack size Puts the number of stack items onto the stack.
Link to this section Summary
Link to this section Types
@type t() :: BitcoinLib.Script.Opcodes.Stack.Depth
Link to this section Functions
Returns <<0x74>>
examples
Examples
iex> BitcoinLib.Script.Opcodes.Stack.Depth.encode()
<<0x74>>
Swaps the top two pairs of items.
examples
Examples
iex> stack = [1, 2, 3, 4, 5]
...> %BitcoinLib.Script.Opcodes.Stack.Depth{}
...> |> BitcoinLib.Script.Opcodes.Stack.Depth.execute(stack)
{:ok, [5, 1, 2, 3, 4, 5]}
@spec v() :: 116
Returns 0x74
examples
Examples
iex> BitcoinLib.Script.Opcodes.Stack.Depth.v()
0x74