MCPcopy Create free account
hub / github.com/BitVM/BitVM / u4_sort

Function u4_sort

bitvm/src/u4/u4_logic.rs:192–200  ·  view source on GitHub ↗

Sorts the top 2 stack values

()

Source from the content-addressed store, hash-verified

190
191/// Sorts the top 2 stack values
192pub fn u4_sort() -> Script {
193 script! {
194 OP_2DUP
195 OP_MIN
196 OP_TOALTSTACK
197 OP_MAX
198 OP_FROMALTSTACK
199 }
200}
201
202/// Calculates the logic operation with the given half table, lookup parameter denoting how many elements are there after the table including the two u4 elements
203pub fn u4_half_table_operation(lookup: u32) -> Script {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected