Enum bsv_wasm::script::op_codes::OpCodes [−][src]
pub enum OpCodes {}Show variants
OP_0, OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4, OP_1NEGATE, OP_1, OP_2, OP_3, OP_4, OP_5, OP_6, OP_7, OP_8, OP_9, OP_10, OP_11, OP_12, OP_13, OP_14, OP_15, OP_16, OP_NOP, OP_IF, OP_NOTIF, OP_ELSE, OP_ENDIF, OP_VERIFY, OP_RETURN, OP_TOALTSTACK, OP_FROMALTSTACK, OP_IFDUP, OP_DEPTH, OP_DROP, OP_DUP, OP_NIP, OP_OVER, OP_PICK, OP_ROLL, OP_ROT, OP_SWAP, OP_TUCK, OP_2DROP, OP_2DUP, OP_3DUP, OP_2OVER, OP_2ROT, OP_2SWAP, OP_CAT, OP_SPLIT, OP_SIZE, OP_INVERT, OP_AND, OP_OR, OP_XOR, OP_EQUAL, OP_EQUALVERIFY, OP_1ADD, OP_1SUB, OP_NEGATE, OP_ABS, OP_NOT, OP_0NOTEQUAL, OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD, OP_LSHIFT, OP_RSHIFT, OP_BOOLAND, OP_BOOLOR, OP_NUMEQUAL, OP_NUMEQUALVERIFY, OP_NUMNOTEQUAL, OP_LESSTHAN, OP_GREATERTHAN, OP_LESSTHANOREQUAL, OP_GREATERTHANOREQUAL, OP_MIN, OP_MAX, OP_WITHIN, OP_NUM2BIN, OP_BIN2NUM, OP_RIPEMD160, OP_SHA1, OP_SHA256, OP_HASH160, OP_HASH256, OP_CODESEPARATOR, OP_CHECKSIG, OP_CHECKSIGVERIFY, OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY, OP_CHECKLOCKTIMEVERIFY, OP_CHECKSEQUENCEVERIFY, OP_PUBKEYHASH, OP_PUBKEY, OP_INVALIDOPCODE, OP_RESERVED, OP_VER, OP_VERIF, OP_VERNOTIF, OP_RESERVED1, OP_RESERVED2, OP_NOP1, OP_NOP4, OP_NOP5, OP_NOP6, OP_NOP7, OP_NOP8, OP_NOP9, OP_NOP10, OP_INVALID_ABOVE, OP_2MUL, OP_2DIV,
Expand description
This entire page is borrowed from rust-sv (https://github.com/brentongunning/rust-sv/blob/master/src/script/op_codes.rs)
Variants
Pushes 0 onto the stack
Pushes 0 onto the stack The next byte sets the number of bytes to push onto the stack
The next two bytes sets the number of bytes to push onto the stack
The next four bytes sets the number of bytes to push onto the stack
Pushes -1 onto the stack
Pushes 1 onto the stack
Pushes 1 onto the stack Pushes 2 onto the stack
Pushes 3 onto the stack
Pushes 4 onto the stack
Pushes 5 onto the stack
Pushes 6 onto the stack
Pushes 7 onto the stack
Pushes 8 onto the stack
Pushes 9 onto the stack
Pushes 10 onto the stack
Pushes 11 onto the stack
Pushes 12 onto the stack
Pushes 13 onto the stack
Pushes 14 onto the stack
Pushes 15 onto the stack
Pushes 16 onto the stack
Does nothing
If the top stack is true, statements are executed. Top stack value is removed.
If the top stack is false, statements are executed. Top stack value is removed.
If the preceding OP_IF or OP_NOTIF statemetns were not executed, then statements are executed.
Ends an if-else block
Marks a statement as invalid if the top stack value is false. Top stack value is removed.
Marks a statements as invalid
Moves the top item on the main stack to the alt stack
Moves the top item on the alt stack to the main stack
Duplicates the top stack value if it is not zero
Puts the number of stack items onto the stack
Drops the top stack value
Duplicates the top stack item
Removes the second-to-top stack item
Copies the second-to-top stack item to the top
The item n back in the stack is copied to the top
The item n back in the stack is moved to the top
The top three items on the stack are rotated to the left
The top two items on the stack are swapped
The item at the top of the stack is copied and inserted before the second-to-top item
Removes the top two items from the stack
Duplicates the top two stack items
Duplicates the top three stack items
Copies the pair of items two spaces back to the front
The fifth and sixth items back are moved to the top of the stack
Swaps the top two pairs of items
Concatenates two byte sequences
Splits the byte sequence at position n
Pushes the byte sequence length of the top stack item without popping it
Flips all of the bits in the input
Boolean and between each bit in the inputs
Boolean or between each bit in the inputs
Boolean exclusive or between each bit in the inputs
Returns 1 if the inputs are exactly equal, 0 otherwise
Same as OP_EQUAL, but runs OP_VERIFY afterward
Adds 1 to the input
Subtracts 1 from the input
The sign of the input is flipped
The input is made positive
If the input is 0 or 1, it is flipped. Otherwise, the output will be 0.
Returns 0 if the input is 0. 1 otherwise.
Adds a to b
Subtracts b from a
Multiplies a by b
Divides a by b
Returns the remainder after dividing a by b
Shifts a left b bits, preserving sign
Shifts a right b bits, preserving sign
If both a and b are not empty, the output is 1. Otherwise, 0.
If a or b is not empty, the output is 1. Otherwise, 0.
Returns 1 if the numbers are equal. Otherwise, 0.
Same as OP_NUMEQUAL, but runs OP_VERIFY afterward
Returns 1 if the numbers are not equal. Otherwise, 0.
Returns 1 if a is less than b. Otherwise, 0.
Returns 1 if a is greater than b. Otherwise, 0.
Returns 1 if a is less than or equal to b. Otherwise, 0.
Returns 1 if a is greater than or equal to b. Otherwise, 0.
Returns the smaller of a and b
Returns the larger of a and b
Returns 1 if x is within the specified range, left inclusive. Otherwise, 0.
Converts numeric value a into a byte sequence of length b
Converts byte sequence x into a numeric value
The input is hashed using RIPEMD-160
The input is hashed using SHA-1
The input is hashed using SHA-256
The input is hashed twice: first with SHA-256 and then with RIPEMD-160
The input is hashed two times with SHA-256
Marks the part of the script after which the signature will begin matching
Puts 1 on the stack if the signature authorizes the public key and transaction hash. Otherwise 0.
Same as OP_CHECKSIG, but OP_VERIFY is executed afterward
Puts 1 on the stack if m of n signatures authorize the public key and transaction hash. Otherwise 0.
Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward
Marks transaction as invalid if the top stack item is greater than the transaction’s lock_time
Marks transaction as invalid if the top stack item is less than the transaction’s sequence used for relative lock time
Represents a public key hashed with OP_HASH160
Represents a public key compatible with OP_CHECKSIG
Matches any opcode that is not yet assigned
Transaction is invalid unless occuring in an unexecuted OP_IF branch
Transaction is invalid unless occuring in an unexecuted OP_IF branch
Transaction is invalid even when occuring in an unexecuted OP_IF branch
Transaction is invalid even when occuring in an unexecuted OP_IF branch
Transaction is invalid unless occuring in an unexecuted OP_IF branch
Transaction is invalid unless occuring in an unexecuted OP_IF branch
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
The word is ignored. Does not mark transaction as invalid.
Words at or above this number are invalid
The input is multiplied by 2
The input is divided by 2
Trait Implementations
Converts an i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts a usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts a f32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts the value of self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned. Read more
Converts the value of self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned. Read more
Converts the value of self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned. Read more
Converts the value of self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned. Read more
Converts the value of self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned. Read more
Converts the value of self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned. Read more
Converts the value of self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read more
Converts the value of self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned. Read more
Converts the value of self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned. Read more
Converts the value of self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned. Read more
Converts the value of self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned. Read more
Converts the value of self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read more
Converts the value of self
to an f32
. Overflows may map to positive
or negative inifinity, otherwise None
is returned if the value cannot
be represented by an f32
. Read more
Auto Trait Implementations
impl RefUnwindSafe for OpCodes
impl UnwindSafe for OpCodes
Blanket Implementations
Mutably borrows from an owned value. Read more
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more
type Output = T
type Output = T
Should always be Self