BSV.Contract.Helpers (BSV v2.0.0) View Source
Collection of helpers functions for use in BSV.Contract
modules.
Link to this section Summary
Functions
Iterates over the given list of private keys and for each signs the
transaction context
and pushes each signature onto
the stack.
Pushes OP_0
onto the script.
Pushes OP_0NOTEQUAL
onto the script.
Pushes OP_1
onto the script.
Pushes OP_10
onto the script.
Pushes OP_11
onto the script.
Pushes OP_12
onto the script.
Pushes OP_13
onto the script.
Pushes OP_14
onto the script.
Pushes OP_15
onto the script.
Pushes OP_16
onto the script.
Pushes OP_1ADD
onto the script.
Pushes OP_1NEGATE
onto the script.
Pushes OP_1SUB
onto the script.
Pushes OP_2
onto the script.
Pushes OP_2DIV
onto the script.
Pushes OP_2DROP
onto the script.
Pushes OP_2DUP
onto the script.
Pushes OP_2MUL
onto the script.
Pushes OP_2OVER
onto the script.
Pushes OP_2ROT
onto the script.
Pushes OP_2SWAP
onto the script.
Pushes OP_3
onto the script.
Pushes OP_3DUP
onto the script.
Pushes OP_4
onto the script.
Pushes OP_5
onto the script.
Pushes OP_6
onto the script.
Pushes OP_7
onto the script.
Pushes OP_8
onto the script.
Pushes OP_9
onto the script.
Pushes OP_ABS
onto the script.
Pushes OP_ADD
onto the script.
Pushes OP_AND
onto the script.
Pushes OP_BIN2NUM
onto the script.
Pushes OP_BOOLAND
onto the script.
Pushes OP_BOOLOR
onto the script.
Pushes OP_CAT
onto the script.
Pushes OP_CHECKLOCKTIMEVERIFY
onto the script.
Pushes OP_CHECKMULTISIG
onto the script.
Pushes OP_CHECKMULTISIGVERIFY
onto the script.
Pushes OP_CHECKSEQUENCEVERIFY
onto the script.
Pushes OP_CHECKSIG
onto the script.
Pushes OP_CHECKSIGVERIFY
onto the script.
Pushes OP_CODESEPARATOR
onto the script.
Pushes OP_DEPTH
onto the script.
Pushes OP_DIV
onto the script.
Pushes OP_DROP
onto the script.
Pushes OP_DUP
onto the script.
Pushes OP_ELSE
onto the script.
Pushes OP_ENDIF
onto the script.
Pushes OP_EQUAL
onto the script.
Pushes OP_EQUALVERIFY
onto the script.
Pushes OP_FALSE
onto the script.
Pushes OP_FROMALTSTACK
onto the script.
Pushes OP_GREATERTHAN
onto the script.
Pushes OP_GREATERTHANOREQUAL
onto the script.
Pushes OP_HASH160
onto the script.
Pushes OP_HASH256
onto the script.
Pushes OP_IF
onto the script.
Pushes OP_IFDUP
onto the script.
Pushes OP_INVALIDOPCODE
onto the script.
Pushes OP_INVERT
onto the script.
Pushes OP_LESSTHAN
onto the script.
Pushes OP_LESSTHANOREQUAL
onto the script.
Pushes OP_LSHIFT
onto the script.
Pushes OP_MAX
onto the script.
Pushes OP_MIN
onto the script.
Pushes OP_MOD
onto the script.
Pushes OP_MUL
onto the script.
Pushes OP_NEGATE
onto the script.
Pushes OP_NIP
onto the script.
Pushes OP_NOP
onto the script.
Pushes OP_NOP1
onto the script.
Pushes OP_NOP10
onto the script.
Pushes OP_NOP2
onto the script.
Pushes OP_NOP3
onto the script.
Pushes OP_NOP4
onto the script.
Pushes OP_NOP5
onto the script.
Pushes OP_NOP6
onto the script.
Pushes OP_NOP7
onto the script.
Pushes OP_NOP8
onto the script.
Pushes OP_NOP9
onto the script.
Pushes OP_NOT
onto the script.
Pushes OP_NOTIF
onto the script.
Pushes OP_NUM2BIN
onto the script.
Pushes OP_NUMEQUAL
onto the script.
Pushes OP_NUMEQUALVERIFY
onto the script.
Pushes OP_NUMNOTEQUAL
onto the script.
Pushes OP_OR
onto the script.
Pushes OP_OVER
onto the script.
Pushes OP_PICK
onto the script.
Pushes OP_PUBKEY
onto the script.
Pushes OP_PUBKEYHASH
onto the script.
Pushes OP_PUBKEYS
onto the script.
Pushes OP_PUSHDATA1
onto the script.
Pushes OP_PUSHDATA2
onto the script.
Pushes OP_PUSHDATA4
onto the script.
Pushes OP_RESERVED
onto the script.
Pushes OP_RESERVED1
onto the script.
Pushes OP_RESERVED2
onto the script.
Pushes OP_RETURN
onto the script.
Pushes OP_RIPEMD160
onto the script.
Pushes OP_ROLL
onto the script.
Pushes OP_ROT
onto the script.
Pushes OP_RSHIFT
onto the script.
Pushes OP_SHA1
onto the script.
Pushes OP_SHA256
onto the script.
Pushes OP_SIZE
onto the script.
Pushes OP_SMALLDATA
onto the script.
Pushes OP_SMALLINTEGER
onto the script.
Pushes OP_SPLIT
onto the script.
Pushes OP_SUB
onto the script.
Pushes OP_SWAP
onto the script.
Pushes OP_TOALTSTACK
onto the script.
Pushes OP_TRUE
onto the script.
Pushes OP_TUCK
onto the script.
Pushes OP_VER
onto the script.
Pushes OP_VERIF
onto the script.
Pushes OP_VERIFY
onto the script.
Pushes OP_VERNOTIF
onto the script.
Pushes OP_WITHIN
onto the script.
Pushes OP_XOR
onto the script.
Pushes the given data onto the script.
Pushes the given list of data onto the script in seperate pushes.
Signs the transaction context
and pushes the
signature onto the stack.
Link to this section Functions
Specs
multi_sig(BSV.Contract.t(), [BSV.PrivKey.t()]) :: BSV.Contract.t()
Iterates over the given list of private keys and for each signs the
transaction context
and pushes each signature onto
the stack.
If no context is available in the contract
, then for
each private key 71 bytes of zeros are pushed onto the stack instead.
Specs
op_0(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_0
onto the script.
Specs
op_0notequal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_0NOTEQUAL
onto the script.
Specs
op_1(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_1
onto the script.
Specs
op_10(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_10
onto the script.
Specs
op_11(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_11
onto the script.
Specs
op_12(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_12
onto the script.
Specs
op_13(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_13
onto the script.
Specs
op_14(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_14
onto the script.
Specs
op_15(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_15
onto the script.
Specs
op_16(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_16
onto the script.
Specs
op_1add(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_1ADD
onto the script.
Specs
op_1negate(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_1NEGATE
onto the script.
Specs
op_1sub(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_1SUB
onto the script.
Specs
op_2(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2
onto the script.
Specs
op_2div(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2DIV
onto the script.
Specs
op_2drop(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2DROP
onto the script.
Specs
op_2dup(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2DUP
onto the script.
Specs
op_2mul(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2MUL
onto the script.
Specs
op_2over(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2OVER
onto the script.
Specs
op_2rot(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2ROT
onto the script.
Specs
op_2swap(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_2SWAP
onto the script.
Specs
op_3(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_3
onto the script.
Specs
op_3dup(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_3DUP
onto the script.
Specs
op_4(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_4
onto the script.
Specs
op_5(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_5
onto the script.
Specs
op_6(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_6
onto the script.
Specs
op_7(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_7
onto the script.
Specs
op_8(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_8
onto the script.
Specs
op_9(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_9
onto the script.
Specs
op_abs(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ABS
onto the script.
Specs
op_add(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ADD
onto the script.
Specs
op_and(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_AND
onto the script.
Specs
op_bin2num(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_BIN2NUM
onto the script.
Specs
op_booland(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_BOOLAND
onto the script.
Specs
op_boolor(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_BOOLOR
onto the script.
Specs
op_cat(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CAT
onto the script.
Specs
op_checklocktimeverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKLOCKTIMEVERIFY
onto the script.
Specs
op_checkmultisig(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKMULTISIG
onto the script.
Specs
op_checkmultisigverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKMULTISIGVERIFY
onto the script.
Specs
op_checksequenceverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKSEQUENCEVERIFY
onto the script.
Specs
op_checksig(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKSIG
onto the script.
Specs
op_checksigverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CHECKSIGVERIFY
onto the script.
Specs
op_codeseparator(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_CODESEPARATOR
onto the script.
Specs
op_depth(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_DEPTH
onto the script.
Specs
op_div(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_DIV
onto the script.
Specs
op_drop(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_DROP
onto the script.
Specs
op_dup(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_DUP
onto the script.
Specs
op_else(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ELSE
onto the script.
Specs
op_endif(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ENDIF
onto the script.
Specs
op_equal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_EQUAL
onto the script.
Specs
op_equalverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_EQUALVERIFY
onto the script.
Specs
op_false(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_FALSE
onto the script.
Specs
op_fromaltstack(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_FROMALTSTACK
onto the script.
Specs
op_greaterthan(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_GREATERTHAN
onto the script.
Specs
op_greaterthanorequal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_GREATERTHANOREQUAL
onto the script.
Specs
op_hash160(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_HASH160
onto the script.
Specs
op_hash256(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_HASH256
onto the script.
Specs
op_if(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_IF
onto the script.
Specs
op_ifdup(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_IFDUP
onto the script.
Specs
op_invalidopcode(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_INVALIDOPCODE
onto the script.
Specs
op_invert(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_INVERT
onto the script.
Specs
op_lessthan(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_LESSTHAN
onto the script.
Specs
op_lessthanorequal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_LESSTHANOREQUAL
onto the script.
Specs
op_lshift(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_LSHIFT
onto the script.
Specs
op_max(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_MAX
onto the script.
Specs
op_min(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_MIN
onto the script.
Specs
op_mod(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_MOD
onto the script.
Specs
op_mul(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_MUL
onto the script.
Specs
op_negate(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NEGATE
onto the script.
Specs
op_nip(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NIP
onto the script.
Specs
op_nop(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP
onto the script.
Specs
op_nop1(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP1
onto the script.
Specs
op_nop10(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP10
onto the script.
Specs
op_nop2(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP2
onto the script.
Specs
op_nop3(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP3
onto the script.
Specs
op_nop4(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP4
onto the script.
Specs
op_nop5(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP5
onto the script.
Specs
op_nop6(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP6
onto the script.
Specs
op_nop7(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP7
onto the script.
Specs
op_nop8(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP8
onto the script.
Specs
op_nop9(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOP9
onto the script.
Specs
op_not(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOT
onto the script.
Specs
op_notif(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NOTIF
onto the script.
Specs
op_num2bin(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NUM2BIN
onto the script.
Specs
op_numequal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NUMEQUAL
onto the script.
Specs
op_numequalverify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NUMEQUALVERIFY
onto the script.
Specs
op_numnotequal(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_NUMNOTEQUAL
onto the script.
Specs
op_or(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_OR
onto the script.
Specs
op_over(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_OVER
onto the script.
Specs
op_pick(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PICK
onto the script.
Specs
op_pubkey(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUBKEY
onto the script.
Specs
op_pubkeyhash(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUBKEYHASH
onto the script.
Specs
op_pubkeys(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUBKEYS
onto the script.
Specs
op_pushdata1(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUSHDATA1
onto the script.
Specs
op_pushdata2(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUSHDATA2
onto the script.
Specs
op_pushdata4(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_PUSHDATA4
onto the script.
Specs
op_reserved(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RESERVED
onto the script.
Specs
op_reserved1(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RESERVED1
onto the script.
Specs
op_reserved2(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RESERVED2
onto the script.
Specs
op_return(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RETURN
onto the script.
Specs
op_ripemd160(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RIPEMD160
onto the script.
Specs
op_roll(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ROLL
onto the script.
Specs
op_rot(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_ROT
onto the script.
Specs
op_rshift(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_RSHIFT
onto the script.
Specs
op_sha1(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SHA1
onto the script.
Specs
op_sha256(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SHA256
onto the script.
Specs
op_size(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SIZE
onto the script.
Specs
op_smalldata(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SMALLDATA
onto the script.
Specs
op_smallinteger(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SMALLINTEGER
onto the script.
Specs
op_split(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SPLIT
onto the script.
Specs
op_sub(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SUB
onto the script.
Specs
op_swap(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_SWAP
onto the script.
Specs
op_toaltstack(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_TOALTSTACK
onto the script.
Specs
op_true(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_TRUE
onto the script.
Specs
op_tuck(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_TUCK
onto the script.
Specs
op_ver(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_VER
onto the script.
Specs
op_verif(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_VERIF
onto the script.
Specs
op_verify(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_VERIFY
onto the script.
Specs
op_vernotif(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_VERNOTIF
onto the script.
Specs
op_within(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_WITHIN
onto the script.
Specs
op_xor(BSV.Contract.t()) :: BSV.Contract.t()
Pushes OP_XOR
onto the script.
Specs
push(BSV.Contract.t(), atom() | binary() | integer()) :: BSV.Contract.t()
Pushes the given data onto the script.
Specs
push_all(BSV.Contract.t(), [atom() | binary() | integer()]) :: BSV.Contract.t()
Pushes the given list of data onto the script in seperate pushes.
Specs
sig(BSV.Contract.t(), BSV.PrivKey.t()) :: BSV.Contract.t()
Signs the transaction context
and pushes the
signature onto the stack.
If no context is available in the contract
, then
71 bytes of zeros are pushed onto the stack instead.