View Source BitcoinLib.Script.Opcodes.Stack.Rot (BitcoinLib v0.4.7)

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

Word OP_ROT Opcode 123 Hex 0x7b Input x1 x2 x3 Output x2 x3 x1 The 3rd item down the stack is moved to the top.

Link to this section Summary

Functions

Returns <<0x7b>>

The 3rd item down the stack is moved to the top.

v()

Returns 0x7b

Link to this section Types

@type t() :: BitcoinLib.Script.Opcodes.Stack.Rot

Link to this section Functions

Returns <<0x7b>>

examples

Examples

iex> BitcoinLib.Script.Opcodes.Stack.Rot.encode()
<<0x7b>>
@spec execute(t(), list()) :: {:ok, list()} | {:error, binary()}

The 3rd item down the stack is moved to the top.

examples

Examples

iex> stack = [4, 3, 6, 1, 2]
...> %BitcoinLib.Script.Opcodes.Stack.Rot{}
...> |> BitcoinLib.Script.Opcodes.Stack.Rot.execute(stack)
{:ok, [6, 4, 3, 1, 2]}
@spec v() :: 123

Returns 0x7b

examples

Examples

iex> BitcoinLib.Script.Opcodes.Stack.Rot.v()
0x7b