View Source BitcoinLib.Script.Opcodes.Stack.Dup (BitcoinLib v0.4.7)
Based on https://en.bitcoin.it/wiki/Script
Word OP_DUP Opcode 118 Hex 0x76 Input x Output x x Description Duplicates the top stack item.
Link to this section Summary
Link to this section Types
@type t() :: BitcoinLib.Script.Opcodes.Stack.Dup
Link to this section Functions
Returns <<0x76>>
examples
Examples
iex> BitcoinLib.Script.Opcodes.Stack.Dup.encode()
<<0x76>>
Duplicates the top stack item.
examples
Examples
iex> stack = [4, 3]
...> %BitcoinLib.Script.Opcodes.Stack.Dup{}
...> |> BitcoinLib.Script.Opcodes.Stack.Dup.execute(stack)
{:ok, [4, 4, 3]}
@spec v() :: 118
Returns 0x76
examples
Examples
iex> BitcoinLib.Script.Opcodes.Stack.Dup.v()
0x76