pub fn tx_script_bytecode_hash() -> b256 
Expand description

Get the hash of the script bytecode.
Reverts if not a transaction-script.

Returns

  • [b256] - The hash of the script bytecode.

Reverts

  • When the transaction type is of type Transaction::Create.

Examples

use std::tx::tx_script_bytecode_hash;

fn foo() {
    let script_bytecode_hash: b256 = tx_script_bytecode_hash();
    assert(script_bytecode_hash == 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef);
}